From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: emacs-30 6d94090cadc: * lisp/hi-lock.el: More fixes for revert-buffer (bug#57534) Date: Thu, 27 Jun 2024 15:03:32 -0400 Message-ID: References: <171951175019.5752.4559993590758222831@vcs2.savannah.gnu.org> <20240627180913.2E298C1FB74@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4050"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 27 21:04:12 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sMuPj-0000ot-Vo for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Jun 2024 21:04:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMuPC-0007DA-5q; Thu, 27 Jun 2024 15:03:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMuP7-0007Ck-Dk for emacs-devel@gnu.org; Thu, 27 Jun 2024 15:03:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMuP6-0007zF-G3; Thu, 27 Jun 2024 15:03:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=sd/9NI6REvUBZhXbAcZcnjIfkOggYe4A1bpWYZmQyzo=; b=jRBe/qXYT0CyvYoNj0Zo yvmx211Y3vUU/RN4uUWFhfazNo/X0529DPqnPvcxVEip6ak00wW+onyiaIHxNhHO4Qk6nuFh40377 Z6qWCmYdnO4BqTSvtnQg8S84ytOFvPUL++msOIaPBRHh4ZWLakB60cUmKyEXLrjHQQ/8A7IuL6rbT B1hr9R6IwAAEfRU7jH3a7Y/WruddsTVAIsG/5B9w8mIJcPrXoNczsmJXpTMsFI9S3vf1/Ftw6wTMJ jlLysHZIWvO1R/zSmPWQnsrnRgw0bDCYEN+cNenMemOTEAny9RkSAK5zuzGBWjpccPxIiMgqNYTbp x71K6hd5G32EVg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sMuP6-0001YC-3i; Thu, 27 Jun 2024 15:03:32 -0400 In-Reply-To: <20240627180913.2E298C1FB74@vcs2.savannah.gnu.org> (Juri Linkov's message of "Thu, 27 Jun 2024 14:09:12 -0400 (EDT)") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320779 Archived-At: Juri Linkov writes: > branch: emacs-30 > commit 6d94090cadcff1b251457c2d82b287f4beb5a93d > Author: Juri Linkov > Commit: Juri Linkov > > * lisp/hi-lock.el: More fixes for revert-buffer (bug#57534) > > (hi-lock-set-pattern): Put the text property 'regexp' on the lighter string. > (hi-lock-revert-buffer-rehighlight): Get the real regexp from the > text property 'regexp'. This fixes the case when the original > regexp gets lost after e.g. 'M-s . M-s h r'. > --- > lisp/hi-lock.el | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el > index e1fa992cb12..c1b96431c16 100644 > --- a/lisp/hi-lock.el > +++ b/lisp/hi-lock.el > @@ -780,7 +780,10 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search." > (assoc (or lighter regexp) hi-lock-interactive-lighters)) > (add-to-list 'hi-lock--unused-faces (face-name face)) > (push pattern hi-lock-interactive-patterns) > - (push (cons (or lighter regexp) pattern) hi-lock-interactive-lighters) > + (push (cons (or (and lighter (propertize lighter 'regexp regexp)) > + regexp) > + pattern) > + hi-lock-interactive-lighters) > (if (and font-lock-mode (font-lock-specified-p major-mode) > (not hi-lock-use-overlays)) > (progn > @@ -888,7 +891,9 @@ Apply the previous patterns after reverting the buffer." > (setq hi-lock--unused-faces hi-lock-face-defaults) > (dolist (pattern (reverse patterns)) > (let ((face (hi-lock-keyword->face (cdr pattern)))) > - (highlight-regexp (car pattern) face) > + (highlight-regexp (or (get-text-property 0 'regexp (car pattern)) > + (car pattern)) > + face) > (setq hi-lock--unused-faces > (remove (face-name face) hi-lock--unused-faces))))))))) > Hi Juri, just to mention this is causing a regression on my testbench: FAILED 2/4 hi-lock-case-fold (0.000199 sec) at lisp/hi-lock-tests.el:53 Regards Andrea