GNU bug report logs - #75933
29; Disabling smerge-command-prefix results in error

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Wed, 29 Jan 2025 19:29:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jonas Bernoulli <jonas <at> bernoul.li>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 75933 <at> debbugs.gnu.org
Subject: bug#75933: 29; Disabling smerge-command-prefix results in error
Date: Wed, 29 Jan 2025 21:53:29 +0200
> Date: Wed, 29 Jan 2025 20:28:32 +0100
> From:  Jonas Bernoulli via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Hello,
> 
> In Emacs 28 the prefix key was defined like this:
> 
>   (defcustom smerge-command-prefix "\C-c^"
>     "Prefix for `smerge-mode' commands."
>     :type '(choice (const :tag "ESC"   "\e")
>                    (const :tag "C-c ^" "\C-c^" )
>                    (const :tag "none"  "")
>                    string))
> 
>   (easy-mmode-defmap smerge-mode-map
>     `((,smerge-command-prefix . ,smerge-basic-map))
>     "Keymap for `smerge-mode'.")
> 
> In Emacs 29.1 (after 2ae3b66fa80 and some fixup commits), the former
> remained as it was in 28, but the latter was replaced with:
> 
>   (defvar-keymap smerge-mode-map
>     (key-description smerge-command-prefix) smerge-basic-map)
> 
> Setting the option to "", to add no prefix command, results in:
> 
>   keymap--check: "" is not a valid key definition; see `key-valid-p'
> 
> A possible fix could be to do it old-school:
> 
>   (defvar smerge-mode-map
>     (let ((map (make-sparse-keymap))
>           (key (key-description smerge-command-prefix)))
>       (when (key-valid-p key)
>         (keymap-set map key smerge-basic-map))
>       map))

Thanks.

Stefan, can you suggest a solution?




This bug report was last modified 112 days ago.

Previous Next


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