Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
131 views

How to keep existing text-property decoration while using font-lock?

I tried to use text-property to decorate specific texts as well as automatically color tab characters in a text-mode buffer, but didn't find a way to realize them at the same time. This is my try: ...
yos's user avatar
  • 11
0 votes
1 answer
31 views

Show a highly visual indicator for consecutive newlines

The context I'm editing some text files that contain paragraphs of text. Some of these paragraphs are not correctly separated (paragraphs are separated with two newlines), so I need to manually edit ...
rdrg109's user avatar
  • 408
3 votes
1 answer
51 views

Strange behaviour involving `display` property

I noticed a rather peculiar behavior when using the display property (using emacs 28.2). I tried to boil things down to a minimal example: The code (defun finsert () (insert (propertize ".&...
dmw64's user avatar
  • 177
0 votes
0 answers
36 views

Is there a way to hide link prefixes in org-mode?

For some link types it would be nice to hide the link prefix automatically. This post does this with text properties, but I'd prefer if it was possible to do with something like prettify-symbols or ...
user41177's user avatar
  • 121
1 vote
1 answer
110 views

How to return "string" after changing it's text properties?

When using the propertize function alone on an entire string, it works. How to return a string, after changing its different sections separately with add-face-text-property (probably later repeatedly ...
Herman's user avatar
  • 57
0 votes
1 answer
129 views

Increase text size permanently

How can I set the text size to be larger all the time, starting from when I open the GUI app? I am specifically referring to the text size for the buffer and modeline. I am moderately visually ...
vnbcs's user avatar
  • 1
1 vote
1 answer
70 views

Searching for text fragments by character text properties

The text to be processed has special words marked with a special font. The required text is copied to the clipboard with the mouse (from firefox). The text is pasted into the clipboard emacs("...
uanr81's user avatar
  • 169
2 votes
1 answer
64 views

Text Property of `initial-scratch-message' Not Taking Effect

;;; ~/.emacs.d/init.el (custom-set-variables '(inhibit-startup-screen t) '(initial-scratch-message #("++" 0 2 (face underline)))) I expect to see an ...
shynur's user avatar
  • 5,318
3 votes
1 answer
139 views

Face Text Property: void, nil, default

A string may hold a nil or default face text property, or its face text property is simply unspecified. E.g., #("void nil default" 0 4 ; unspecified () 5 8 ; nil face (...
shynur's user avatar
  • 5,318
0 votes
1 answer
119 views

How to visually indent continuation lines of Org property values to align with the column specified in org-property-format?

Long property values in Org mode property drawers are by default not visually indented in visual-line-mode so as to align with the start column of the property values (as defined in org-property-...
orgtre's user avatar
  • 1,082
1 vote
1 answer
518 views

Change org mode's heading font size (like logseq) in respect of properties

I want my org file can be used in Emacs and logseq interchangeably (in pc Emacs, in mobile logseq) What I want is like logseq to have other properties for the heading text, like :PROPERTIES: :heading: ...
justakidd's user avatar
3 votes
1 answer
60 views

How to reset the colors at the end of the Eshell prompt?

I have the following prompt customization for Eshell: (setq eshell-prompt-function (lambda () (let ((c "#fdd")) (let ((bc (lambda (str) (...
ceving's user avatar
  • 1,368
2 votes
2 answers
88 views

When I do `magit-process-buffer` (`$`) it shows an ellipsis (`…`). What is behind the `ellipsis`?

I wanted to investigate the difference between magit-branch-and-checkout (b c) and magit-branch-spinoff (b s), so I invoked the Magit output buffer with $. I see the following output: 0 git … ...
Alessandro Bertulli's user avatar
0 votes
1 answer
405 views

How to define consult faces generically for minibuffer highlighting that fits with your selected theme?

Background I'm experimenting with different themes to see which one I prefer. I'm giving a theme time to soak, so to speak, by using it for a few weeks. At the moment I'm trying the paganini theme. ...
ldeck's user avatar
  • 225
3 votes
1 answer
115 views

Can Emacs enriched-text be displayed by other applications, browsers?

Emacs enriched-text stores test properties like font and colours that can be quite useful (colours in build logs, RTF-like documents, etc...) Is there any other applications capable of rendering Emacs ...
PRouleau's user avatar
  • 796
0 votes
0 answers
810 views

Different ways to set org-roam-node-display-template

I would like to understand what the differences is between this two variants about setting the value of org-roam-node-display-template. From here: (setq org-roam-node-display-template "${title:*} ...
buhtz's user avatar
  • 729
1 vote
1 answer
42 views

modify text properties in read-only buffer

I am annotating parts of text in an emacs buffer using text properties. The code I am using looks something like this: (set-text-properties beg end nil) ; clear properties (add-face-text-property ...
Ott Toomet's user avatar
1 vote
1 answer
214 views

Face Attributes with Text Properties

Is there any way to have all text with a specific face also receive a specific text-property? As a concrete example, there is a special text-property, line-prefix, that I would like to use for some ...
Xaldew's user avatar
  • 1,231
0 votes
0 answers
24 views

How to change the face of only a text segment in org-agenda?

I am trying to do this on my org-agenda. In the example below, I want that the text [MY PROJECT] has a distinct face (nano-strong, for example) than the next line NEXT My next task. If I have a ...
Maikol Solís's user avatar
0 votes
1 answer
24 views

overwrite: Limit functionality based upon text-properties

In this example, there exists an editable text widget field as follows: quantity: [______] Adding certain custom text-properties -- 'overwrite t -- to the underscores between the square-brackets ...
lawlist's user avatar
  • 19.1k
2 votes
1 answer
132 views

Is there a way to add display annotation to the buffer text so that it's searchable?

Suppose I have a text data file with various data values which the computer can parse easily, but it's not easy to read for a human. In order to make the file easier to read I'd add display only ...
Tom's user avatar
  • 1,260
1 vote
2 answers
622 views

Add invisible text property in org-mode

Suppose I have a function like my-make-invisible, where my-re is some regexp: (defun my-make-invisible () (save-excursion (goto-char (point-min)) (while (re-search-forward my-re nil t) ...
efl's user avatar
  • 93
0 votes
1 answer
106 views

How to replace one face with another for propertized text?

Text with properties can have faces assigned, how can one face be replaced with another? An example use case for this is highlighting some text or it's background. Seeing as Emacs doesn't have the ...
ideasman42's user avatar
  • 8,806
1 vote
1 answer
103 views

After setting syntax-propertize-function, comment is not being fontified with comment face

I'm trying to build a major mode for xwiki, where I'm defining {{{ verbatim }}} as a comment. So far, I've done (eval-when-compile (defconst xwiki-syntax-propertize-rules (syntax-...
ackerleytng's user avatar
0 votes
0 answers
34 views

Why text properties are overridden in this context?

I'm trying to understand why text properties are overridden when creating a list inside a function. I'm wondering if it is expected or a bug. For example, if I create a list of fruits like this, each ...
Kafey's user avatar
  • 1
3 votes
1 answer
302 views

Org-mode question: Evaluating lisp in property

Is there a way to evaluate (during an export) lisp code inside a property? If yes, what’s the syntax? For instance, like in this dummy example: * Header :PROPERTIES: :EXPORT_FILE_NAME: (print “...
Laurent Jacques's user avatar
2 votes
2 answers
225 views

How do you insert propertized text with keymap and mouse-face

I am trying to insert propertized text that is clickable like this: (let ((buf (get-buffer-create "*test*"))) (with-current-buffer buf (read-only-mode -1) (erase-buffer) (org-...
John Kitchin's user avatar
  • 11.9k
3 votes
1 answer
383 views

Why does font-lock-mode work with various programming languages but it does not in text-mode?

The objective is to do text highlighting when TODO and NOTE tokens are found somewhere in a txt file. This is what I have in the .emacs.el file: (add-hook 'text-mode-hook 'font-lock-mode) (setq fixme-...
Thomas Reller's user avatar
2 votes
0 answers
21 views

Fields: how to avoid field-end-position to overlap with next field?

I have a text in the beginning of buffer 901 fifth avenue The word 901 is defined as field "house" and fifth (including space) as field "street". So the text with fields is ...
Ott Toomet's user avatar
1 vote
1 answer
165 views

How can I have the lighter of a minor mode be colored /propertized)?

How can I colorize/propertize the lighter of a minor mode in the mode line?
Gabriele's user avatar
  • 1,608
1 vote
1 answer
38 views

[up/down]case-region: Skip read-only text; Operate on read-write text; No Error

The buffer contains a mixture of text that is read-only (with 'read-only text properties) and read-write (i.e., no 'read-only text properties). I want to [up/down]case-region as to the read-write ...
lawlist's user avatar
  • 19.1k
0 votes
1 answer
99 views

How to insert and right-align text that is not of the default font size?

How to insert and right-align text that is not of the default font size? This doesn't work: (let* ((text "abcd") (len (length text))) (insert "\n" (propertize " ...
jo-so's user avatar
  • 51
0 votes
1 answer
240 views

How to make org-mode style links?

I have a regular expression and an path, e.g. ("[Bb]ackup" . "/home/user/backup.org"). Now I want every substring in the buffer that matches the regexp to look like an org-link ...
tmalsburg's user avatar
  • 2,570
0 votes
0 answers
24 views

Bug? Can get point into the middle of a run of characters with a replacing display spec

I'm implementing a minor mode that "folds" certain strings. It does this by adding a font-lock keywords rule to the buffer, that applies display properties that make it look like it's a ...
zwol's user avatar
  • 272
2 votes
2 answers
148 views

Is there a way to attach hidden/invisible data to a place in text?

I want to keep track of some stuff happening in the buffer, with elisp, and display indicators depending on that stuff. To that end, I need to cache calculated data for different parts of the file, ...
aaa's user avatar
  • 436
5 votes
3 answers
362 views

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,...
Chrisuu's user avatar
  • 179
5 votes
1 answer
329 views

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, ...
zck's user avatar
  • 9,092
1 vote
0 answers
157 views

Problem with font in markdown-mode table

I am using variable-pitch for markdown-mode. Tables use fixed-pitch (markdown-table-face). The table aligns for regular text. It breaks alignment for links. The spaces are also underlined. ...
quasi's user avatar
  • 11
1 vote
0 answers
95 views

Is it possible to add visual padding around a character?

Is it possible to add visual padding around a variable width character (generally too, I suppose)? I've looked into using propertize and buffer-display-table to accomplish this, but every solution ...
theia-jane's user avatar
1 vote
1 answer
88 views

List of hooks inhibited by inhibit-modification-hooks

The documentation of inhibit-modification-hooks states Non-nil means don't run any of the hooks that respond to buffer changes. This affects before-change-functions and after-change-functions, as ...
Tohiko's user avatar
  • 1,649
0 votes
0 answers
192 views

Text properties overriden in org-agenda header

I do load a sexp entry - as a diary- from one of my agenda files which calls a custom function. Everything works fine except that the propertized text using utf glyphs is overriden in the agenda view ...
Muihlinn's user avatar
  • 2,624
2 votes
2 answers
199 views

Why adding the display property does not work on some part of a file, while it works on other parts?

Let's say I have an org file with this content (this is the Org Manual): *** System-wide header arguments #+vindex: org-babel-default-header-args The file is opened normally, highlighted and ...
Tom's user avatar
  • 1,260
5 votes
1 answer
135 views

Why does `insert` not insert colorized text?

For instance, why does (insert #("abc" 0 3 (face (:foreground "red")))) not insert red text?
extremeaxe5's user avatar
1 vote
0 answers
236 views

keymap (overlay / text property): how to create and modify?

I'd like to have certain keymap active when the cursor is in a particular highlighted area. For instance, I would like to bind hl-todo-next to some easy key combination, but only when the cursor is on ...
9000's user avatar
  • 537
0 votes
0 answers
33 views

Is it a bug that isearch goes into text replaced with a display property?

The manual says: Some kinds of display specifications specify something to display instead of the text that has the property. These are called replacing display specifications. Emacs does not ...
Tom's user avatar
  • 1,260
0 votes
1 answer
503 views

Is there a way to add some margin/padding above a line?

For example I have this text in a buffer: aaa bbb ccc and I want it displayed with some spacing above the bbb line: aaa bbb ccc Is there a face or something which I could add to the bbb line, so ...
Tom's user avatar
  • 1,260
4 votes
2 answers
2k views

How to extract text properties into a string?

Is it possible to separate text properties and convert them into a string? For example, with a string with properties: #("gfsd \"fsgfd\" sdfdsgfs \"fsdfs\"s sfg fdg fdffffffffffffff" 0 5 (fontified ...
DataHungry's user avatar
3 votes
1 answer
295 views

How to use font-lock to set other text properties (particularly keymap)?

I'm trying to make a mode where certain strings in the buffer have a special keymap active when the point is inside them. The documentation for font-lock-extra-managed-props and the Elisp info manual ...
gajogacchati's user avatar
1 vote
1 answer
107 views

Set text-property a buffer text automatically

I use Julia REPL, Singular or some other math software in my emacs. In every case, I have a buffer (*julia* or *Singular*,...) synchronise with some running process. The last line of this buffer is ...
MonLau's user avatar
  • 81
2 votes
2 answers
471 views

Org-mode add a property (e.g. effort) on the same row as my task (similar to priority and tags)

I'd like to show an additional property (e.g. EFFORT) on the same line as my tasks, so that it is always visible in both org-mode and agenda view. An example is below. Current display: TODO [#A] ...
Nidstang's user avatar