From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 21 22:59:43 2012 Received: (at submit) by debbugs.gnu.org; 22 Jul 2012 02:59:43 +0000 Received: from localhost ([127.0.0.1]:56566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SsmOU-0001su-Jx for submit@debbugs.gnu.org; Sat, 21 Jul 2012 22:59:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46356) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SsmOR-0001sk-0E for submit@debbugs.gnu.org; Sat, 21 Jul 2012 22:59:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsmIB-00028K-7I for submit@debbugs.gnu.org; Sat, 21 Jul 2012 22:53:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:33019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsmIB-00028G-3o for submit@debbugs.gnu.org; Sat, 21 Jul 2012 22:53:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsmI9-0004sj-7N for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 22:53:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsmI7-00027n-05 for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 22:53:09 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:64654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsmI6-00027g-Nq for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2012 22:53:06 -0400 Received: by obhx4 with SMTP id x4so9087095obh.0 for ; Sat, 21 Jul 2012 19:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gcAUoWTlVUtzrKv8C5Fur7uCYeUWEtF7Nyx1VbTge44=; b=Mz7a+rUNxNpdsXuMQUTV6Om93wDlT9X8xU5v7k8TUkAspVaSGhGALMVgfAGQDzDtLY Mc7OLWL4S9BT6L2RUHaS5A6qB8pTiOwmtFDCR9V6VHp7quiBZK6F/T5Zy8Qfd9kcDpcD 4DzFH2Uu5amb5BDAzXb4GMZSHYSDyfvh6sGtzCcB9DHb+6AX1jCjlJD6LykLNu0w1LRk IdRfdh03qu5YGl/rnDZeSxEOb4WTyXBWNIG76/oACJXaRZZ/fsk0CgOna/UT8sFJvkfT GNLtBK797fejR5jI4n7v9P109OjxK1v/JWDXtXqIPwlCpLnceK1c9Rmx22wJKqgVkvuv Wk0w== MIME-Version: 1.0 Received: by 10.60.2.3 with SMTP id 3mr14797693oeq.0.1342925585438; Sat, 21 Jul 2012 19:53:05 -0700 (PDT) Received: by 10.182.179.35 with HTTP; Sat, 21 Jul 2012 19:53:05 -0700 (PDT) Date: Sat, 21 Jul 2012 22:53:05 -0400 Message-ID: Subject: Unable to use anonymous functions for Key Translations From: Barry OReilly To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=e89a8fb205f27ad92e04c5623a0e X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --e89a8fb205f27ad92e04c5623a0e Content-Type: text/plain; charset=ISO-8859-1 Using an anonymous function to translate keys as described in the Elisp manual at http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.htmldoes not work as expected. 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"))) I find no reason why the last Elisp shouldn't define a Key Translation. The Elisp manual section on Anonymous Functions states "Anonymous functions are valid wherever function names are." ( http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html) 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 C-y C-y C-e M-x e v a l - l a s t s e x p - s e x p C-e C-g ( 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 a l - l a s t - s e x p ) SPC M-x e v a l - l a s t - s e x p C-e C-e M-x e v a l - l a s t - s e x p C-e M-x e v a l - l a s t - s e x p C-e C-e C-e M-x r e p o r t - e m a c s - q q M-x r e p o r t - e m a c s - b u g 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. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode easymenu view debug edmacro kmacro time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dynamic-setting font-render-setting x-toolkit x multi-tty emacs) --e89a8fb205f27ad92e04c5623a0e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Using an anonymous function to translate keys as described in the Elisp man= ual at http://www.gnu.org/software/emacs/manual/html_nod= e/elisp/Translation-Keymaps.html does not work as expected.

