From 23434bc2ceb1aa2371a68b4eca61012b6f6aba49 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 8 May 2024 15:26:29 -0700 Subject: [PATCH] Avoid shared-ref read syntax in ERC message catalogs * lisp/erc/erc.el (erc--message-speaker-ctcp-action-input) (erc--message-speaker-ctcp-action-statusmsg-input): Don't use shared/circular references, like #1=foo ... #1#, in literal strings because it triggers CI validation failures. These message-format definitions were originally introduced as part of bug#67677. (cherry picked from commit d647a5238705bbb4a9277d71bb8069fba2cac7f3) --- lisp/erc/erc.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index ce805fdab13..c92fd42322a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -6135,7 +6135,8 @@ NUH, and the current `erc-response' object.") ;; The format strings in the following `-speaker' catalog shouldn't ;; contain any non-protocol words, so they make sense in any language. - +;; Note that the following definitions generally avoid `propertize' +;; because it reverses the order of the text properties it's given. (defvar erc--message-speaker-statusmsg #("(%p%n%s) %m" 0 1 (font-lock-face erc-default-face) @@ -6227,11 +6228,11 @@ NUH, and the current `erc-response' object.") "Message template for a CTCP ACTION from another user.") (defvar erc--message-speaker-ctcp-action-input - #("* %p%n %m" - 0 2 (font-lock-face #1=(erc-input-face erc-action-face)) - 2 4 (font-lock-face (erc-my-nick-prefix-face . #1#)) - 4 6 (font-lock-face (erc-my-nick-face . #1#)) - 6 9 (font-lock-face #1#)) + (let ((base '(erc-input-face erc-action-face))) ; shared + (concat (propertize "* " 'font-lock-face base) + (propertize "%p" 'font-lock-face `(erc-my-nick-prefix-face ,@base)) + (propertize "%n" 'font-lock-face `(erc-my-nick-face ,@base)) + (propertize " %m" 'font-lock-face base))) "Message template for a CTCP ACTION from current client.") (defvar erc--message-speaker-ctcp-action-statusmsg @@ -6244,12 +6245,12 @@ NUH, and the current `erc-response' object.") "Template for a CTCP ACTION status message from another chan op.") (defvar erc--message-speaker-ctcp-action-statusmsg-input - #("* (%p%n%s) %m" - 0 3 (font-lock-face #1=(erc-input-face erc-action-face)) - 3 5 (font-lock-face (erc-my-nick-prefix-face . #1#)) - 5 7 (font-lock-face (erc-my-nick-face . #1#)) - 7 9 (font-lock-face (erc-notice-face . #1#)) - 9 13 (font-lock-face #1#)) + (let ((base '(erc-input-face erc-action-face))) ; shared + (concat (propertize "* (" 'font-lock-face base) + (propertize "%p" 'font-lock-face `(erc-my-nick-prefix-face ,@base)) + (propertize "%n" 'font-lock-face `(erc-my-nick-face ,@base)) + (propertize "%s" 'font-lock-face `(erc-notice-face ,@base)) + (propertize ") %m" 'font-lock-face base))) "Template for a CTCP ACTION status message from current client.") (defun erc--speakerize-nick (nick &optional disp) -- 2.39.5