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
0 votes
0 answers
37 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,183
0 votes
1 answer
28 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,183
1 vote
1 answer
25 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
33 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
45 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
  • 13
0 votes
2 answers
93 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
132 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
0 answers
12 views

compilation-mode re-run error check regexp

I have a buffer running webpack that I started with start-process. I use compilation-mode with a custom compilation-error-regexp-alist. When I first execute webpack things work as expected. However, ...
slaughter98's user avatar
0 votes
1 answer
28 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
143 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
111 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
47 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,183
1 vote
1 answer
71 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,183
1 vote
1 answer
30 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
  • 725
1 vote
1 answer
77 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
49 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
0 votes
0 answers
12 views

highlight all matched lines after open a txt file

I wish to open a txt file, then highlight all patterns from a file list. for example, the list looks like: error.* Error.* warning.* Warning.* BTW, the text file maybe very large, I know highlight-...
beetlej's user avatar
  • 1,066
1 vote
1 answer
20 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
38 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,183
1 vote
1 answer
83 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
265 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
  • 205
0 votes
1 answer
92 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
135 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
66 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,183
0 votes
1 answer
60 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,183
0 votes
1 answer
237 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
79 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,825
1 vote
0 answers
128 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
95 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,238
0 votes
0 answers
26 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,183
1 vote
1 answer
142 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
224 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,190
1 vote
1 answer
137 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
37 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
140 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
85 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
42 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
53 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
60 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
75 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
  • 3,884
1 vote
0 answers
43 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
  • 3,884
1 vote
1 answer
113 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,555
0 votes
0 answers
61 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
244 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
34 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
  • 543
0 votes
1 answer
392 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
84 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
194 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
0 votes
1 answer
74 views

Highlight all words in a line

Is there an easy way to highlight all the words in a line with just one command? I'm trying to write an elisp function to achieve this but my knowledge is pretty rudimentary. So far, I can only move ...
linuxfan's user avatar
  • 199
0 votes
1 answer
155 views

Custom search for text under cursor

I would like to write a custom elisp function that searches for a few variants of unicode text under a cursor and highlights their occurrences in the currently open file. For e.g. if my text is ...
linuxfan's user avatar
  • 199