GNU bug report logs -
#23823
25.0.95; Reset between highlight buffer/file comparisons
Previous Next
Reported by: Tino Calancha <f92capac <at> gmail.com>
Date: Wed, 22 Jun 2016 10:12:01 UTC
Severity: minor
Tags: patch, wontfix
Found in version 25.0.95
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Fri, 24 Jun 2016, Eli Zaretskii wrote:
> But the function's doc string clearly makes that expected behavior:
>
> If the current buffer is visiting the file being compared against, it
> also will have its differences highlighted.
>
> The only way I can interpret that "also" part is that the changes
> against the file are highlighted _in_addition_ to the changes tracked
> by the mode. Your scenario just happens to produce a clash between
> these two sets of differences, and the result could be ambiguous. But
> what we get in fact doesn't seem unreasonable to me.
You convinced me: there is no need to reset those highlighted differences.
If the user want to do that he/she could toggle eaasily the mode before
calling the func. Adding a prefix argument to reset may cause accidentaly
lost all the tracked differences.
The comentary of this lib helps to understand the design intentions.
For example when it says:
;; You can "age" different sets of changes by using
;; `highlight-changes-rotate-faces'.
Each time the buffer is saved, the new differences get a different face.
Following example shows the point:
emacs -Q -eval "(progn (with-temp-file \"/tmp/foo\" (insert \"Hi i am foo\n\")) (find-file \"/tmp/foo\") (highlight-changes-mode 1) (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t))"
M-: (progn (goto-char (point-max)) (insert "Hi foo, i am bar.\n") (highlight-compare-with-file "/tmp/foo")) RET y y
M-: (progn (goto-char (point-max)) (insert "Nice to meet you foo.\n") (highlight-compare-with-file "/tmp/foo")) RET y y
M-: (progn (goto-char (point-max)) (insert "Nice to meet you too, bar.\n") (highlight-compare-with-file "/tmp/foo")) RET y y
;; If we reset the buffer on each func call we will loose all this
;; psicodelic color structure :-S
This bug report was last modified 6 years and 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.