GNU bug report logs - #63343
30.0.50; generated mode function will error if mode name contains '%'

Previous Next

Package: emacs;

Reported by: No Wayman <iarchivedmywholelife <at> gmail.com>

Date: Sun, 7 May 2023 04:10:01 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: No Wayman <iarchivedmywholelife <at> gmail.com>
To: 63343 <at> debbugs.gnu.org
Subject: bug#63343: 30.0.50; generated mode function will error if mode name contains '%'
Date: Sat, 06 May 2023 23:46:10 -0400
[Message part 1 (text/plain, inline)]

Mode functions generated via `define-minor-mode' will signal an 
error when messaging a mode's "pretty" name contains "%".

To reproduce:

1. eval: (define-minor-mode 100%-failure-mode "oops")
2. enable or disable the mode.

The line responsible for the error is:

(message ,(format "%s %%sabled%%s" pretty-name) 
        (if ,getter "en" "dis") local)))))

The attached patch fixes the issue for me.

[0001-define-minor-mode-sanitize-mode-function-messages.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.37, cairo version 1.17.8) of 2023-04-14 built on nbook
Repository revision: dc842a71ed035dab1115f2e67d35dd07410e18be
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 
11.0.12101008
System Description: Arch Linux


This bug report was last modified 2 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.