all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uros Perisic <uros.m.perisic@gmail.com>
To: 40096@debbugs.gnu.org
Subject: bug#40096: 26.3; set-transient-map does not work with remapped bindings
Date: Tue, 17 Mar 2020 10:32:21 +0800	[thread overview]
Message-ID: <CAJkVgVoxOdziz8boC0gmZHXrhZ=_vqHwrZ690on9c9Pi0hNB2Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2210 bytes --]

`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

[-- Attachment #2: Type: text/html, Size: 2551 bytes --]

             reply	other threads:[~2020-03-17  2:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17  2:32 Uros Perisic [this message]
2022-05-23 11:08 ` bug#40096: 26.3; set-transient-map does not work with remapped bindings Lars Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJkVgVoxOdziz8boC0gmZHXrhZ=_vqHwrZ690on9c9Pi0hNB2Q@mail.gmail.com' \
    --to=uros.m.perisic@gmail.com \
    --cc=40096@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.