From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>, 34898@debbugs.gnu.org
Subject: bug#34898: 24.4; `message-separator' face only works for default value of `mail-header-separator'
Date: Mon, 18 Mar 2019 18:23:17 +0000 [thread overview]
Message-ID: <878sxc6nze.fsf@tcd.ie> (raw)
In-Reply-To: <875zsg86c5.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 18 Mar 2019 17:01:30 +0000")
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
> Actually, I think message-font-lock-keywords can do better:
>
> From 0aa67e4ac6cd2ac93c05c7b7bec486c5fefd12dd Mon Sep 17 00:00:00 2001
> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Date: Mon, 18 Mar 2019 15:09:45 +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 c491f16dd8..079a13c706 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)))
> + 1 'message-separator)
^^^
Sorry, that should be 0.
> + (,(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
>
>
> 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.
>
> WDYT?
--
Basil
next prev parent reply other threads:[~2019-03-18 18:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 19:41 bug#34898: 24.4; `message-separator' face only works for default value of `mail-header-separator' Emanuel Berg
2019-03-18 2:59 ` Eric Abrahamsen
2019-03-18 3:14 ` Emanuel Berg
2019-03-18 17:21 ` Basil L. Contovounesios
2019-03-18 22:55 ` Emanuel Berg
2019-03-18 16:46 ` Eli Zaretskii
2019-03-18 16:55 ` Emanuel Berg
2019-03-18 17:01 ` Basil L. Contovounesios
2019-03-18 18:23 ` Basil L. Contovounesios [this message]
2019-04-22 23:43 ` Basil L. Contovounesios
2019-05-13 20:00 ` Lars Ingebrigtsen
2019-05-14 1:18 ` Basil L. Contovounesios
2019-03-18 17:14 ` Basil L. Contovounesios
2019-03-18 18:46 ` Eric Abrahamsen
[not found] ` <handler.34898.C.155779671310380.notifdonectrl.0@debbugs.gnu.org>
2019-05-14 11:15 ` bug#34898: acknowledged by developer (Re: bug#34898: 24.4; `message-separator' face only works for default value of `mail-header-separator') Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878sxc6nze.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=34898@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=eric@ericabrahamsen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).