GNU bug report logs - #13297
hi-lock-unface-buffer fails on face lists

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Fri, 28 Dec 2012 20:23:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#13297: closed (hi-lock-unface-buffer fails on face lists)
Date: Mon, 28 Jan 2013 20:04:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 28 Jan 2013 15:03:13 -0500
with message-id <jwvmwvtkrgr.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#13297: hi-lock-unface-buffer fails on face lists
has caused the debbugs.gnu.org bug report #13297,
regarding hi-lock-unface-buffer fails on face lists
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
13297: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13297
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jonas Bernoulli <jonas <at> bernoul.li>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: hi-lock-unface-buffer fails on face lists
Date: Fri, 28 Dec 2012 21:21:20 +0100
Before commit 111129 hi-lock-unface-buffer could handle face symbols as
well as face lists.  After this commit it fails on lists.

Third-party library highlight-symbol uses hi-lock-set-pattern passing it
a face list.  The above change breaks this usage which isn't disallowed
in hi-lock-set-pattern's doc-string.  As a result this library cannot
remove the highlights it added with the help of hi-lock.

  Jonas


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: Jonas Bernoulli <jonas <at> bernoul.li>, 13297-done <at> debbugs.gnu.org
Subject: Re: bug#13297: hi-lock-unface-buffer fails on face lists
Date: Mon, 28 Jan 2013 15:03:13 -0500
> The problem is due to the mistaken assumption about the nature of face,
> as captured by the comment line below.

Oh, indeed, thank you.  I installed the patch below which should fix it,


        Stefan


=== modified file 'lisp/hi-lock.el'
--- lisp/hi-lock.el	2013-01-02 16:13:04 +0000
+++ lisp/hi-lock.el	2013-01-28 19:59:39 +0000
@@ -562,7 +562,8 @@
     (when keyword
       (let ((face (hi-lock-keyword->face keyword)))
         ;; Make `face' the next one to use by default.
-	(add-to-list 'hi-lock--unused-faces (face-name face)))
+        (when (symbolp face)          ;Don't add it if it's a list (bug#13297).
+          (add-to-list 'hi-lock--unused-faces (face-name face))))
       (font-lock-remove-keywords nil (list keyword))
       (setq hi-lock-interactive-patterns
             (delq keyword hi-lock-interactive-patterns))



This bug report was last modified 12 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.