2

What exactly determines what is inserted by self-insert-command? If I change the input-method to greek, p will insert π, but will still be bound to self-insert-command, though it patently does not insert itself. C-h k p will say that p is still bound to self-insert-command and that p was translated to π, but says nothing more about this translation. Any hints as to how I might have found the answer to this myself (using EMACS) would be appreciated too.

PS. I realize the question may not be entirely clear. To put it differently, what is the simplest way to let a insert foo, while remaining bound to self-insert-command? Does this have to be done by an input method, or does translation indicate something more general?

1
  • +1 for "Any hints as to how I might have found the answer to this myself (using EMACS) would be appreciated too." Commented Apr 6, 2020 at 16:11

1 Answer 1

1

M-x describe-input-method greek RET should tell you a lot already. Also the contents of lisp/leim/quail/greek.el are pretty self-explanatory (which is not the case for all input methods).

See Input Methods and Reading Input for more details (both of which are available in Emacs Info).

1
  • Assuming that I've got the sequence correct, emacs reads an event (e.g. a key press), passes it through keyboard translation, then passes it through the input method function, then gives the result to self-insert-command. Even within self-insert-command there is one more level of translation through the translation-table-for-input before it is passed to internal-self-insert (which for now at least remains a black box to me). Commented Apr 6, 2020 at 23:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.