Using a named function to map C-e to C-c, the Key Translation is successful: (progn (fset 'foo (lambda (prompt) (kbd "C-c"))) (define-key key-translation-map (kbd "C-e") 'foo))
Using an anonymous function for another keymap binds C-e to the lambda-defined command. (define-key global-map (kbd "C-e") (lambda () (interactive) (message "Inside C-e's lambda")))
But using an anonymous function for key-translation-map does not change behavior of inputting C-e: (define-key key-translation-map (kbd "C-e") (lambda (prompt) (kbd "C-c")))
This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up
to one day, you should receive an acknowledgement at that address.
Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages.
Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q':
If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands:
`bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /home/epich/sw/emacs-24.1/install/share/emacs/24.1/etc/DEBUG.
In GNU Emacs 24.1.1 (i686-pc-linux-gnu, X toolkit, Xaw scroll bars)
of 2012-07-07 on epich-hp Windowing system distributor `The X.Org Foundation', version 11.0.11001000 Configured using: `configure '--prefix=/home/epich/sw/emacs-24.1/install''
Important settings:
value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t
Major mode: Lisp Interaction
Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t
tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t
line-number-mode: t transient-mark-mode: t
Recent input: C-y <return> C-y <return> C-y <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right> <right> <right> <right> C-e M-x e v a l - l a s t s e x p <backspace> <backspace> <backspace> <backspace>
- s e x p <return> <left> <left> <left> C-e C-g <right> <right> <right> <return> <return> ( d e f i n e - k e y SPC k e y - t r a n s l a t i o n - m a p SPC (
k b d SPC " C - e " SPC n i l ) ) M-x e v i l <backspace> <backspace> a l - l a s t - s e x p <return> <down-mouse-1> <mouse-movement> <mouse-1> <right> ) <right> <right>
<right> <right> <right> <right> <backspace> <left> <right> <right> <left> SPC M-x e v a l - l a s t - s e x p <return> <left> <left> <left> <left> C-e <down>
<down> <down> <up> <left> <left> <down> <down> C-e M-x e v a l - l a s t - s e x p <return> <left> <left> <left> C-e <down> <down> <down> <down> M-x e v a l
- l a s t - s e x p <return> <left> <left> C-e C-e <left> <left> C-e M-x r e p o r t - e m a c s - <backspace> <backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <down-mouse-1> q <mouse-1> q <down-mouse-1> <mouse-1> M-x r e p o
r t - e m a c s - b u g <return>
Recent messages: You can run the command `eval-last-sexp' with C-x C-e (lambda nil (interactive) (message "Inside C-e's lambda")) You can run the command `eval-last-sexp' with C-x C-e
Inside C-e's lambda (lambda (prompt) (kbd "C-c")) You can run the command `eval-last-sexp' with C-x C-e Inside C-e's lambda [3 times] delete-backward-char: Text is read-only [2 times]
Quit Back to top level.