unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12361: hilit-chg.el bug causes conflict with yasnippet (patch included)
@ 2012-09-05 17:14 Le Wang
  2012-12-07  5:00 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Le Wang @ 2012-09-05 17:14 UTC (permalink / raw)
  To: 12361


[-- Attachment #1.1: Type: text/plain, Size: 275 bytes --]

hilit changes assumes that if the end has hilit-chg-delete property,
property between END and (+ 1 END) be set.  This isn't true if the buffer
has been narrowed, which yasnippet does regularly.

Attached patch fixes it.  I'm not completely sure if it's the best fix.

-- 
Le

[-- Attachment #1.2: Type: text/html, Size: 350 bytes --]

[-- Attachment #2: hilit-chg.el.patch --]
[-- Type: application/octet-stream, Size: 739 bytes --]

diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 0970ece..20d4437 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -592,8 +592,9 @@ This allows you to manually remove highlighting from uninteresting changes."
             ;; text then remove the deletion marking, but set it to
 	  ;; changed otherwise its highlighting disappears.
 	  (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete)
-	      (progn
-		(put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
+              (save-restriction
+                (widen)
+                (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg)
 		(if highlight-changes-visible-mode
 		    (hilit-chg-fixup beg (+ end 1))))))
           (unless no-property-change

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

* bug#12361: hilit-chg.el bug causes conflict with yasnippet (patch included)
  2012-09-05 17:14 bug#12361: hilit-chg.el bug causes conflict with yasnippet (patch included) Le Wang
@ 2012-12-07  5:00 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-12-07  5:00 UTC (permalink / raw)
  To: Le Wang; +Cc: 12361-done

> Attached patch fixes it.  I'm not completely sure if it's the best fix.

That looks about right, thank you, installed in emacs-24,


        Stefan





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

end of thread, other threads:[~2012-12-07  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 17:14 bug#12361: hilit-chg.el bug causes conflict with yasnippet (patch included) Le Wang
2012-12-07  5:00 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).