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?

Toothrot
  • 3,204
  • 1
  • 12
  • 30
  • +1 for "Any hints as to how I might have found the answer to this myself (using EMACS) would be appreciated too." – Drew Apr 06 '20 at 16:11

1 Answers1

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

rpluim
  • 4,605
  • 8
  • 22
  • 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). – NickD Apr 06 '20 at 23:03