3

I generated a macro as a help for generating indices for words I have marked before. Now this macro looks as follows

(fset 'index
   "\367\\index{\C-y")

What does \367stand for and where can I look it up?

2
  • How did you get this representation for the macro? Did you type a M-w in your macro? I suspect my answer misses something, after reading section 2.3.3.4 of the elisp manual.
    – JeanPierre
    Aug 22, 2019 at 19:48
  • @JeanPierre : I used M-x insert-kbd-macro Aug 22, 2019 at 20:14

1 Answer 1

5

This is a representation of the character whose code is 367 in octal. This "general escape representation" is described in the elisp manual.

You can use the function text-char-description as:

M-: (text-char-description ?\367)

or M-x describe-char with point on the char

to see this is the character DIVISION SIGN.

Now the question is what does it stand for?

The short answer is that this character is the representation of the keyboard event M-w in a string. For the details I recommend reading section Putting Keyboard Events in Strings of the elisp manual.

Also note that the manual discourages storing keyboard events in strings and recommends using vectors instead.

5
  • Do you maybe know why the division sign appears there at all? Which function does it have? I tried to look it up but didn't find a useful source. Aug 23, 2019 at 8:39
  • I suspect this is in fact a representation of M-w, that's why I asked you about this. Unfortunately, insert-kbd-macro does not bring up a string for me. I'm currently investigating.
    – JeanPierre
    Aug 23, 2019 at 9:34
  • Oh yes, now I understand. I indeed typed M-w to have the marked word saved before I paste it. Now it's clear, thank you very much! Aug 23, 2019 at 10:21
  • 1
    "insert-kbd-macro does not bring up a string for me" - it depends which keys you have in the macro: if all of them are plain characters that fit in range 0-255, then Emacs will use a string, otherwise a vector.
    – npostavs
    Aug 23, 2019 at 12:22
  • @npostavs Yes indeed, thanks!
    – JeanPierre
    Aug 23, 2019 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.