Using a named function to map C-e to C-c, the Key Translation is succes= sful:
=A0 (progn (fset 'foo (lambda (prompt) (kbd "C-c")))=
=A0=A0=A0=A0=A0=A0=A0=A0 (define-key key-translation-map (kbd "C-e= ") 'foo))
=A0=A0=A0=A0=A0=A0=A0=A0
Using an anonymous function for another keymap= binds C-e to the lambda-defined command.
=A0 (define-key global-map
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (kbd "C-e")
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (lambda () (interactive) (message "Insi= de C-e's lambda")))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
But using an anonymous function for k= ey-translation-map does not change behavior of inputting C-e:
=A0 (defin= e-key key-translation-map
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (kbd &= quot;C-e")
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (lambda (prompt)= (kbd "C-c")))

I find no reason why the last Elisp shouldn't define a Key Translat= ion.=A0 The Elisp manual section on Anonymous Functions states "Anonym= ous functions are valid wherever function names are."=A0 ( http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-= Functions.html )







This bug report will be sent to the Bug-GNU-Ema= cs mailing list
and the GNU bug tracker at debbugs.gnu.org.=A0 Please check that
the From: line contains = a valid email address.=A0 After a delay of up
to one day, you should receive an acknowledgement at that address.

P= lease write in English if possible, as the Emacs maintainers
usually do = not have translators for other languages.

Please describe exactly wh= at actions triggered the bug, and
the precise symptoms of the bug.=A0 If you can, give a recipe
starting f= rom `emacs -Q':



If Emacs crashed, and you have the Emacs= process in the gdb debugger,
please include the output from the followi= ng gdb commands:
=A0=A0=A0 `bt full' and `xbacktrace'.
For information about debu= gging Emacs, please read the file
/home/epich/sw/emacs-24.1/install/shar= e/emacs/24.1/etc/DEBUG.


In GNU Emacs 24.1.1 (i686-pc-linux-gnu, = X toolkit, Xaw scroll bars)
=A0of 2012-07-07 on epich-hp
Windowing system distributor `The X.Org Fou= ndation', version 11.0.11001000
Configured using:
=A0`configure &= #39;--prefix=3D/home/epich/sw/emacs-24.1/install''

Important= settings:
=A0 value of $LC_ALL: nil
=A0 value of $LC_COLLATE: nil
=A0 value of = $LC_CTYPE: nil
=A0 value of $LC_MESSAGES: nil
=A0 value of $LC_MONETA= RY: nil
=A0 value of $LC_NUMERIC: nil
=A0 value of $LC_TIME: nil
= =A0 value of $LANG: en_US.UTF-8
=A0 value of $XMODIFIERS: nil
=A0 locale-coding-system: utf-8-unix
= =A0 default enable-multibyte-characters: t

Major mode: Lisp Interact= ion

Minor modes in effect:
=A0 tooltip-mode: t
=A0 mouse-wheel= -mode: t
=A0 tool-bar-mode: t
=A0 menu-bar-mode: t
=A0 file-name-shadow-mode: = t
=A0 global-font-lock-mode: t
=A0 font-lock-mode: t
=A0 blink-cur= sor-mode: t
=A0 auto-composition-mode: t
=A0 auto-encryption-mode: t<= br>=A0 auto-compression-mode: t
=A0 line-number-mode: t
=A0 transient-mark-mode: t

Recent input:<= br>C-y <return> C-y <return> C-y <up> <up> <up&g= t; <up> <up>
<up> <up> <up> <up> &l= t;up> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <r= ight> <right>
<right> <right> <right> <ri= ght> <right> <right> <right>
<right> <rig= ht> <right> <right> <right> <right> <right>= ;
<right> <right> <right> <right> <right> <r= ight> <right>
<right> <right> <right> C-e M-= x e v a l - l a s t s
e x p <backspace> <backspace> <bac= kspace> <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> <= br><backspace> a l - l a s t - s e x p <return> <down-mouse-= 1>
<mouse-movement> <mouse-1> <right> ) <right&= gt; <right>
<right> <right> <right> <right> <backspace> &= lt;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> <le= ft> <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
&l= t;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> &l= t;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 r= un the command `eval-last-sexp' with C-x C-e
(lambda nil (interactiv= e) (message "Inside C-e's lambda"))
You can run the comman= d `eval-last-sexp' with C-x C-e
Inside C-e's lambda
(lambda (prompt) (kbd "C-c"))
You c= an run the command `eval-last-sexp' with C-x C-e
Inside C-e's la= mbda [3 times]
delete-backward-char: Text is read-only [2 times]
Quit
Back to top level.

Load-path shadows:
None found.

= Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec = rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mail= abbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-u= til mail-prsvr mail-utils help-mode easymenu view debug edmacro
kmacro t= ime-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd = tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
sy= ntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnam= ese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slov= ak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefsbutton faces cus-face files text-properties overlay sha1 md5 base64
for= mat env code-pages mule custom widget hashtable-print-readable
backquote= make-network-process dynamic-setting font-render-setting
x-toolkit x multi-tty emacs)

--e89a8fb205f27ad92e04c5623a0e-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 11 22:54:23 2012 Received: (at submit) by debbugs.gnu.org; 12 Aug 2012 02:54:23 +0000 Received: from localhost ([127.0.0.1]:50289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0OJr-00035F-15 for submit@debbugs.gnu.org; Sat, 11 Aug 2012 22:54:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46254) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0OJm-000356-S7 for submit@debbugs.gnu.org; Sat, 11 Aug 2012 22:54:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0OBd-0008Co-76 for submit@debbugs.gnu.org; Sat, 11 Aug 2012 22:45:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0OBd-0008Ck-2m for submit@debbugs.gnu.org; Sat, 11 Aug 2012 22:45:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0OBb-0004pH-Iz for bug-gnu-emacs@gnu.org; Sat, 11 Aug 2012 22:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0OBY-0008CQ-NE for bug-gnu-emacs@gnu.org; Sat, 11 Aug 2012 22:45:51 -0400 Received: from mail-vc0-f169.google.com ([209.85.220.169]:52043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0OBY-0008CL-HI for bug-gnu-emacs@gnu.org; Sat, 11 Aug 2012 22:45:48 -0400 Received: by vcbfl10 with SMTP id fl10so3026310vcb.0 for ; Sat, 11 Aug 2012 19:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ekqq0F/2qd+dJGvbSDRvLfoRHV6PYhIYTwL52GZUCLY=; b=MFJllykzhmTOXM+4CI9jxQ+TIlAHq/0yWNBfNDfVZddV9t0F6gBx7on9fyQNbxJHGX w5Mr/VAgqq+3xGUZRoXmFd5bPelHGK9A0t7C0iN3pBZakLMlroij0qwHsTMBdK5hUoLA sif/gQ/joD6XfwuwtK1Xl+Kcf4Zba7C5LMs+4FLma1uYCkU4/zWW3euaykJpfKwVfFBa rg0zFeSEO4weFm2t+pXMo2NWKN23g88lz7MLTEziAn3af0D9oCGAPdX87ZfWiuM6ti+R sPnQweuH5bTt1LX69jcrom+gKiGPRkAFnuoYkWgGzm/F9JDqmwX2dXpv5tR6Ko+qR+SM enOg== MIME-Version: 1.0 Received: by 10.52.21.174 with SMTP id w14mr5206432vde.24.1344739547506; Sat, 11 Aug 2012 19:45:47 -0700 (PDT) Received: by 10.58.219.225 with HTTP; Sat, 11 Aug 2012 19:45:47 -0700 (PDT) Date: Sat, 11 Aug 2012 22:45:47 -0400 Message-ID: Subject: bug#12022: [PATCH] Unable to use anonymous functions for Key Translations, From: Barry OReilly To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary=20cf307ca5380b677f04c7089336 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --20cf307ca5380b677f04c7089336 Content-Type: multipart/alternative; boundary=20cf307ca5380b677b04c7089334 --20cf307ca5380b677b04c7089334 Content-Type: text/plain; charset=ISO-8859-1 > Using an anonymous function to translate keys as described in the Elisp manual at http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.htmldoes not work as expected. > > 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"))) > > I find no reason why the last Elisp shouldn't define a Key Translation. The Elisp manual section on Anonymous Functions states "Anonymous functions are valid wherever function names are." ( http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html) Hi, I found where the definition of a key translation is called, and made a patch. The quoted test case works correctly now. Is the change ok? --20cf307ca5380b677b04c7089334 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > Using an anonymous function to translate keys as described in the Elis= p manual at http://www.gnu.org/software/emacs/manual/htm= l_node/elisp/Translation-Keymaps.html does not work as expected.
>
> Using a named function to map C-e to C-c, the Key Translation= is successful:
>=A0=A0 (progn (fset 'foo (lambda (prompt) (kbd &= quot;C-c")))
>=A0=A0=A0=A0=A0=A0=A0=A0=A0 (define-key key-transl= ation-map (kbd "C-e") 'foo))
>=A0=A0=A0=A0=A0=A0=A0=A0
> Using an anonymous function for anoth= er keymap binds C-e to the lambda-defined command.
>=A0=A0 (define-ke= y global-map
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (kbd "C= -e")
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (lambda () (int= eractive) (message "Inside C-e's lambda")))
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
> But using an anonymous funct= ion for key-translation-map does not change behavior of inputting C-e:
&= gt;=A0=A0 (define-key key-translation-map
>=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (kbd "C-e")
>=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 (lambda (prompt) (kbd "C-c")))
>
> I find no reason why the last Elisp shouldn't define a Ke= y Translation.=A0 The Elisp manual section on Anonymous Functions states &q= uot;Anonymous functions are valid wherever function names are."=A0 ( <= a href=3D"http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymou= s-Functions.html">http://www.gnu.org/software/emacs/manual/html_node/elisp/= Anonymous-Functions.html )

Hi,
I found where the definition of a key translation is called, and= made a patch.=A0 The quoted test case works correctly now.=A0 Is the chang= e ok?

--20cf307ca5380b677b04c7089334-- --20cf307ca5380b677f04c7089336 Content-Type: text/plain; charset=US-ASCII; name="lambdaKeyTranslation.txt" Content-Disposition: attachment; filename="lambdaKeyTranslation.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h5rj35k10 IyBCYXphYXIgbWVyZ2UgZGlyZWN0aXZlIGZvcm1hdCAyIChCYXphYXIgMC45MCkKIyByZXZpc2lv bl9pZDogZ3VuZGFldGlhcG9AZ21haWwuY29tLTIwMTIwODEyMDIyMzU4LTloZjM4czN5cXJuZ213 ajAKIyB0YXJnZXRfYnJhbmNoOiBienI6Ly9ienIuc2F2YW5uYWguZ251Lm9yZy9lbWFjcy90cnVu ay8KIyB0ZXN0YW1lbnRfc2hhMTogOTdhYzdkMzk2Y2ZjYmY2OTJlOGU4OGRmNDI1ODllY2JhMGZj OGM3MAojIHRpbWVzdGFtcDogMjAxMi0wOC0xMSAyMjoyND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VloKM0dZTzFDN2NFek1zWWt5end4VEg0N1N2 UWxrcVlFTjRWK2VGN3NBaWNnMXUrUC9DNDJVS2F2SjZidG14bVFWN2txZ3RCelFpNTYxRwpIdjR2 a3ZCTG9CbXBHaUIzNmVhbDFqRW1LVkJOTUxxNHNvQmdEOXlkQVhiUkRzVVVOeFJGaXBCcWZ3MnpY eVM0OTZzM29KaDA3RTA0ClVGSWRRclZUbFpWczdMVzVhMk1UUzJPbEtuS0Z5NkxhS0d0UFVndHVx Z21waUo3N1NJT253Y29MekZKOXo0UW8xTlY5cDFGUmJHczcKR1Y3QVpCYXAySy9sU1RRLzZxRFdO SzJUa2JJWHpTd3BNNlBuS29LMDNnbXhrMVlkcWFHRzlSU3RqUzNvb3E0SGNCWnFsWHFnV2lrcgpj MGExVDZpOFZHOG85OGYvRjNKRk9GQ1Fhbml2a3c9PQo= --20cf307ca5380b677f04c7089336-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 14 12:12:07 2012 Received: (at 12022-quiet) by debbugs.gnu.org; 14 Aug 2012 16:12:07 +0000 Received: from localhost ([127.0.0.1]:56528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1Jiw-0000GW-Kd for submit@debbugs.gnu.org; Tue, 14 Aug 2012 12:12:07 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46574) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1Jiv-0000GP-9O for 12022-quiet@debbugs.gnu.org; Tue, 14 Aug 2012 12:12:06 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1T1JaY-0006Lk-FN for 12022-quiet@debbugs.gnu.org; Tue, 14 Aug 2012 12:03:26 -0400 From: Stefan Monnier To: 12022-quiet@debbugs.gnu.org Subject: Re: bug#12022: [PATCH] Unable to use anonymous functions for Key Translations In-Reply-To: (Barry OReilly's message of "Mon, 13 Aug 2012 20:02:10 -0400") Date: Tue, 14 Aug 2012 08:13:22 -0400 Lines: 11 References: X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Tue Aug 14 08:13:34 2012 Received: from eggs.gnu.org ([208.118.235.92]:47412) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1T1G06-0004f0-D5 for rgm@gnu.org; Tue, 14 Aug 2012 08:13:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1G00-00087s-3c for rgm@gnu.org; Tue, 14 Aug 2012 08:13:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1G00-00087n-0R for rgm@gnu.org; Tue, 14 Aug 2012 08:13:28 -0400 Received: from localhost ([::1]:34053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Fzz-0007bU-Tx for rgm@gnu.org; Tue, 14 Aug 2012 08:13:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Fzw-0007ak-GN for emacs-devel@gnu.org; Tue, 14 Aug 2012 08:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1Fzv-00086p-GI for emacs-devel@gnu.org; Tue, 14 Aug 2012 08:13:24 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:29682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Fzv-00086l-CC for emacs-devel@gnu.org; Tue, 14 Aug 2012 08:13:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCqqR/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA0kiBwFugmQRAOjM4FYgwU X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="195645285" Received: from 76-10-170-145.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([76.10.170.145]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Aug 2012 08:13:22 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 18CCEAE427; Tue, 14 Aug 2012 08:13:22 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 12022-quiet X-BeenThere: debbugs-submit@debbugs.gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) [resent from emacs-devel] > I found where the definition of a key translation is called, and made a > patch. The quoted test case works correctly now. Is the change ok? Yes, good spotting, thank you. I installed your patch slightly simplified (FUNCTIONP already does the Ffboundp and SYMBOLP checks). Thanks, Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 14 12:13:32 2012 Received: (at control) by debbugs.gnu.org; 14 Aug 2012 16:13:32 +0000 Received: from localhost ([127.0.0.1]:56534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1JkK-0000Ii-GB for submit@debbugs.gnu.org; Tue, 14 Aug 2012 12:13:32 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46587) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1JkI-0000Ib-UA for control@debbugs.gnu.org; Tue, 14 Aug 2012 12:13:31 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1T1Jbw-0006NH-5Z for control@debbugs.gnu.org; Tue, 14 Aug 2012 12:04:52 -0400 Date: Tue, 14 Aug 2012 12:04:52 -0400 Message-Id: Subject: control message for bug 12022 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) close 12022 24.3 From unknown Wed Sep 10 20:08:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 12 Sep 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator