From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34898: 24.4; `message-separator' face only works for default value of `mail-header-separator' Date: Tue, 23 Apr 2019 00:43:24 +0100 Message-ID: <871s1t38tf.fsf@tcd.ie> References: <86zhptjnl4.fsf@zoho.eu> <87wokw3n1e.fsf@ericabrahamsen.net> <8336nkw2os.fsf@gnu.org> <875zsg86c5.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20076"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eric Abrahamsen , 34898@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 23 01:59:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIiq5-000563-Rt for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Apr 2019 01:59:10 +0200 Original-Received: from localhost ([127.0.0.1]:45793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIiq4-000844-Uv for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 19:59:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIin6-00058J-3z for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 19:56:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIibS-0003le-N0 for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 19:44:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIibS-0003lK-7a for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 19:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIibS-0003qi-4t for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 19:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2019 23:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34898 X-GNU-PR-Package: emacs Original-Received: via spool by 34898-submit@debbugs.gnu.org id=B34898.155597662514766 (code B ref 34898); Mon, 22 Apr 2019 23:44:02 +0000 Original-Received: (at 34898) by debbugs.gnu.org; 22 Apr 2019 23:43:45 +0000 Original-Received: from localhost ([127.0.0.1]:51911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIibB-0003pz-5J for submit@debbugs.gnu.org; Mon, 22 Apr 2019 19:43:45 -0400 Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:38795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIib9-0003pf-02 for 34898@debbugs.gnu.org; Mon, 22 Apr 2019 19:43:43 -0400 Original-Received: by mail-ed1-f43.google.com with SMTP id c1so4988297edk.5 for <34898@debbugs.gnu.org>; Mon, 22 Apr 2019 16:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZqvLQ2ePIAHX1LBvpbhu5rUPIP/IVaRV1S3/Eg+Vdws=; b=ulBwab/PAulck9VY1tlmFXq31H2cLu9ztDACERO3xoQ0b1r7dNCLixucy1wsyY8KuX 8ywmeBYfVEIiqEhSAls3FSiTOYgooDk3j/wDheE3L342z11Aea2morKYZUhdgyFrocZ6 4+rlVGrGBxsK6sLEGSsQ4VmugsPD4gXKeyYN1xSSiProopxe41P60Ny+Plw/Xp1vJ3Lq qRih9Fxw8VdQeBn2XaMhGw+DS2S9FhUqqWrZmlorqO5imu6WJeS3Ly+bsA2GiBTlLwbq 5a0BU9aYr+Gn+GzXk7h06MUM34Tp1Pd+Hq6wyVmACDoQqM1iF6If1FCoSwfrWRIkHJPa nRBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZqvLQ2ePIAHX1LBvpbhu5rUPIP/IVaRV1S3/Eg+Vdws=; b=IznOO9QGhvVkKB3vijBgSgF1l+w6X4cQRQ32KXUfQIJHZseXfacn7FqqHhuPv69jIj s6NLsMDR2SCXGKfpa5H0wieKvXxv3hM/fITRc1umtY8vLdhLnjBXKph9oCoHCXA1FoQT CBSJlomfsZ3zDAX5tmRNGOkCKOVvirpip1p1a4BXfjbknxuUJmQP/mR6s6CIYzEW+kq4 Ygx0fVmz+au8Om+/dL8vL7Q9oNr3YOJwvq6MBaVjd7//eFqb8koxuyooDui+CYqDpK2w YYkizEb5yIcDaISVnMjNe0Ggcqm6Eq2q4LrzhX6pNJlmzeiPAAjcOU/OWV0izKAMeizb UJ8A== X-Gm-Message-State: APjAAAUPlci1E/WDep0tq0q0vu+PiXBOULDoeIE1eK3l91HbxkfhRDoY ZXrUH5FBmc6ABhHb3d5aKJNQdg== X-Google-Smtp-Source: APXvYqxCJQy6jUiIMozcHz20g5loG8KDU3koJnun11RaCQ0W3lkbVG/J+Cf2RssJFTK1eDvzVEXS5Q== X-Received: by 2002:a50:fe0b:: with SMTP id f11mr14265546edt.16.1555976617038; Mon, 22 Apr 2019 16:43:37 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8f5:8e00:4345:7c72]) by smtp.gmail.com with ESMTPSA id br19sm2516495ejb.48.2019.04.22.16.43.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Apr 2019 16:43:35 -0700 (PDT) In-Reply-To: <875zsg86c5.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 18 Mar 2019 17:01:30 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:158091 Archived-At: --=-=-= Content-Type: text/plain tags 34898 patch severity 34898 wishlist quit --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-mail-header-separator-font-lock-in-message.el.patch >From d7d8b44cc497f2611461693b4c5591b98b8f8c42 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Mon, 18 Mar 2019 18:21:15 +0000 Subject: [PATCH] Fix mail-header-separator font lock in message.el * lisp/gnus/message.el (message-font-lock-keywords): Dynamically font lock mail-header-separator, in case it changes. (bug#34898) --- lisp/gnus/message.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index c8b6f0ee68..461c64b2c3 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1599,19 +1599,21 @@ message-font-lock-keywords (progn (goto-char (match-beginning 0)) (match-end 0)) nil (1 'message-header-name) (2 'message-header-other nil t))) - ,@(if (and mail-header-separator - (not (equal mail-header-separator ""))) - `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$") - 1 'message-separator)) - nil) - ((lambda (limit) - (re-search-forward (concat "^\\(" - message-cite-prefix-regexp - "\\).*") - limit t)) - (0 'message-cited-text)) - ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>" - (0 'message-mml)))) + (,(lambda (limit) + (and mail-header-separator + (not (equal mail-header-separator "")) + (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "$") + limit t))) + 0 'message-separator) + (,(lambda (limit) + (re-search-forward (concat "^\\(?:" + message-cite-prefix-regexp + "\\).*") + limit t)) + 0 'message-cited-text) + ("<#/?\\(?:multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>" + 0 'message-mml))) "Additional expressions to highlight in Message mode.") (defvar message-face-alist -- 2.20.1 --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > Eli Zaretskii writes: > >>> From: Eric Abrahamsen >>> Date: Sun, 17 Mar 2019 19:59:41 -0700 >>> >>> > So it's a bug. >>> >>> The value of `mail-header-separator' gets added to >>> `message-font-lock-keywords', which does the actual fontification. Using >>> setq to change the value of `mail-header-separator' did not change the >>> font lock keyword, despite setting the variable before message.el is >>> loaded (or is it pre-loaded?). Using the customize interface to set >>> `mail-header-separator' *does* work as expected. >> >> Right. So I don't think there's a bug here. > > Actually, I think message-font-lock-keywords can do better: [...] > This is similar to what mail-font-lock-keywords does in > lisp/mail/sendmail.el, namely adapt the font lock keywords to changes in > mail-header-separator. For reasons explained elsewhere in this thread, I think the current behaviour is a shortcoming, even if it's not considered a bug. I would like to push my patch which addresses this, and which I reattach for convenience. WDYT? Thanks, -- Basil --=-=-=--