Questions tagged [overlays]
an Emacs presentation feature that alters the appearance of a buffer’s text on the screen, without changing the buffer content
78 questions
0
votes
1
answer
124
views
Redirect compilation mode hyperlink to external tool
I have a working compilation error matcher, that contains the path to a file. The compilation buffer correctly adds a hyperlink to that file and I can open it in emacs. However, the file in question ...
3
votes
1
answer
128
views
Change overlaid text of an outline header?
Q: how do I add a new outline header regexp but change the overlaid text?
I often write presentations with Beamer in LaTeX. As such, there are a lot of frame (ie, "slide") environments:
\begin{...
5
votes
1
answer
254
views
How can I detect when emacs is dictation safe?
Longer version of question: how can I efficiently detect and indicate when emacs is dictation safe?
By "dictation safe", I really mean "when can type random printable ASCII characters ...
0
votes
0
answers
15
views
running of overlay modification-hooks stop at the middle of undo: is this a bug?
Here is a simpilified example: with following code, I create a buffer/file and run M-x buffer-overlay to insert text and put on overlay with modification-hooks, and then run M-x serialize-to-buffer to ...
0
votes
0
answers
33
views
Show keymap with the help of cursor-sensor-functions
I'm experimenting with cursor-sensor-functions
(defun test-overlay-cursor (&rest args)
(message "%S" args)
(funcall-interactively 'which-key-show-keymap 'global-map))
(let ((...
1
vote
1
answer
27
views
Preserving/correcting outdated saved overlays in edited file via diff?
I want to create overlays and save them to a file to be loaded later:
One issue I ran into is that sometimes if I forget to save the overlays, I load overlays whose position is outdated for the ...
1
vote
1
answer
41
views
add overlay to org mode entry headline that still shows when subtree is collapsed
I have an org mode entry/heading and want to add an overlay that appends some text to it (the text comes from the entry properties, but that's not necessary for this question). I'd like the overlay to ...
0
votes
1
answer
104
views
Image overlay: how to change the relative image insert position within the buffer text?
I have just managed to create an overlay being a small image (the Emacs logo) which purpose is to be shown instead of a special single character in the buffer text:
I would like to place this image ...
0
votes
1
answer
138
views
Image overlay: what does `defimage` do and how to make it work as expected?
After solving the problem with appropriate height of placement of the as overlay inserted image ( see here "Image overlay: how to change the relative image insert position within the buffer text?&...
1
vote
2
answers
30
views
set face for text in izones
I'm trying to roll my own version of multiple-cursors using zones, and I'm currently a bit stuck at actually displaying the zones on the screen. I can easily set a zone as my current region by setting ...
1
vote
1
answer
209
views
Make highlight-changes-mode untrack specific changes
I recently discovered highlight-changes-mode and I added it to my proofs-typesetting setup (LaTeX). I usually make some temporary changes to my buffer that I like not to be tracked (highlighted) when ...
0
votes
0
answers
14
views
Making BEFORE-STRING of overlay appear at line start no matter what
I want to create overlay labels in text that appear at the start of a line, like so:
When selecting from the start of a newline, this looks good. But when I select the overlay's start to be from the ...
0
votes
1
answer
21
views
Overlay BEFORE-STRING face affected by comment face
I am propertizing the before-string of an overlay with
(overlay-put instruction
'before-string (propertize (concat label "\n") ; label = "REFERENCE"
...
1
vote
0
answers
16
views
Is it possible to show current long (truncated) line as overlay or similar?
Sometimes I edit stuff with long lines, e.g. org tables to be exported, and I'd like to see the whole line without truncation, but I don't want to untruncate all lines (in a table, that makes it hard ...
4
votes
1
answer
177
views
overlay makes text unreadable -- where does it come from? Overlay face is "undefined face"
There is an overlay making parts of stack traces in my inferior python buffers very difficult to read:
I would like to change the coloring of the yellow part of line 42. If I run M-x describe-char ...
0
votes
1
answer
38
views
Cannot get rid of isearch overlays
The following code
(defun nordlow/isearch-previous-symbol-at-point ()
(interactive)
(cond ((eq last-command 'nordlow/isearch-previous-symbol-at-point)
(isearch-repeat-backward)) ;avoid ...
2
votes
1
answer
175
views
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-...
2
votes
1
answer
100
views
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 "\\<foo\\>&...
2
votes
0
answers
77
views
Delete Text by Fading It
I once saw a feature in Vim where, when I delete the text to the left of the cursor, the text is indeed deleted. However, a faint impression of the text remains in its original place, as shown in the ...
0
votes
0
answers
42
views
Image overlay: how to write code scaling overlay images along with the text?
See the code in my other question which places an image overlay above a special character:
The problem with this code is that the images don't get scaled along with the text:
How to write code ...
1
vote
0
answers
61
views
Is there any way (built-in or not) to display a sub-tree as a top level tree when narrowed?
When I narrow to a subheading in emacs, I would love for it to be displayed as if it was the top level as opposed to it staying the level it actually is.
For example consider this tree
* Heading 1
** ...
2
votes
2
answers
219
views
Background color of matching parentheses overlays the region background color
I have set lime as a background color for my region, and I also have enabled to highlight matching parens using (show-paren-mode 1).
The issue I have is that when I exactly select the contents ...
0
votes
2
answers
38
views
Make mouse-3 behave like mouse-1 (mouse-set-point) only for overlays
I defined this keymap:
(defvar my-custom-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mouse-1] #'my-function1)
(define-key map [mouse-3] #'my-function2)
map)
"Custom ...
10
votes
2
answers
1k
views
How to display overlay like this screencast?
How to make an overlay in Emacs like the following (maybe it's not overlay, I don't know, it's from company-coq inline-docs):
2
votes
1
answer
143
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 ...
5
votes
1
answer
869
views
display eldoc help info behind point
I have the following code to replace default eldoc display function:
(defun my-eldoc-display-message-momentary (format-string &rest args)
"Display eldoc message near point."
(when format-...
0
votes
0
answers
113
views
change font style in Latexpreview in org mode
The latexpreview image is very poor. I increased the font size but it is still not good. I want to make the writings in the image bold or use a better font. How can I do that?
2
votes
0
answers
156
views
GUI emacs: What Face Defines Overlay for Truncated Lines in Margin?
I am currently using the emacs GUI.
I have a custom theme defined for a particular buffer, but when the text runs over the line, an overlay takes over (presumably handling truncation) in the margins. ...
0
votes
1
answer
81
views
org-fill-paragraph doesn't comply with org-list-allow-alphabetical
Given that (setq org-list-allow-alphabetical t).
Consider the following example, where | stands for the point:
1. |Lorem Ipsum
1. Lorem Ipsum
1. |Lorem Ipsum
a. Lorem Ipsum
While org-fill-...
1
vote
0
answers
168
views
Why can't I create a full-width overlay and display in the margins at the same time?
I want to create an overlay (or, to avoid X-Y problems, a multicolored, multilayered, visually distinct line at an arbitrary position that cannot be removed, like a page-break) that spans the entire &...
2
votes
1
answer
130
views
How to insert overlay every n visual/screen lines?
I want to insert an overlay at the beginning of every 40th or so visual/screen, to generate a WYSIWYG looking page-break overlay like so:
At the moment this is done by font-locking the line-feed ...
3
votes
1
answer
290
views
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). ...
0
votes
0
answers
98
views
Pulse text inserted, changed or removed when undoing and redoing
I heard about pulse.el recently on r/emacs and thought of using it to highlight the chunks of text inserted, removed or changed on undoing and redoing edits, just like evil-goggles used to do:
There'...
2
votes
1
answer
81
views
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 ...
3
votes
2
answers
264
views
Move point inside of image overlay
I'm trying to create a realtime/WYSIWYG editor for LaTeX fragments -- the general idea is that at each move of point / edit of the fragment, the overlay should update to reflect the newly changed ...
0
votes
0
answers
84
views
modify existing overlay
How do I modify an existing overlay, more specifically, in spacemacs I have
and the overlays are covering the all the parenthesis. Note that the overlays move depending on what inner set of ...
1
vote
1
answer
101
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 ...
0
votes
0
answers
153
views
Are there different tooltip mechanisms?
I experience some weird behavior with tooltips:
(progn
(let* ((start (point))
(end (progn (insert "test") (point)))
(ov (make-overlay start end)))
(overlay-put ov 'help-echo
...
1
vote
1
answer
86
views
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.
1
vote
0
answers
260
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 ...
3
votes
0
answers
358
views
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. ...
2
votes
2
answers
607
views
How to make an invisible overlay displaying other text clickable
I've been trying to add the ability to unfold with mouse by clicking on ellipsis in my json-mode, but after considerable time spent experimenting and looking through the Elisp manual, I can't figure ...
0
votes
0
answers
186
views
Increase minubuffer font size for quail mode completion
I am trying to increase the font size of the text overlay displayed in the minibuffer when using quail completion without success so far.
Does anyone have any idea how to achieve this?
EDIT:
I was ...
2
votes
1
answer
242
views
how to fix an overlay at end-of-line highlighting too much?
I have added the following definitions to my initialization file in order to make the mark show up as a red highlight:
(defface mmv-face
'((t :inherit default :background "red"))
"...
5
votes
0
answers
132
views
Copy buffer content verbatim
Emacs uses overlays / prettify-symbols-mode / etc which modify how data is displayed to user.
I like to copy visible content as I see it. For example I aligned columns in CSV file with M-x csv-align-...
2
votes
0
answers
215
views
How can I make hl-line mode not override the color of rainbow-mode? [duplicate]
Is there an non-intrusive way to do this?
I've made a fork of rainbow-mode that uses overlay instead of text properties, which solves this :)
https://github.com/amosbird/rainbow-mode
4
votes
1
answer
807
views
How can I eliminate the side effect of left margin?
I've set a left margin like this:
(set-window-margins (get-buffer-window) 20 0)
(let ((gutter-sep (concat (make-string (- (car (window-margins (get-buffer-window))) 2) ? ) "+")))
(propertize "." '...
1
vote
0
answers
84
views
How do you create a custom undo?
I have a package that creates overlays as annotations. Part of the functionality is to delete annotations too. It turns out neither of these seems to be undoable. I.e. if you add an overlay to text, ...
2
votes
2
answers
801
views
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-...
2
votes
1
answer
87
views
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)
...