an Emacs presentation feature that alters the appearance of a buffer’s text on the screen, without changing the buffer content
Questions tagged [overlays]
70 questions
4
votes
1 answer
Forbid inserting text before and after overlay
Is there any way to forbid insertion of text before and after specific overlay? (I mean on the same line that displays overlay.) Forbid means that either changes cancelled somehow or immediately reverted, or something like this. I'm ready to…

Mark Karpov
- 4,943
- 1
- 26
- 54
3
votes
1 answer
Overlay extending to the end of physical line
I'm trying to use overlay to highlight a whole line but for some reason my overlay stops at the end of the line (past the last character) instead of the end of the physical line (just before fringe). I'm certainly missing something obvious. Using…

Nicolas Rougier
- 517
- 3
- 16
3
votes
0 answers
Can I get emacs to display a grid?
The question is if there's anything like a "background display mode" or maybe a package that once installed would allow a background grid to be displayed in the editor window. The Eclipse IDE for e.g. manages to display thin dotted lines to mark…

Cris6556
- 31
- 2
3
votes
1 answer
Display other text centered
I'd like to find all occurrences of == in a buffer and overlay them with Unicode ≡, keeping width of two chars and centered in the space.
I know about replacing text visual representation:
(put-text-property 1 10 'display "replacement")
about…

Gracjan Polak
- 1,102
- 6
- 21
2
votes
1 answer
Understanding why two apparently different overlay strings are `equal`
I am having trouble understanding why two apparently different overlay strings are equal. The following test results positive -- i.e., t. The colors are different and the :data identification names are different -- i.e., the first name is…

lawlist
- 19,106
- 5
- 38
- 120
2
votes
1 answer
A simple overlay program
My buffer has one line as,
i am sitting on an overlay
Now when i do, M-x some-function-to-hide, i like to hide the text from display, and show three dots as,
...
I am looking forward to have a "hello world" program to understand overlays.

Saravana
- 2,071
- 13
- 32
2
votes
1 answer
remove overlay "if any character within the overlay is changed"
I have this example function:
(defun enumerate-foo ()
(interactive)
(save-excursion
(let ((counter 0))
(goto-char (point-min))
(while (search-forward-regexp "\\" nil t)
(setq counter (1+ counter))
(let* ((b…

Gabriele
- 1,554
- 9
- 21
2
votes
1 answer
How do I order overlays?
I have two overlays that are initially in the same position.
(defvar-local minibuffer-overlay nil)
(defvar-local minibuffer-overlay2 nil)
(defun minibuffer-advice (fn &rest args)
(minibuffer-with-setup-hook #'minibuffer-setup (apply fn…

Plow
- 21
- 3
2
votes
1 answer
Overlay category set properties
From the Elisp manual:
If an overlay has a category property, we call it the category of the overlay. It should be a symbol. The properties of the symbol serve as defaults for the properties of the overlay.
How can I set the properties of the…

Sergey
- 249
- 1
- 8
2
votes
1 answer
Modifying the insertion type of overlay markers after creation
On creation of an overlay it's possible to specify the "insertion type" / advance behavior of the beginning and end markers:
(make-overlay BEG END &optional BUFFER FRONT-ADVANCE REAR-ADVANCE)
It's possible to change the insertion behavior for…

ebpa
- 7,449
- 29
- 55
2
votes
2 answers
Inserting before an after-string overlay
I'm using after-string overlays as in this question to put text on the right hand side of the buffer, like this:
(let ((overlay (make-overlay (point-max) (point-max) (current-buffer))))
(overlay-put overlay 'intangible t)
(overlay-put overlay…

pavpanchekha
- 123
- 3
1
vote
1 answer
Overlay special properties
How can I configure overlay text to be read-only? I know there is a text property read-only, but that's not exactly what I want to use.

dev1223
- 241
- 1
- 10
1
vote
1 answer
Overlay into empty line truncates line, workarounds?
I am using the ov library to display overlays.
If I try to insert an overlay into an empty line, it truncates the line. See the pictures below to understand the problem, and use the code to reproduce it.
(ov.el is just a wrapper using emacs'…

24HrRevengeTherapist
- 533
- 5
- 13
0
votes
2 answers
Removing all overlays with duplicate values
My goal is to delete all duplicate overlay values from a list, and then remove every overlay in the buffer with values equal to each remaining element in the list.
I am having trouble understanding why remove-overlays does not remove every overlay…

lawlist
- 19,106
- 5
- 38
- 120
0
votes
1 answer
overlay and buffer content
I provide web-mode-column-show in web-mode.el to display a column that "connects" the start tag and the end tag.
This column may cross empty lines. In that case I use (move-to-column COL t) (see the t arg) to put the overlay at the right column. The…

fxbois
- 452
- 2
- 8