2

I did some editing. Then went to C-x C-k l edited the stuff to suit my needs. Saved it with C-c C-c. Gave it a name with C-x C-k b. Finally, went to ~/.emacs and did M-x insert-kbd-macro

To my surprise, it produced few words and a long series of numbers. I can still execute it using M-x macroname RET and edit it using C-x C-k e. So no problems.

But why those cryptic numbers in ~/.emacs?

Drew
  • 77,472
  • 10
  • 114
  • 243
deshmukh
  • 1,912
  • 14
  • 31

1 Answers1

2

Keyboard macros record keystrokes (or keyboard events), which typically (although not exclusively) have a numeric representation.

Many directly represent characters, as characters are integers in Emacs Lisp. e.g. The character t is 116:

ELISP> ?t
116 (#o164, #x74, ?t)

(Characters are therefore likely to account for all the smaller numbers.)

Larger numbers can represent more complex key events. e.g.:

ELISP> (listify-key-sequence (kbd "M-x"))
(134217848)

A few events may have non-numeric representations (e.g. return).

You can read all about events in the manual:

C-hig (elisp) Input Events RET

phils
  • 50,977
  • 3
  • 79
  • 122