3

I am on the trip of reading GNU Emacs Lisp Manual, and section 20.6 has the following text:

It is not easy to display a value of point in the middle of a sequence of text that has the ‘display’, ‘composition’ or is invisible. Therefore, after a command finishes and returns to the command loop, if point is within such a sequence, the command loop normally moves point to the edge of the sequence.

I am not a native English speaker, and am confused by the phrase:

text that has the ‘display’, ‘composition’ or is invisible.

Does display and composition apply to text properties or something else? I have not yet started the section 31. Text so I know nothing about these. But I have searched for composition and found in 31.19.4 Properties with Special Meanings there is the following expression:

the properties ‘composition’, ‘display’, ‘invisible’ and ‘intangible’

I am not sure those are the same things. If they are, I think they are not consistent expression, at least the former should be

text that has the ‘display’, ‘composition’ or ‘invisible’ properties.

and should I report a bug of this?

4

(Please state your Emacs version, and name the Info node in question: Adjusting Point.)

You say:

I am not sure those are the same things. If they are, I think they are not consistent expression, at least the former should be

text that has the ‘display’, ‘composition’ or ‘invisible’ properties.

You are exactly right: that is not grammatical English - unclear, indeed. And your correction is correct. Fortunately, this has already been corrected in more recent versions of Emacs.

This was a regression (bug) introduced in Emacs 24 and corrected in Emacs 26. This is what that node says in Emacs 26.1:

Emacs cannot display the cursor when point is in the middle of a sequence of text that has the ‘display’ or ‘composition’ property, or is invisible. Therefore, after a command finishes and returns to the command loop, if point is within such a sequence, the command loop normally moves point to the edge of the sequence.

2

Although you don't pose a straight question, it's hard to give an answer. However, I'll try to give some background.

Text in Emacs can have text properties. They are simply a pair of a key and a value. Some keys have special meaning, for example the key face can specify things like the background and foreground color, make the text italics or underlined etc.

Some other special text properties are:

  • display -- display something else instead of the text. This can stretch across a number of characters, and the replacement text doesn't have to have the same width as the original text.

  • composition -- Similar to display, but considered internal to Emacs. The elisp function compose-region can be used to introduce compositions.

  • invisible -- Hide text.

  • intangible -- A piece of text where the user-visible cursor can't enter.

In Emacs, the point is an integer representing a position between two characters. At the end of the command loop, the user-visible cursor is moved to the location of the point (or rather, the character after the point is rendered in reverse). However, if the point is inside a piece of text with the properties listed above, the cursor is placed before or after the text with the properties.

This mean that elisp program can handle text with these special properties, but user, when doing normal editing, are shielded from them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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