unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* I do not understand input-decode-map
@ 2008-09-29 20:58 Lennart Borgman (gmail)
  2008-09-30  1:31 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-29 20:58 UTC (permalink / raw)
  To: Emacs Devel

This works, ie typing "." gives ":" (even in for example Viper)

  (define-key input-decode-map [?\.] [?\:])

Why does not the next work?

  (setq input-decode-map (make-sparse-keymap))
  (defvar my-second-map (make-sparse-keymap))
  (define-key my-second-map [?\:] [?\.])
  (define-key input-decode-map [?\,] my-second-map)

Typing "," does what it use to do. Not too bad, but not what I expected ...




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: I do not understand input-decode-map
  2008-09-29 20:58 I do not understand input-decode-map Lennart Borgman (gmail)
@ 2008-09-30  1:31 ` Stefan Monnier
  2008-09-30  1:36   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2008-09-30  1:31 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

> This works, ie typing "." gives ":" (even in for example Viper)
>   (define-key input-decode-map [?\.] [?\:])

> Why does not the next work?

>   (setq input-decode-map (make-sparse-keymap))
>   (defvar my-second-map (make-sparse-keymap))
>   (define-key my-second-map [?\:] [?\.])
>   (define-key input-decode-map [?\,] my-second-map)

> Typing "," does what it use to do. Not too bad, but not what I expected ...

The detailed behavior is fairly tricky.  Basically, it's difficult to
know when to stop waiting for more keys.  IIRC the code basically stops
if the current input (rewritten/remapped as necessary) is a valid key
sequence bound to a command.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: I do not understand input-decode-map
  2008-09-30  1:31 ` Stefan Monnier
@ 2008-09-30  1:36   ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-30  1:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Devel

Stefan Monnier wrote:
>> This works, ie typing "." gives ":" (even in for example Viper)
>>   (define-key input-decode-map [?\.] [?\:])
> 
>> Why does not the next work?
> 
>>   (setq input-decode-map (make-sparse-keymap))
>>   (defvar my-second-map (make-sparse-keymap))
>>   (define-key my-second-map [?\:] [?\.])
>>   (define-key input-decode-map [?\,] my-second-map)
> 
>> Typing "," does what it use to do. Not too bad, but not what I expected ...
> 
> The detailed behavior is fairly tricky.  Basically, it's difficult to
> know when to stop waiting for more keys.  IIRC the code basically stops
> if the current input (rewritten/remapped as necessary) is a valid key
> sequence bound to a command.


I am not sure I understand. It is a bit unexpected that it stops before
there is a matching valid key sequence in input-decode-map. Why is that
useful?




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-30  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-29 20:58 I do not understand input-decode-map Lennart Borgman (gmail)
2008-09-30  1:31 ` Stefan Monnier
2008-09-30  1:36   ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).