unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to bind the same function to different keys with different behaviours?
@ 2016-01-13 12:55 sokobania.01
  2016-01-13 12:53 ` tomas
       [not found] ` <mailman.2277.1452691703.843.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: sokobania.01 @ 2016-01-13 12:55 UTC (permalink / raw)
  To: help-gnu-emacs

In the basic modemap, the ascii keys are bound to `self-insert-command'.
As it is not an emacs-lisp function, I cannot "copy" its code.

I want to bind the keys [A-Z] to `my-self-insert-command' with something like:
(for key from ?A to ?Z do
  (bind-key my-mode-map key 'my-self-insert-command))

This function kind of inserts the current key pressed under some conditions.

So far, I don't know how to get acces to the current key pressed from within `my-self-insert-command'.

Is this possible?


If it is not possible, I'll do something like:

(for key from ?A to ?Z do
  (bind-key my-mode-map key (lambda () (my-self-insert-command key))))


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

end of thread, other threads:[~2016-01-13 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 12:55 How to bind the same function to different keys with different behaviours? sokobania.01
2016-01-13 12:53 ` tomas
     [not found] ` <mailman.2277.1452691703.843.help-gnu-emacs@gnu.org>
2016-01-13 14:01   ` sokobania.01

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).