Questions tagged [text-properties]

is for any text property, such as `face`, that Emacs can associate with text. Emacs moves, copies, or displays the text using the text properties, which are specified as name-value pairs along with the text in a special Lisp structure. Emacs uses a special read and print syntax for text properties.

The Text Properties menu item under the Edit menu of Emacs by default has several options for displaying or editing . The manual describes the various , including face and some special properties, margins, and stickiness and inheritance characteristics that are not in the menu.

Strings with text properties have a special read and print syntax. Emacs uses a property-list (plist for short) for text properties. See the category property for setting default properties. See the fields for specifying properties by strings, and intervals for when to use (overlay properties) instead of text properties. See searching for locating (text or overlay) property changes in the buffer.

139 questions
28
votes
1 answer

How to strip decorations (text properties) from a string?

By a "decorated string" I mean something like #("foo" 0 4 (fontified t face font-lock-function-name-face)) ...as opposed to the "plain string" "foo" (If Elisp code reads a string directly from a buffer, it may be decorated like this.) What's the…
kjo
  • 3,145
  • 14
  • 42
28
votes
2 answers

What are overlays for, and how do they differ from text properties?

The manual states: You can use overlays to alter the appearance of a buffer's text on the screen, for the sake of presentation features. From its name, it suggests it can be used to create “layers” over existing text, but the description above…
13
votes
2 answers

Can I use an image in my modeline lighter?

My modeline is cluttered. Can I make it display pictures instead of mode names? I could use unicode Emoji (such as for Python or for Coq), but some machines on which I use my Emacs config do not have the right fonts pre-installed (ideally, I'd…
Clément
  • 3,924
  • 1
  • 22
  • 37
12
votes
5 answers

Ways to unobtrusively vary text rendering?

I'm writing an emacs extension for use with speech recognition, and I'm looking for help with a particular feature. Some words the speech recognizer (Dragon) recognizes consistently poorly -- it doesn't matter how many times you train it, it will…
Joseph Garvin
  • 2,061
  • 8
  • 21
10
votes
2 answers

Strip text properties in savehist

I save the kill-ring using the savehist package. savehist saves the kill ring with text-properties intact. Unfortunately, this is a problem. I have a rather large emacs config, and I use a lot of highlighting. Here is the first element of my…
PythonNut
  • 10,243
  • 2
  • 29
  • 75
10
votes
1 answer

Prevent inserting text at the beginning of a buffer that starts with read-only text

I'm extending an existing Emacs package and I want to make a part of the buffer not editable (read only). In fact, I want to make only one line in the middle of the buffer editable and I use the following snippet for achieving…
Andrii Tykhonov
  • 452
  • 2
  • 13
9
votes
2 answers

Temporary text in window location with no text to propertize/overlay?

Q: how do I temporarily show text in a window at screen locations with no text to propertize/overlay? I'm familiar with the basic idea behind text properties and overlays (see also this thread), have used them a few times, but am by no means adept…
Dan
  • 32,584
  • 6
  • 98
  • 168
9
votes
1 answer

Are there any libraries for input fields in Emacs?

Quite a few Emacs modes use (something like) forms: the customization interface is one of them, the Message mode (read: its header part) is another one; there are more of them, unfortunately not always very similar. By a "form" I mean here a buffer…
mbork
  • 1,647
  • 1
  • 13
  • 23
7
votes
1 answer

How does AucTeX display superscripts?

latex-mode is has a nice display of superscripts and subscripts. Not only are they reduced in size, but they are respectively raised and lowered a bit relative to the current line. Q: How can I make part of the text in a line look like a…
Malabarba
  • 22,878
  • 6
  • 78
  • 163
6
votes
2 answers

How to set the glyph of a unicode character?

I would like to set the glyph of a certain unicode character. Specifically, I would like the glyph § (SECTION SIGN) to represent the unicode character U+202A (LEFT-TO-RIGHT EMBEDDING), a normally non-visible character, in the main buffer. However,…
Evan Aad
  • 1,461
  • 1
  • 14
  • 29
6
votes
1 answer

undo-tree -- history file without text-properties

Q:  How can I modify undo-tree-save-history to remove the text-properties from all entries that make their way into the saved history file? In a related thread, @PythonNut was on a very similar quest to remove text-properties from entries that make…
lawlist
  • 18,826
  • 5
  • 37
  • 118
6
votes
3 answers

masking text in an org-mode buffer

Sometimes I want parts of the text within an org buffer to be 'masked' by default. The reason is that I may want to look at that file with someone looking over my shoulder, where they should be able to see most of what's there, but some information…
Dave Braze
  • 161
  • 4
5
votes
2 answers

How to apply overlay or text properties to text matching a regexp?

I want to transform a text file with many lines : | refXXXXX | here useful text, first sentence, last word. | | refYYYYY | First word, second sentence. | into : here useful text, first sentence, last word. First word, second…
JeanMichel
  • 355
  • 2
  • 10
5
votes
3 answers

Removing unwanted colors (and other decorations) from yanked text

I have a Java properties file that, when opened with Emacs, shows up in a color coded form, as below: I also have a simple text file. When I yank something from the properties file into the text file, the font colors are yanked along with the…
Chrisuu
  • 169
  • 6
5
votes
1 answer

Why does mousing over one button also highlight adjacent buttons?

I'm using some buttons, and want to arrange them in a row. That is, some will be directly next to each other. I don't want whitespace between them. This is easy enough to do: However, when I do this, mousing over either of them highlights both. I…
zck
  • 8,984
  • 2
  • 31
  • 65
1
2 3
9 10