From unknown Tue Aug 19 10:02:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14179: [PATCH] hi-lock: more appropriate use of font-locking Resent-From: E Sabof Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Apr 2013 04:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 14179@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136565419313836 (code B ref -1); Thu, 11 Apr 2013 04:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2013 04:23:13 +0000 Received: from localhost ([127.0.0.1]:44541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ92W-0003b2-T4 for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:23:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52215) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ92U-0003am-Ez for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ8ym-000863-Ef for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:19:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:45103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8ym-00085z-CX for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:19:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8yj-00041J-3v for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ8yg-00085C-KB for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:17 -0400 Received: from mail-qa0-f54.google.com ([209.85.216.54]:46887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8yg-000852-C0 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:14 -0400 Received: by mail-qa0-f54.google.com with SMTP id o13so78375qaj.6 for ; Wed, 10 Apr 2013 21:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=VIAJ5J3HusvQwR9x2TISb+9QRc6m0QWgpJb1fSdz8QM=; b=yZrtu/Dn0PagKaMvvWQbinuOOB5KRTWxE+b7DOElJ6lo8i8hb7mK2aiv7MPn8jAo3O 7MsrxXuIi6CGp5F9mt7wqh+/2AYNfwEWf/gs/25b9ZCCzCxNpseGYqoBCrCkmy6EJxnR Fd7iGXd4/o/N8jwvM7lbyEoik+tioIjmMQYmqXI0288ArREXRvyD7+iB1O9YhuBmqUYL ZHu/FJTxwaHL20q8nC47d6hFXsESYWkl4dKJSXn6KnGgSXjIUp0ir21QtuMkRhbrAZdg a6vlM+X8EPf7kYbtrpZBb68iNt73NXojYHdXNB2KrenqvYoWrM9KujlGUn+hdApvMISU xMKA== MIME-Version: 1.0 X-Received: by 10.224.60.15 with SMTP id n15mr5542368qah.45.1365653954043; Wed, 10 Apr 2013 21:19:14 -0700 (PDT) Received: by 10.49.2.164 with HTTP; Wed, 10 Apr 2013 21:19:13 -0700 (PDT) Date: Thu, 11 Apr 2013 05:19:13 +0100 Message-ID: From: E Sabof Content-Type: multipart/alternative; boundary=20cf3074d3d2d1246c04da0e16bc 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: -4.2 (----) 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: -6.1 (------) --20cf3074d3d2d1246c04da0e16bc Content-Type: text/plain; charset=ISO-8859-1 Most modes that use custom fontification (ex occur-mode), won't turn the font-lock-mode off. So hi-lock would add a keyword, and remove all existing fontification. The below patch fixes this behaviour. Evgeni Modified lisp/hi-lock.el diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index e2dc4ea..e16ed76 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -689,7 +689,7 @@ Otherwise, read face name from minibuffer with completion and history." ;; Refuse to highlight a text that is already highlighted. (unless (assoc regexp hi-lock-interactive-patterns) (push pattern hi-lock-interactive-patterns) - (if font-lock-mode + (if (and font-lock-mode (font-lock-specified-p major-mode)) (progn (font-lock-add-keywords nil (list pattern) t) (font-lock-fontify-buffer)) --20cf3074d3d2d1246c04da0e16bc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Most= modes that use custom fontification (ex occur-mode), won't turn the fo= nt-lock-mode off. So hi-lock would add a keyword, and remove all existing f= ontification. The below patch fixes this behaviour.

Evgeni
<= span class=3D"" style=3D"white-space:pre">
Modified =A0 lisp/hi-lock.el
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index e2dc4ea= ..e16ed76 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lo= ck.el
@@ -689,7 +689,7 @@ Otherwise, read face name from minibuff= er with completion and history."
=A0 =A0 =A0;; Refuse to highlight a text that is already highlighted.<= /div>
=A0 =A0 =A0(unless (assoc regexp hi-lock-interactive-patterns)
=A0 =A0 =A0 =A0(push pattern hi-lock-interactive-patterns)
- =A0 =A0 =A0(if font-lock-mode
+ =A0 =A0 =A0(if (and font-lock-mode (font-lock-specified-p major-mode= ))
=A0 =A0(pro= gn
=A0 =A0 =A0= (font-lock-add-keywords nil (list pattern) t)
=A0 =A0 =A0(font-lo= ck-fontify-buffer))

--20cf3074d3d2d1246c04da0e16bc-- From unknown Tue Aug 19 10:02:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: E Sabof Subject: bug#14179: closed (Re: bug#14179: [PATCH] hi-lock: more appropriate use of font-locking) Message-ID: References: <87txe3wbi3.fsf@mail.jurta.org> X-Gnu-PR-Message: they-closed 14179 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 14179@debbugs.gnu.org Date: Fri, 20 Dec 2013 19:48:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1387568882-18332-1" This is a multi-part message in MIME format... ------------=_1387568882-18332-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #14179: [PATCH] hi-lock: more appropriate use of font-locking 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 14179@debbugs.gnu.org. --=20 14179: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D14179 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1387568882-18332-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 14179-done) by debbugs.gnu.org; 20 Dec 2013 19:47:57 +0000 Received: from localhost ([127.0.0.1]:60464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vu63A-0004lQ-NV for submit@debbugs.gnu.org; Fri, 20 Dec 2013 14:47:56 -0500 Received: from [69.163.184.122] (port=58625 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vu637-0004lC-UF for 14179-done@debbugs.gnu.org; Fri, 20 Dec 2013 14:47:54 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D669334A2F6A9C; Fri, 20 Dec 2013 11:47:51 -0800 (PST) From: Juri Linkov To: E Sabof Subject: Re: bug#14179: [PATCH] hi-lock: more appropriate use of font-locking Organization: JURTA References: Date: Fri, 20 Dec 2013 21:47:16 +0200 In-Reply-To: (E. Sabof's message of "Thu, 11 Apr 2013 05:19:13 +0100") Message-ID: <87txe3wbi3.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Most modes that use custom fontification (ex occur-mode), won't turn the > font-lock-mode off. So hi-lock would add a keyword, and remove all existing > fontification. The below patch fixes this behaviour. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 14179-done Cc: 14179-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Most modes that use custom fontification (ex occur-mode), won't turn the > font-lock-mode off. So hi-lock would add a keyword, and remove all existing > fontification. The below patch fixes this behaviour. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS > Most modes that use custom fontification (ex occur-mode), won't turn the > font-lock-mode off. So hi-lock would add a keyword, and remove all existing > fontification. The below patch fixes this behaviour. Thanks, fixed. ------------=_1387568882-18332-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Apr 2013 04:23:13 +0000 Received: from localhost ([127.0.0.1]:44541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ92W-0003b2-T4 for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:23:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52215) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQ92U-0003am-Ez for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ8ym-000863-Ef for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:19:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:45103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8ym-00085z-CX for submit@debbugs.gnu.org; Thu, 11 Apr 2013 00:19:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8yj-00041J-3v for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ8yg-00085C-KB for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:17 -0400 Received: from mail-qa0-f54.google.com ([209.85.216.54]:46887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ8yg-000852-C0 for bug-gnu-emacs@gnu.org; Thu, 11 Apr 2013 00:19:14 -0400 Received: by mail-qa0-f54.google.com with SMTP id o13so78375qaj.6 for ; Wed, 10 Apr 2013 21:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=VIAJ5J3HusvQwR9x2TISb+9QRc6m0QWgpJb1fSdz8QM=; b=yZrtu/Dn0PagKaMvvWQbinuOOB5KRTWxE+b7DOElJ6lo8i8hb7mK2aiv7MPn8jAo3O 7MsrxXuIi6CGp5F9mt7wqh+/2AYNfwEWf/gs/25b9ZCCzCxNpseGYqoBCrCkmy6EJxnR Fd7iGXd4/o/N8jwvM7lbyEoik+tioIjmMQYmqXI0288ArREXRvyD7+iB1O9YhuBmqUYL ZHu/FJTxwaHL20q8nC47d6hFXsESYWkl4dKJSXn6KnGgSXjIUp0ir21QtuMkRhbrAZdg a6vlM+X8EPf7kYbtrpZBb68iNt73NXojYHdXNB2KrenqvYoWrM9KujlGUn+hdApvMISU xMKA== MIME-Version: 1.0 X-Received: by 10.224.60.15 with SMTP id n15mr5542368qah.45.1365653954043; Wed, 10 Apr 2013 21:19:14 -0700 (PDT) Received: by 10.49.2.164 with HTTP; Wed, 10 Apr 2013 21:19:13 -0700 (PDT) Date: Thu, 11 Apr 2013 05:19:13 +0100 Message-ID: Subject: [PATCH] hi-lock: more appropriate use of font-locking From: E Sabof To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=20cf3074d3d2d1246c04da0e16bc 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: -4.2 (----) 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: -6.1 (------) --20cf3074d3d2d1246c04da0e16bc Content-Type: text/plain; charset=ISO-8859-1 Most modes that use custom fontification (ex occur-mode), won't turn the font-lock-mode off. So hi-lock would add a keyword, and remove all existing fontification. The below patch fixes this behaviour. Evgeni Modified lisp/hi-lock.el diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index e2dc4ea..e16ed76 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -689,7 +689,7 @@ Otherwise, read face name from minibuffer with completion and history." ;; Refuse to highlight a text that is already highlighted. (unless (assoc regexp hi-lock-interactive-patterns) (push pattern hi-lock-interactive-patterns) - (if font-lock-mode + (if (and font-lock-mode (font-lock-specified-p major-mode)) (progn (font-lock-add-keywords nil (list pattern) t) (font-lock-fontify-buffer)) --20cf3074d3d2d1246c04da0e16bc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Most= modes that use custom fontification (ex occur-mode), won't turn the fo= nt-lock-mode off. So hi-lock would add a keyword, and remove all existing f= ontification. The below patch fixes this behaviour.

Evgeni
<= span class=3D"" style=3D"white-space:pre">
Modified =A0 lisp/hi-lock.el
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index e2dc4ea= ..e16ed76 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lo= ck.el
@@ -689,7 +689,7 @@ Otherwise, read face name from minibuff= er with completion and history."
=A0 =A0 =A0;; Refuse to highlight a text that is already highlighted.<= /div>
=A0 =A0 =A0(unless (assoc regexp hi-lock-interactive-patterns)
=A0 =A0 =A0 =A0(push pattern hi-lock-interactive-patterns)
- =A0 =A0 =A0(if font-lock-mode
+ =A0 =A0 =A0(if (and font-lock-mode (font-lock-specified-p major-mode= ))
=A0 =A0(pro= gn
=A0 =A0 =A0= (font-lock-add-keywords nil (list pattern) t)
=A0 =A0 =A0(font-lo= ck-fontify-buffer))

--20cf3074d3d2d1246c04da0e16bc-- ------------=_1387568882-18332-1--