From unknown Mon Jun 23 23:53:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13297: hi-lock-unface-buffer fails on face lists Resent-From: Jonas Bernoulli Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Dec 2012 20:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13297@debbugs.gnu.org X-Debbugs-Original-To: Emacs Bugs Received: via spool by submit@debbugs.gnu.org id=B.135672615612615 (code B ref -1); Fri, 28 Dec 2012 20:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Dec 2012 20:22:36 +0000 Received: from localhost ([127.0.0.1]:35172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TogRw-0003HQ-Fg for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:22:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60702) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TogRt-0003HJ-LC for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:22:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TogQy-0000ur-Fy for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:21:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:38996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQy-0000uk-4i for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:21:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQt-0006Hq-Nh for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TogQp-0000st-Bj for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:31 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:36967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQp-0000sf-5I for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:27 -0500 Received: by mail-ea0-f182.google.com with SMTP id a14so4546994eaa.13 for ; Fri, 28 Dec 2012 12:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:user-agent:date:message-id :mime-version:content-type; bh=xHg6aW43faT6UwaDe8IslMFtZ1V1kD8zgNm9n5pTME0=; b=iOUK+TEHj6STcoEZ14oGHuLg3iGtdnmIY7AgKsmgf1E37r3g4T6bj7QJ7/iZmkDqJO O6yupnVkReecbZHSR2avvRIdRsANtUqGkmZ7YjaITfOZ/UhV+QNXb/j8HZqfHjJgTxDo /ZoSr8OWlP8vF3zsQCXz/8LNZOgYIRjUzRDWiBXDCealcuRvfHZRnhDoOjNcb7qT9g3V 5bm8dVE6ot8ENG1TEJuOG0A7ziD52Rnj5RBvgEbI4JUEnwxfbOQdVayvjhIXbk6CKXk9 WMCBRNIk5sw2vKHVS6/FeAbgmFfKfYV6D9S7Oq82xz2l1U47bKbmkaGbvnon7x1tEXBV a02A== X-Received: by 10.14.184.134 with SMTP id s6mr88154462eem.43.1356726083381; Fri, 28 Dec 2012 12:21:23 -0800 (PST) Received: from lem (178-83-148-79.dynamic.hispeed.ch. [178.83.148.79]) by mx.google.com with ESMTPS id 46sm67833366eeg.4.2012.12.28.12.21.21 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Dec 2012 12:21:21 -0800 (PST) From: Jonas Bernoulli User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.50.1 Date: Fri, 28 Dec 2012 21:21:20 +0100 Message-ID: <87d2xudj27.fsf@bernoul.li> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) 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 From unknown Mon Jun 23 23:53:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13297: hi-lock-unface-buffer fails on face lists Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Jan 2013 03:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jonas Bernoulli Cc: 13297@debbugs.gnu.org Received: via spool by 13297-submit@debbugs.gnu.org id=B13297.135796109026558 (code B ref 13297); Sat, 12 Jan 2013 03:25:02 +0000 Received: (at 13297) by debbugs.gnu.org; 12 Jan 2013 03:24:50 +0000 Received: from localhost ([127.0.0.1]:56001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TtriD-0006uJ-Nw for submit@debbugs.gnu.org; Fri, 11 Jan 2013 22:24:49 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:4399) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TtriD-0006u8-41 for 13297@debbugs.gnu.org; Fri, 11 Jan 2013 22:24:49 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkGAG6Zu09FpZpV/2dsb2JhbABEgXuyFoEIghUBAQQBViMFCws0EhQYDSSIHAW6CYVlil8DiEKacYFYgwc X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="212347348" Received: from 69-165-154-85.dsl.teksavvy.com (HELO pastel.home) ([69.165.154.85]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Jan 2013 22:24:33 -0500 Received: by pastel.home (Postfix, from userid 20848) id B1B975943D; Fri, 11 Jan 2013 22:24:31 -0500 (EST) From: Stefan Monnier Message-ID: References: <87d2xudj27.fsf@bernoul.li> Date: Fri, 11 Jan 2013 22:24:31 -0500 In-Reply-To: <87d2xudj27.fsf@bernoul.li> (Jonas Bernoulli's message of "Fri, 28 Dec 2012 21:21:20 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > 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. I don't understand exactly what you're referring to. In which way does it break it? Do you get an error? Or is the regexp's highlight just sticks around without signaling any error? Can you show some specific recipe to reproduce the problem? Stefan From unknown Mon Jun 23 23:53:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13297: hi-lock-unface-buffer fails on face lists Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jan 2013 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Jonas Bernoulli , 13297@debbugs.gnu.org Received: via spool by 13297-submit@debbugs.gnu.org id=B13297.13584090631617 (code B ref 13297); Thu, 17 Jan 2013 07:52:02 +0000 Received: (at 13297) by debbugs.gnu.org; 17 Jan 2013 07:51:03 +0000 Received: from localhost ([127.0.0.1]:36044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvkFa-0000Q1-GS for submit@debbugs.gnu.org; Thu, 17 Jan 2013 02:51:03 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:41019) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvkFY-0000Pd-6S for 13297@debbugs.gnu.org; Thu, 17 Jan 2013 02:51:01 -0500 Received: by mail-pb0-f50.google.com with SMTP id wz7so1252921pbc.23 for <13297@debbugs.gnu.org>; Wed, 16 Jan 2013 23:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=2nq/1foA1teIO79d/+kkcIfSX2C2ofE/fxJ9yGyKB7k=; b=gLsnVagR6rV5PHvA7uStthWPO1d7XeAxHAMIQF5/rALHUjuCoWb1DARz2aTvcgqvmT NIVs5OmTdXfQNtT8qg8AbjqfjZB/zGTGeQT5mOMPaF3bNEZP0b/jah0yJhCWQr1MY/Af Ny6Z1iCxieEqbJs04okZrSf3FqpWq+ToRwY6ZWYkRxsOS2lq1NkMtad3ZDTS9v4oimIl j5tqdCEg4q2DmFgkgn8Y106iLzgPmupy7zwvpx5V9OfrhvvVhriPoLrb0Gt7mP9kLCcu t5gmypHEzALgS/q4WsTabXULxMXazPhHdamODAd7K7k/gl5g27WdXcDbF2gbq1oXV8ug FrOQ== X-Received: by 10.68.232.169 with SMTP id tp9mr11069294pbc.1.1358409019656; Wed, 16 Jan 2013 23:50:19 -0800 (PST) Received: from debian-6.05 ([101.63.153.205]) by mx.google.com with ESMTPS id sg7sm616985pbb.3.2013.01.16.23.50.15 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 16 Jan 2013 23:50:18 -0800 (PST) From: Jambunathan K References: <87d2xudj27.fsf@bernoul.li> Date: Thu, 17 Jan 2013 13:20:09 +0530 In-Reply-To: (Stefan Monnier's message of "Fri, 11 Jan 2013 22:24:31 -0500") Message-ID: <871udk2qq6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: >> 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. > > I don't understand exactly what you're referring to. In which way does > it break it? Do you get an error? Or is the regexp's highlight just > sticks around without signaling any error? > Can you show some specific recipe to reproduce the problem? highlight-symbol is at http://nschum.de/src/emacs/highlight-symbol/highlight-symbol.el To higlight use M-x highlight-symbol-at-point RET To un-highlight use M-x highlight-symbol-at-point RET That library uses anonymous faces (as opposed to a pre-defined face) for highlighting. ,---- hi-lock-interactive-patterns | | (("\\_" | (0 | '((background-color . "cyan") <====== anonymous face | . #1=((foreground-color . "black"))) | t)) | ("\\_" | (0 | '((background-color . "DeepPink") | . #1#) | t))) | `---- The problem is due to the mistaken assumption about the nature of face, as captured by the comment line below. ,---- | (defun hi-lock-keyword->face (keyword) | (cadr (cadr (cadr keyword)))) ; Keyword looks like (REGEXP (0 'FACE) ...). `---- A simple check in `hi-lock-unface-buffer' will make the problem disappear. However, I have a gut feeling that management of `hi-lock--unused-faces' could be improved. ,---- | (when keyword | (let ((face (hi-lock-keyword->face keyword))) | (when (member face hi-lock-face-defaults) <== Use facep instead | ;; Make `face' the next one to use by default. | (add-to-list 'hi-lock--unused-faces (face-name face)))) `---- --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Not a face: ((background-color . DeepPink) (foreground-color . black))") signal(error ("Not a face: ((background-color . DeepPink) (foreground-color . black))")) error("Not a face: %s" ((background-color . "DeepPink") (foreground-color . "black"))) check-face(((background-color . "DeepPink") (foreground-color . "black"))) face-name(((background-color . "DeepPink") (foreground-color . "black"))) (add-to-list (quote hi-lock--unused-faces) (face-name face)) (let ((face (hi-lock-keyword->face keyword))) (add-to-list (quote hi-lock--unused-faces) (face-name face))) (progn (let ((face (hi-lock-keyword->face keyword))) (add-to-list (quote 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)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons (car keyword))) (if font-lock-fontified (progn (font-lock-fontify-buffer)))) (if keyword (progn (let ((face (hi-lock-keyword->face keyword))) (add-to-list (quote 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)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons (car keyword))) (if font-lock-fontified (progn (font-lock-fontify-buffer))))) (let ((keyword (car --dolist-tail--))) (if keyword (progn (let ((face (hi-lock-keyword->face keyword))) (add-to-list (quote 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)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons (car keyword))) (if font-lock-fontified (progn (font-lock-fontify-buffer))))) (setq --dolist-tail-- (cdr --dolist-tail--))) (while --dolist-tail-- (let ((keyword (car --dolist-tail--))) (if keyword (progn (let ((face (hi-lock-keyword->face keyword))) (add-to-list (quote 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)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons (car keyword))) (if font-lock-fontified (progn (font-lock-fontify-buffer))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (let ((--dolist-tail-- (if (eq regexp t) hi-lock-interactive-patterns (list (assoc regexp hi-lock-interactive-patterns))))) (while --dolist-tail-- (let ((keyword (car --dolist-tail--))) (if keyword (progn (let ((face ...)) (add-to-list (quote 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)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons (car keyword))) (if font-lock-fontified (progn (font-lock-fontify-buffer))))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (progn (let ((--dolist-tail-- (if (eq regexp t) hi-lock-interactive-patterns (list (assoc regexp hi-lock-interactive-patterns))))) (while --dolist-tail-- (let ((keyword (car --dolist-tail--))) (if keyword (progn (let (...) (add-to-list ... ...)) (font-lock-remove-keywords nil (list keyword)) (setq hi-lock-interactive-patterns (delq keyword hi-lock-interactive-patterns)) (remove-overlays nil nil (quote hi-lock-overlay-regexp) (hi-lock--hashcons ...)) (if font-lock-fontified (progn ...)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) hi-lock-unface-buffer("\\_") (progn (setq highlight-symbol-list (delete symbol highlight-symbol-list)) (hi-lock-unface-buffer symbol)) (if (member symbol highlight-symbol-list) (progn (setq highlight-symbol-list (delete symbol highlight-symbol-list)) (hi-lock-unface-buffer symbol)) (if (equal symbol highlight-symbol) (progn (highlight-symbol-mode-remove-temp))) (let ((color (nth highlight-symbol-color-index highlight-symbol-colors))) (if color (setq highlight-symbol-color-index (1+ highlight-symbol-color-index)) (setq highlight-symbol-color-index 1 color (car highlight-symbol-colors))) (setq color (cons (cons (quote background-color) color) (quote ((foreground-color . "black"))))) (with-no-warnings (if (< emacs-major-version 22) (hi-lock-set-pattern (list symbol (cons 0 (cons ... ...)))) (hi-lock-set-pattern symbol color))) (setq highlight-symbol-list (cons symbol highlight-symbol-list)))) (let ((symbol (highlight-symbol-get-symbol))) (if symbol nil (error "No symbol at point")) (if hi-lock-mode nil (hi-lock-mode 1)) (if (member symbol highlight-symbol-list) (progn (setq highlight-symbol-list (delete symbol highlight-symbol-list)) (hi-lock-unface-buffer symbol)) (if (equal symbol highlight-symbol) (progn (highlight-symbol-mode-remove-temp))) (let ((color (nth highlight-symbol-color-index highlight-symbol-colors))) (if color (setq highlight-symbol-color-index (1+ highlight-symbol-color-index)) (setq highlight-symbol-color-index 1 color (car highlight-symbol-colors))) (setq color (cons (cons (quote background-color) color) (quote ((foreground-color . "black"))))) (with-no-warnings (if (< emacs-major-version 22) (hi-lock-set-pattern (list symbol (cons 0 ...))) (hi-lock-set-pattern symbol color))) (setq highlight-symbol-list (cons symbol highlight-symbol-list))))) highlight-symbol-at-point() call-interactively(highlight-symbol-at-point record nil) command-execute(highlight-symbol-at-point record) execute-extended-command(nil "highlight-symbol-at-point") call-interactively(execute-extended-command nil nil) --8<---------------cut here---------------end--------------->8--- -- From unknown Mon Jun 23 23:53:16 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jonas Bernoulli Subject: bug#13297: closed (Re: bug#13297: hi-lock-unface-buffer fails on face lists) Message-ID: References: <87d2xudj27.fsf@bernoul.li> X-Gnu-PR-Message: they-closed 13297 X-Gnu-PR-Package: emacs Reply-To: 13297@debbugs.gnu.org Date: Mon, 28 Jan 2013 20:04:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1359403442-8346-1" This is a multi-part message in MIME format... ------------=_1359403442-8346-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13297: hi-lock-unface-buffer fails on face lists which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13297@debbugs.gnu.org. --=20 13297: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13297 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1359403442-8346-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13297-done) by debbugs.gnu.org; 28 Jan 2013 20:03:49 +0000 Received: from localhost ([127.0.0.1]:52911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzuvl-0002AC-E1 for submit@debbugs.gnu.org; Mon, 28 Jan 2013 15:03:49 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:58902) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzuvi-0002A4-Tk for 13297-done@debbugs.gnu.org; Mon, 28 Jan 2013 15:03:48 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r0SK3DVW010265; Mon, 28 Jan 2013 15:03:14 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A2DD3B4182; Mon, 28 Jan 2013 15:03:13 -0500 (EST) From: Stefan Monnier To: Jambunathan K Subject: Re: bug#13297: hi-lock-unface-buffer fails on face lists Message-ID: References: <87d2xudj27.fsf@bernoul.li> <871udk2qq6.fsf@gmail.com> Date: Mon, 28 Jan 2013 15:03:13 -0500 In-Reply-To: <871udk2qq6.fsf@gmail.com> (Jambunathan K.'s message of "Thu, 17 Jan 2013 13:20:09 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4475=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4475> : streams <896482> : uri <1330393> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 13297-done Cc: Jonas Bernoulli , 13297-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.0 (----) > 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)) ------------=_1359403442-8346-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Dec 2012 20:22:36 +0000 Received: from localhost ([127.0.0.1]:35172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TogRw-0003HQ-Fg for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:22:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60702) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TogRt-0003HJ-LC for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:22:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TogQy-0000ur-Fy for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:21:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:38996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQy-0000uk-4i for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:21:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQt-0006Hq-Nh for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TogQp-0000st-Bj for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:31 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:36967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogQp-0000sf-5I for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:21:27 -0500 Received: by mail-ea0-f182.google.com with SMTP id a14so4546994eaa.13 for ; Fri, 28 Dec 2012 12:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:user-agent:date:message-id :mime-version:content-type; bh=xHg6aW43faT6UwaDe8IslMFtZ1V1kD8zgNm9n5pTME0=; b=iOUK+TEHj6STcoEZ14oGHuLg3iGtdnmIY7AgKsmgf1E37r3g4T6bj7QJ7/iZmkDqJO O6yupnVkReecbZHSR2avvRIdRsANtUqGkmZ7YjaITfOZ/UhV+QNXb/j8HZqfHjJgTxDo /ZoSr8OWlP8vF3zsQCXz/8LNZOgYIRjUzRDWiBXDCealcuRvfHZRnhDoOjNcb7qT9g3V 5bm8dVE6ot8ENG1TEJuOG0A7ziD52Rnj5RBvgEbI4JUEnwxfbOQdVayvjhIXbk6CKXk9 WMCBRNIk5sw2vKHVS6/FeAbgmFfKfYV6D9S7Oq82xz2l1U47bKbmkaGbvnon7x1tEXBV a02A== X-Received: by 10.14.184.134 with SMTP id s6mr88154462eem.43.1356726083381; Fri, 28 Dec 2012 12:21:23 -0800 (PST) Received: from lem (178-83-148-79.dynamic.hispeed.ch. [178.83.148.79]) by mx.google.com with ESMTPS id 46sm67833366eeg.4.2012.12.28.12.21.21 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Dec 2012 12:21:21 -0800 (PST) From: Jonas Bernoulli To: Emacs Bugs Subject: hi-lock-unface-buffer fails on face lists User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.50.1 Date: Fri, 28 Dec 2012 21:21:20 +0100 Message-ID: <87d2xudj27.fsf@bernoul.li> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) 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 ------------=_1359403442-8346-1--