bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40096: 26.3; set-transient-map does not work with remapped bindings


From: Uros Perisic
Subject: bug#40096: 26.3; set-transient-map does not work with remapped bindings
Date: Tue, 17 Mar 2020 10:32:21 +0800


`set-transient-keymap' states that "if the optional argument KEEP-PRED
is t, MAP stays active if a key from MAP is used". This is not the
case. If one of the keys on the keymap is bound using the special
[remap <function>] vector, the map is deactivated.

I think the reason is that this test fails:
#+BEGIN_SRC elisp
(let ((mc (lookup-key map (this-command-keys-vector))))
                          ;; If the key is unbound `this-command` is
                          ;; nil and so is `mc`.
                          (and mc (eq this-command mc)))
#+END_SRC

Here's a recipe to reproduce it starting form emacs -Q:
#+BEGIN_SRC elisp
(setq mymap (make-sparse-keymap))
(defun message-foo () (interactive) (message "foo"))
(defun message-bar () (interactive) (message "bar"))
(define-key mymap "f" #'message-foo)
(set-transient-map mymap t)
;; continually press f and note that foo is constantly messaged
;; press any other letter and it will stop
(define-key mymap [remap message-foo] #'message-bar)
(set-transient-map mymap t)
;; note that pressing f only echoes foo once
#+END_SRC

In GNU Emacs 26.3 (build 1, x86_64-unknown-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29 built on a-hel-fi
Windowing system distributor 'The X.Org Foundation', version 11.0.12007000
System Description: Void Linux

Configured using:
 'configure --with-x-toolkit=gtk3 --with-xwidgets --prefix=/usr
 --sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin
 --mandir=/usr/share/man --infodir=/usr/share/info --localstatedir=/var
 --with-file-notification=inotify --with-modules --with-jpeg --with-tiff
 --with-gif --with-png --with-xpm --with-rsvg --without-imagemagick
 --with-xml2 --with-gnutls --with-sound --with-m17n-flt
 --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu
 'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe -g' 'CPPFLAGS= '
 'LDFLAGS=-no-pie -Wl,--as-needed ''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS XWIDGETS LCMS2

Important settings:
  value of $LC_COLLATE: C
  value of $LC_MESSAGES:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

reply via email to

[Prev in Thread] Current Thread [Next in Thread]