Questions tagged [highlighting]

is for changes to fonts and colors for highlighting text. Emacs uses highlighting extensively to set apart portions of visible text in a buffer. Highlighting can also apply to dynamic text during search and replace operations, syntax highlighting in programming modes, and for alerts for errors during debugging.

Filter by
Sorted by
Tagged with
1 vote
1 answer
54 views

Jump/Goto next highlighted symbol in lsp-mode

Lsp-mode has a function lsp-document-highlight bound by default to s-l a h which picks the symbol at point and highlights all (semantic) occurrences. Is there a goto-next-highlight. I checked the ...
Harald's user avatar
  • 242
0 votes
1 answer
47 views

Temporary highlighting of regexp

In Emacs 26 I had this working macro: (defmacro with-temp-highlights (&rest body) "It executes BODY, undoing, upon completion, all the highlighters used, but leaving pre-existing ...
Gabriele Nicolardi's user avatar
0 votes
0 answers
21 views

Highlighted text not visible on Emacs manuals not visible on HPC

I installed GNU Emacs on a headless High-Performance-Cluster (Ubuntu 18.04). My emacs configuration is: init.el. I installed emacs using conda: conda install -c conda-forge emacs The same ...
Raghav Arora's user avatar
1 vote
4 answers
64 views

search or occur for text with a certain face, or character properties?

I'm interested in finding zero-width spaces and similar "glyphless" characters in my buffer -- and more generally, text that's highlighted or has a certain face. I can show zero-width spaces ...
Dan Drake's user avatar
  • 593
0 votes
0 answers
40 views

User defined outline-minor-mode-highlight

I want to give the user the ability to change the outline highlighting setting. After taking the user option I call the intern function to use the appropriate symbol required by outline-minor-mode-...
Dilna's user avatar
  • 1
0 votes
1 answer
33 views

Changing highlighting of headings interactively

I would like to have the ability to interactively change the highlighting settings using a single function (named outline-activate). How can I adapt it for the task described? (defun outline-activate ...
Dilna's user avatar
  • 1
1 vote
1 answer
33 views

bookmark+ highlighting problem

I am trying to use bookmark+, but I am unable to get the highlighting as I wish (or, maybe, as I wrongly expect?): When I change the default highlight of a bookmark, I only see the purple flag, but ...
scfrank's user avatar
  • 13
0 votes
1 answer
34 views

Is there a package that would allow me to colorize non-alphanumeric characters (the symbols)?

By non-alphanumeric characters, it includes the period, comma, colon, semi-colon, plus/minus sign, star sign, slashes, percentage sign, and any other that are normally used for mathematical operators ...
nougako's user avatar
  • 137
1 vote
1 answer
54 views

how to config highlight style in spacemacs as sublimetext did?

I used highlight-symbol to show all selected text in spacemacs, but that looks not very good as sublime text did as following pic: My question is that if spacemacs could use box style without color ...
qbai's user avatar
  • 23
0 votes
2 answers
115 views

Why doesn’t highlight-regexp highlight my regexp?

When I evaluate (highlight-regexp "todo" "hi-blue") in a buffer, “todo” gets highlighted in that buffer. I’d like “todo” to be highlighted in any buffer, always. I’ve tried putting ...
Philippe-André Lorin's user avatar
2 votes
2 answers
226 views

How to set parentheses matching colors

When using parentheses matching, how can I set the color of the parenthesis my cursor is actually on? I found I can use the below set-face-attribute to control the color of the other parenthesis, but ...
gdonald's user avatar
  • 167
0 votes
1 answer
29 views

Highlight code between specified tags

how can I write extension for existing major mode, e.g. dart-mode to highlight block of codes. For example: // $done> import 'dart:async'; import 'dart:convert'; import 'dart:io'; import 'dart:ui'; ...
Andrey's user avatar
  • 13
0 votes
1 answer
221 views

hl-line-mode -- how to highlight only the text on the current line (don't highlight leading and trailing whitespace)?

I'd like to highlight only the text in between the leading and trailing whitespace on each line. For example, I'd only like to highlight the region marked by the double arrow <--> for the ...
user39615's user avatar
2 votes
2 answers
180 views

Disable Fontification in Org-Mode while Keeping Color Highlighting

I would like to ask a question about org-mode and font-lock-mode. I just started using Emacs and, since I am not a programmer, I use it mostly for writing and handling texts. And, I am quite ...
bman25's user avatar
  • 43
0 votes
1 answer
50 views

Using general comment character used in programming languages

I am using highlight-regexp with a regexp pattern that includes the elisp comment characters ;;. How can I extend the pattern so that it adequately handle the general comment character for each ...
Dilna's user avatar
  • 1
1 vote
1 answer
79 views

Using a sub-expression for `highlight-regexp`

I have made a face to highlight elisp comments starting with ;; [ using hi-lock. My intention is to only colour the expression [text] using SUBEXP. (highlight-regexp "^;; \\[.+\\].+$" 'face-...
Dilna's user avatar
  • 1
1 vote
1 answer
33 views

How do I highlight using multiple faces with library `highlight.el`?

I want to highlight in multiple colors using highlight.el. I'm trying to use: (highlight-regexp regexp1) followed by hlt-next-face But it seems to be consistently using the same face. How do I get ...
Att Righ's user avatar
  • 775
1 vote
1 answer
83 views

show binary value in different colors

Is there a simple way to show in emacs within an self-made-mode which use emacs font-lock-mode a binary value like "0b10010010" in different colors like the zero in lite gray and the one in ...
Lars's user avatar
  • 113
0 votes
1 answer
71 views

Highlight query-replace-regexp results while searching

I am terrible at remembering regular expression syntax. When replacing in by buffer with a regexp, I would like Emacs to highlight the possible matches while I am typing the regexp, so that I can see ...
Arthur Azevedo De Amorim's user avatar
1 vote
1 answer
21 views

Is it necessary to save buffers as files in order to use command highlight-compare-buffer?

Based on a nice comment from @Drew on this previous question, I tried to use the command highlight-compare-buffers (although he did not mention exactly this comment). My first attempt was actually ...
Pedro Delfino's user avatar
0 votes
1 answer
41 views

Highlighting repetitions of comment character for prog-mode

I have the following code that highlights lines made from semicolons in the case of lisp-interaction-mode. (defface special-comment '((t (:background "orange")))) (font-lock-add-keywords '...
Dilna's user avatar
  • 1
1 vote
1 answer
90 views

Incremental search line highlight

When running incremental search by pressing C-s repeatedly (isearch-repeat-forward) is there a way to highlight, in addition to the matching string, the line where that string is found? I would like ...
unvarnished's user avatar
0 votes
1 answer
359 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
0 votes
1 answer
124 views

pdf-tools: set a number of colors readily available for highlighting

When reading a pdf file, I use different colors for highlighting; for example to distinguish different ideas. Is it possible to have a number of colors readily available when using pdf-tools. That is ...
user25482's user avatar
1 vote
1 answer
207 views

pdf-tools: customize highlight color

How can I customize pdf-tools' default color for highlighting (from yellow to something else)?
user25482's user avatar
0 votes
1 answer
71 views

Using highlight-sexp as buffer local

Have been using highlight-sexp using hooks (add-hook 'lisp-mode-hook 'highlight-sexp-mode) (add-hook 'emacs-lisp-mode-hook 'highlight-sexp-mode) Would like to enable highlight-sexp-mode as buffer ...
Dilna's user avatar
  • 1
0 votes
1 answer
69 views

Highlighting by context

Are there tools for highlighting by context? When writing my configuration code, I constantly get into the difficulty of figuring out where in the different block of code I am modifying. Looking for ...
Dilna's user avatar
  • 1
0 votes
1 answer
293 views

Highlight single character at column 80

I am trying to highlight just a single character on a line when it is on the 80th column mark. I am using Doom Emacs, which did it on in on a previous Emacs version, but I updated my operating system,...
Kyuvi's user avatar
  • 101
0 votes
1 answer
97 views

How to highlight invisible text when using `visible-mode`?

I sometime use visible-mode to show hidden elements in buffers. For example, I have org-hide-emphasis-markersset to t, but I sometimes want to see them. This works very well with visible-mode, however ...
theldoria's user avatar
  • 1,835
1 vote
0 answers
150 views

Magit ediff range in a pretty way?

I need to investigate a project, with a patch made by a former student of my university. He made a series of commits on a repo, and I need to see what additions he made. I got the list of files ...
Alessandro Bertulli's user avatar
0 votes
1 answer
108 views

How can I apply black color for bold text in highlighted region?

I am using dracula-theme. Only change I did is adding following line under (faces ': (faces '(;; default / basic faces (region :background ,dracula-yellow :foreground ,dracula-black :extend t) ...
alper's user avatar
  • 1,340
0 votes
0 answers
28 views

Cycle through show-paren-style and highlight-sexp

I have the following code, rk-bracemk-companion changes the show-paren-style ("parenthesis", "expression", "mixed"), whereas rk-emph-symbolic-expressions enables ...
Dilna's user avatar
  • 1
1 vote
1 answer
177 views

How to customize the magit-todo display

I use Emacs to write documentation, and a lot of times my files end up with some internal markup that looks like this: [TK: Where is the event handler defined?] in-line with the text. (“TK” is writer ...
Elf Sternberg's user avatar
0 votes
2 answers
293 views

What are those red underline-like characters and how to find them?

I have a simple text file which has contents from the web copied into it and today I found a line where there was something like a red underline character (_) at some location. I guess it shows an ...
Tom's user avatar
  • 1,230
1 vote
1 answer
163 views

How can I make `font-latex-sedate-face` have precedence over `font-latex-math-face`?

In LaTeX mode, the face font-latex-sedate-face highlights commands of the form \foo which are not known by AUCTeX. I'd like commands of the form \foo which appear inside a math environment such as \(\...
Tera's user avatar
  • 41
0 votes
1 answer
39 views

How to disable momentary highlighting of a match by ggtags?

When I call gtags-find-tag-dwim, matches item will be highlighted for about one second. Like this: Please note that ggtags-highlight-tag has absolutely nothing to do with this highlight, I believe ...
dongli si's user avatar
2 votes
1 answer
161 views

How to disable momentary highlighting of a match by xref and ggtags?

When I call gtags-find-tag-dwim, matches item will be highlighted for about one second. When I call xref-pop-marker-stack, matches item will be highlighted for about 0.2 second. like this: -----------...
dongli si's user avatar
2 votes
1 answer
86 views

Highlight words appearing once within a block

I want to highlight every identifier (a sequence of characters matching a certain regexp or, even better, having the default face) appearing once within a block of code (a piece of arbitrary text ...
effectfully's user avatar
0 votes
0 answers
47 views

How to highlight certain symbols only inside math environment?

I'd like to have certain math symbols highlighted. I checked AUCTeX manual but there does not seem to be a built-in way to do that. They are not folded forms or anything, but the real glyphs, which I ...
Tera's user avatar
  • 41
1 vote
0 answers
61 views

Conditional Formatting foreground and background when highlighting selected text

This is a follow-up question to: Interchange Foreground and Background Colors when highlighting selected text. How can I do some conditional formatting? For example I do not want inverse-video if the ...
Inspired_Blue's user avatar
1 vote
1 answer
68 views

Interchange Foreground and Background Colors when highlighting selected text

I use something like this to control the background color of my selected text: (region ((t (:background ,green)) (t :inverse-video t))) However some foreground colors don't go well with ...
Inspired_Blue's user avatar
2 votes
1 answer
81 views

How can I restore "hlt-highlight" after reopening a file?

Linux Mint 20.2 Emacs 27.1 package: highlight ver. 20210318.2248 I want to highlight specific region. So here my steps: 1. hlt-choose-default-face 2. Select region M-x hlt-highlight And here result....
a_subscriber's user avatar
  • 4,010
1 vote
0 answers
44 views

Can't highlighting only one word exact on the one sentence

Given: Linux Mint 20.2, Emacs 27.2 Q: E.g. "Hello, how are you?" Suppose whole sentence has foreground color = white. And I want to change color (e.g to red) of only word "Hello". ...
a_subscriber's user avatar
  • 4,010
1 vote
1 answer
127 views

How to move to the next highlight?

How can I jump to the next beginning of a string highlighted by a command such as highlight-regexp or highlight-lines-matching-regexp?
Arch Stanton's user avatar
  • 1,625
0 votes
0 answers
62 views

How to clear bookmark highlighting

A few months back my Emacs started to highlight bookmarks. I build and run from master, using the Homebrew emacs-head package. However even after I remove bookmarks, the highlighting remains. I ...
Marius Kjeldahl's user avatar
5 votes
1 answer
266 views

Highlight rectangle and non-rectangle selection at the same time

By default, Emacs highlights the non-rectangular selection; alternatively, you can use (rectangle-mark-mode) to show the rectangular selection. Instead, I'd like to always show both, by highlighting ...
Cactus's user avatar
  • 165
0 votes
1 answer
36 views

highlight occurences for thing under point also for substrings

With point over a word, pressing C-u C-s highlights this word and any identical words. How can I make this work for substring search as well, i.e. if highlighting the word house, occurrences of houses ...
CD86's user avatar
  • 563
0 votes
1 answer
457 views

Certain keywords show font weight of bold

The syntax highlighting in Emacs is not great so I installed tree-sitter plugin to improve it and configured it like this, ;; Tree sitter (use-package! tree-sitter :config (require 'tree-sitter-...
apoorv569's user avatar
  • 113
0 votes
1 answer
90 views

How to stop Emacs from highlighting Linux Tab characters?

So I opened a c++ script made in Xubuntu and every tab character was highlighted with grey. That doesn't happen when I open scripts made on Windows. How do I stop Emacs from highlighting them, it's ...
Philip's user avatar
  • 3
1 vote
1 answer
253 views

Color settings with helm

I use helm a lot. I have a problem setting colors. In my init.el I have (require 'helm) (require 'helm-config) ;; change active line color (set-face-attribute 'helm-selection nil :...
PinkCollins's user avatar