Skip to main content

Questions tagged [overlays]

an Emacs presentation feature that alters the appearance of a buffer’s text on the screen, without changing the buffer content

Filter by
Sorted by
Tagged with
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 ...
Krazy Glew's user avatar
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 ...
RNA's user avatar
  • 50
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 ((...
Lhooq's user avatar
  • 230
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 ...
daedsidog's user avatar
  • 189
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 ...
Dan Drake's user avatar
  • 687
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 ...
Zoey Hewll's user avatar
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 ...
daedsidog's user avatar
  • 189
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" ...
daedsidog's user avatar
  • 189
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 ...
unhammer's user avatar
  • 1,231
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\\>&...
Gabriele's user avatar
  • 1,680
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 ...
Nordlöw's user avatar
  • 527
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 ...
shynur's user avatar
  • 5,890
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 ...
oOosys's user avatar
  • 505
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?&...
oOosys's user avatar
  • 505
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 ...
oOosys's user avatar
  • 505
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 ...
Timothy W. Hilton's user avatar
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 ** ...
wychwitch's user avatar
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 ...
Gabriele's user avatar
  • 1,680
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 ...
Tom's user avatar
  • 1,280
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?
user36390's user avatar
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. ...
strange's user avatar
  • 91
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-...
Firmin Martin's user avatar
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 &...
tefkah's user avatar
  • 111
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 ...
tefkah's user avatar
  • 111
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-...
Plow's user avatar
  • 21
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). ...
Nicolas Rougier's user avatar
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'...
Arch Stanton's user avatar
  • 1,777
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 ...
Sergey's user avatar
  • 259
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 ...
BMBM's user avatar
  • 361
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 ...
skyfire's user avatar
  • 107
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 ...
Tohiko's user avatar
  • 1,679
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 ...
Andreas Matthias's user avatar
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.
dev1223's user avatar
  • 233
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 ...
9000's user avatar
  • 549
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 ...
Cardano's user avatar
  • 163
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. ...
Cris6556's user avatar
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 ...
user avatar
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 ...
Navidot's user avatar
  • 792
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 ...
Gabriele's user avatar
  • 1,680
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")) "...
Teemu Leisti's user avatar
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-...
gavenkoa's user avatar
  • 3,552
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
Amos's user avatar
  • 466
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 "." '...
Amos's user avatar
  • 466
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, ...
John Kitchin's user avatar
  • 12.1k
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 ...
theldoria's user avatar
  • 1,855
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) ...
ebpa's user avatar
  • 7,579
2 votes
0 answers
249 views

Equivalent of add-face-text-property for overlays?

add-face-text-property is very convenient for adjusting the face of text based on text properties (Changing Text Properties). Q: Is there an existing equivalent to add-face-text-property to add face ...
ebpa's user avatar
  • 7,579
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):
stardiviner's user avatar
  • 1,958
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-...
stardiviner's user avatar
  • 1,958
0 votes
1 answer
53 views

Create term buffer duplicate with coloring preserved

I want to write function that will create new empty buffer, populates it with current term buffer contents, preserving point and window-start positions, and switch to it right away. Basically I want ...
sandric's user avatar
  • 1,301