all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23823: 25.0.95; Reset between highlight buffer/file comparisons
@ 2016-06-22 10:11 Tino Calancha
       [not found] ` <handler.23823.B.14665903065838.ack@debbugs.gnu.org>
  2016-06-22 15:16 ` bug#23823: 25.0.95; Reset between highlight buffer/file comparisons Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Tino Calancha @ 2016-06-22 10:11 UTC (permalink / raw)
  To: 23823


./emacs -r -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foo")) 
(switch-to-buffer "bar") (insert "boo"))'
M-: (highlight-compare-with-file "/tmp/foo") RET
C-b C-b DEL f
M-: M-p RET
;; Now current buffer content equals /tmp/foo content
;; but foo is still displayed with face highlight-changes.



In GNU Emacs 25.0.95.2 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
Repository revision: 829733104db073f8abd67765eae162e7360281fa

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Following patch fixed it calling
(and highlight-changes-mode (hilit-chg-clear))
each time
(highlight-changes-mode 1)
is called.
It would be better if such reset were performed inside one hook.
Any idea to do this better?


From 18251da925f8f8c6cca50b2a4f56235534c0a479 Mon Sep 17 00:00:00 2001
From: Tino Calancha <f92capac@gmail.com>
Date: Wed, 22 Jun 2016 18:29:13 +0900
Subject: [PATCH] Reset between highlight comparisons

* lisp/hilit-chg.el (highlight-markup-buffers)
(highlight-changes-mode-turn-on): Call hilit-chg-clear before
performing a new comparison (Bug#23823).
---
  lisp/hilit-chg.el | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 8f042b6..f6eae52 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -804,8 +804,12 @@ highlight-markup-buffers
        (or file-b
  	  (setq temp-b (setq file-b (ediff-make-temp-file buf-b nil))))
        (set-buffer buf-a)
+      (when highlight-changes-mode
+        (hilit-chg-clear))
        (highlight-changes-mode 1)
        (or markup-a-only (with-current-buffer buf-b
+                          (when highlight-changes-mode
+                            (hilit-chg-clear))
  			  (highlight-changes-mode 1)))
        (setq change-info (hilit-chg-get-diff-info buf-a file-a buf-b 
file-b))

@@ -993,6 +997,8 @@ highlight-changes-mode-turn-on
  	     (and
  	      (not (string-match "^[ *]" (buffer-name)))
  	      (buffer-file-name))))
+          (when highlight-changes-mode
+            (hilit-chg-clear))
  	  (highlight-changes-mode 1))
  	))

-- 
2.8.1







^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-25 12:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-22 10:11 bug#23823: 25.0.95; Reset between highlight buffer/file comparisons Tino Calancha
     [not found] ` <handler.23823.B.14665903065838.ack@debbugs.gnu.org>
2016-06-22 10:22   ` bug#23823: Acknowledgement (25.0.95; Reset between highlight buffer/file comparisons) Tino Calancha
2016-06-22 15:16 ` bug#23823: 25.0.95; Reset between highlight buffer/file comparisons Eli Zaretskii
2016-06-23  0:46   ` Tino Calancha
2016-06-23 15:24     ` Eli Zaretskii
2016-06-24  4:36       ` Tino Calancha
2016-06-24  7:07         ` Eli Zaretskii
2016-06-24 13:13           ` Tino Calancha
2019-06-25 12:25             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.