1

I'm trying to understand something in the info manual. The description of the variable Info-enable-active-nodes opens more questions than it answers. This is from the Info tool manual (at the bottom of this info node):

"When set to a non-nil value, allows Info to execute Lisp code associated with nodes. The Lisp code is executed when the node is selected. The Lisp code to be executed should follow the node delimiter (the ‘DEL’ character) and an ‘execute: ’ tag, like this:

^_execute: (message "This is an active node!")"

https://www.gnu.org/software/emacs/manual/html_node/info/Emacs-Info-Variables.html

My problems:

  1. Does the textual representation of DEL character look like '^_'? When I do C-q DEL, I get '^?' instead. At least this is how it looks inside emacs.

  2. I tried to text search 'execute:' within manual files to find examples of the above, but I failed to find any. Maybe the above talks about the source code of texInfo files and not what i see within the info program?

I will be glad if you can answer any of this.

Maybe I don't get the terminology control-characters. But the info tutorials referred to them a few times. They seem to correspond to the ASCII control characters: https://en.wikipedia.org/wiki/Control_character For example C-q ESC produces '^[' and C-q RET produces '^M' which agrees with this wiki page. Although copying those "characters" from emacs and pasting them elsewhere results in something completely different.

I wasn't able to find any information about the'^_' character anywhere. This info entry is the only place where I've seen it.

1
  • Only one question per post, please.
    – Drew
    Commented Apr 8 at 14:43

1 Answer 1

3

The way control characters work dates back to the old teletypes. The control key on the teletype keyboard simply masked off the top bits of the character to produce the corresponding control character. So if you wanted to attract the attention of the operator on the other end of the line, you would ring the bell by typing C-g. If you look at an ASCII chart (try running ascii at the command prompt, or man ascii otherwise, or look it up on wikipedia or something), you’ll see that g is 0x67 and G is 0x47. Mask off the top three bits of either one and you get 0x07, which is the ASCII BEL character.

But one character doesn’t fit this scheme very well, and that is the DEL character. The old teletypes could record information to paper tape by punching a set of holes in it. However, once you have punched a character into the paper tape, the delete character cannot go back and unpunch all those holes. The best it can do is obscure what character used to be there by punching every single hole. Thus, the DEL character is character number 127 in ASCII, with all 7 bits set. This means that it’s not actually a control character! You can’t get to it by masking off the bits of some other character, because that will leave some bits unset. Properly speaking, C-?, C-_, and C-DEL should all map to character 0x1F, the Unit Separator.

Using either C-? or C-_ to represent DEL is thus a special case, and not everyone uses the same special case. It might be fascinating to delve into the exact history of how everyone handles this case, but I don’t have any special insight to offer. It just doesn’t come up very often, and usually you can guess based on context what the author meant. In this case NickD has discovered that Info uses the Unit Separator character to separate nodes, not DEL. Thus the prose is wrong and the example is correct. See Appendix F Info Format Specification of the GNU Texinfo Manual for all of the details.

And finally, although it is not ideal to ask multiple questions at a time here on Stack Exchange, the answer to your second question is that Info doesn’t print out the executed lisp, so you’ll never see it except in the source code. Even then I suspect it is quite rare.

9
  • 1
    I think the Info page misspeaks: C-_ does map to 0x1F and that is what is used in all the Info manuals to delimit nodes. If I type C-q C-_ C-q C-? into a text file and look at it with od -c I get 1f 7f for the two characters. And if I look at an Info file, I can find 1f before every node: C-u C-x = on it is unequivocal. I think somebody goofed on the Info page when they said that DEL is the node delimiter: they should have said Unit Separator instead.
    – NickD
    Commented Apr 8 at 0:46
  • 1
    Oh, what a tangled web :-)
    – NickD
    Commented Apr 8 at 1:51
  • 1
    Thank you for your insightful explanation of the history behind control characters. Commented Apr 8 at 17:31
  • 1
    I found something related in this manual node: gnu.org/software/emacs/manual/html_node/efaq/Basic-keys.html "C-? (aka DEL) is ASCII code 127. It is a misnomer to call C-? a “control” key, since 127 has both bits 5 and 6 turned ON. Also, on very few keyboards does C-? generate ASCII code 127." That seems also weird. Also according to what you said in your answer, i t would make sense to say that DEL isn't a control character, yet C-? is. Commented Apr 9 at 17:16
  • 1
    Thank you for clarification. Your knowledge is vast. When i originally asked the question, i had the feeling that my misunderstanding probably touches on some deeper topic. So your answer was great. Commented Apr 10 at 17:09

Your Answer

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

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