emacs-devel
[Top][All Lists]
Advanced

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

Re: set-transient-map and a question


From: Robert Pluim
Subject: Re: set-transient-map and a question
Date: Wed, 12 Jul 2023 10:55:50 +0200

>>>>> On Wed, 12 Jul 2023 05:39:48 +0200, Michael Heerdegen 
>>>>> <michael_heerdegen@web.de> said:

    Michael> "T.V Raman" <raman@google.com> writes:
    >> For me, hitting c-x c-e at the end of that code while in the gnus
    >> article buffer did not appear to work, it continued to call keys in the
    >> buffer-local gnus article mode.

    Michael> Works for me.  C-c C-e C-c C-b tries to compile the article 
buffer, for
    Michael> example.  It was a silly example, of course, but it should work.

    Michael> There are not many bindings in `emacs-lisp-mode-map'.  You really 
tried
    Michael> one of those keys _immediately_ after evaluating the 
`set-transient-map'
    Michael> expression (note that the transient map is gone after one entering 
one
    Michael> key binding not present in the map)?

I tried the following in "*scratch*", and I get "deactivated" in
*Messages* after hitting "+" (or indeed any key).

    (set-transient-map
     (let ((map (make-sparse-keymap)))
       (define-key map "+" (lambda () (interactive) (message "whoohoo")))
       map)
     nil (lambda () (message "deactivated")))

which means my proposed doc update is wrong.

Moral: test before documenting, not after :-)

Robert
-- 



reply via email to

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