From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#13891: 24.3.50; highlight-regexp incorrectly retains partial state after buffer reversion Date: Thu, 04 Apr 2013 21:16:32 +0530 Message-ID: <87ppya5mef.fsf@gmail.com> References: <87k3ono8gv.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1365090487 32648 80.91.229.3 (4 Apr 2013 15:48:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Apr 2013 15:48:07 +0000 (UTC) Cc: josh@foxtail.org, 13891@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 04 17:48:32 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UNmOt-00018P-IE for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Apr 2013 17:48:31 +0200 Original-Received: from localhost ([::1]:56640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNmOU-000852-NB for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Apr 2013 11:48:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNmOL-00083o-WD for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2013 11:48:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNmOH-0007jP-7f for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2013 11:47:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNmOH-0007jG-3V for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2013 11:47:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UNmRJ-0003d4-Tk for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2013 11:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Apr 2013 15:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13891-submit@debbugs.gnu.org id=B13891.136509060313878 (code B ref 13891); Thu, 04 Apr 2013 15:51:01 +0000 Original-Received: (at 13891) by debbugs.gnu.org; 4 Apr 2013 15:50:03 +0000 Original-Received: from localhost ([127.0.0.1]:33752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNmQL-0003bY-TD for submit@debbugs.gnu.org; Thu, 04 Apr 2013 11:50:03 -0400 Original-Received: from mail-pb0-f52.google.com ([209.85.160.52]:61296) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNmQH-0003bE-Qk for 13891@debbugs.gnu.org; Thu, 04 Apr 2013 11:49:59 -0400 Original-Received: by mail-pb0-f52.google.com with SMTP id mc8so1494309pbc.25 for <13891@debbugs.gnu.org>; Thu, 04 Apr 2013 08:46:46 -0700 (PDT) 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=rofW7VyVasA1/7UQSkJeaQTgVGV7x1ctuGCHiucIQbA=; b=EH8a0aw7S3+TJTIQR+X0w2LsJpF5a2Dh45/ySa3kVGJdGaBTjaFDDoNiMq1KuO0SH7 yKXy9vqRaA0N1+8x8HLbvF+tsqoepqy0LYPpX97Wmta2rPQDOEluMBf01TS2/uzmCCWv PaAuRcFbKb2BqCgkEkVG38qUh2lRVZluCy67oid/Q7Kt103JvPyKdt0xJPviIEon2d/z brcPuvLoPOyBdtk9WagWmGmr5Mh2XbwxkSrswOrvcseG/WHgOpz2XmeSwXPVjucApW+J JQuUhqkoRkzaPO3LTnYzkrz9EFU0XSlo4UvPBi6YMEZhdTnJAcCG8OYZP9A0kTfCbCKJ A4iQ== X-Received: by 10.66.139.133 with SMTP id qy5mr10180718pab.152.1365090406427; Thu, 04 Apr 2013 08:46:46 -0700 (PDT) Original-Received: from debian-6.05 ([115.241.32.149]) by mx.google.com with ESMTPS id qb10sm10606370pbb.43.2013.04.04.08.46.42 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 08:46:45 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 03 Apr 2013 18:55:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73154 Archived-At: --=-=-= Content-Type: text/plain >> `hi-lock-interactive-patterns' as `permanent-local'. > > Agreed. Even more so for hi-lock-file-patterns. >> With `global-hi-lock-mode' ON, you will notice that highlighting will >> be retained across reverts. > > Not any more after my patch. Whether this change in behaviour counts as a regression, I am not sure. >> 2. I think `font-lock-fontify-buffer' should be added to >> `hi-lock-font-lock-hook'. > > Why? `hi-lock-font-lock-hook' adds the font lock keywords. `font-lock-fontify-buffer' activates the keywords. >> For some reason, `hi-lock-font-lock-hook' doesn't get called at all >> (even though it is added to the `font-lock-mode-hook'.) > > What was your test case? For the sake of discussion, I undid your patch. Apply this patch and re-load hi-lock.el. --=-=-= Content-Type: text/x-diff Content-Disposition: inline Content-Description: hi-lock.el.diff === modified file 'lisp/hi-lock.el' --- lisp/hi-lock.el 2013-03-31 13:34:35 +0000 +++ lisp/hi-lock.el 2013-04-04 14:54:39 +0000 @@ -390,8 +390,8 @@ versions before 22 use the following in (cons "Regexp Highlighting" hi-lock-menu)) (hi-lock-find-patterns) (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook nil t) - ;; Remove regexps from font-lock-keywords (bug#13891). - (add-hook 'change-major-mode-hook (lambda () (hi-lock-mode -1)) nil t)) + (hi-lock-font-lock-hook) + (font-lock-fontify-buffer)) ;; Turned off. (when (or hi-lock-interactive-patterns hi-lock-file-patterns) --=-=-= Content-Type: text/plain 1. M-s h r something 2. Modify buffer. 3. Revert buffer. 4. M-: hi-lock-interactive-patterns Verify that variable is non-nil. 5. M-x hi-lock-mode. (For now do it by hand.) 6. See that highlighting kicks in. My expectation was that once `hi-lock-mode' is turned on `font-lock-mode-hook' will be *automatically* called. Is it the minor mode's responsibility to explicitly call it's fontification handler? > >> Problem area: `font-lock-mode-hook' is not documented and I really >> don't when it is getting called. > > font-lock-mode is a normal minor-mode, so font-lock-mode-hook is called > at the end of running font-lock-mode (both to enable and to disable it). > > > Stefan --=-=-=--