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
3 votes
1 answer
1k views

Highlight current line and column

Is there a solution to highlight current line and column where the cursor is now? I tried this plugin, but then emacs motion are lagging like hell. I was able to highlight the line (global-hl-line-...
1 vote
1 answer
36 views

How to apply different whitespace settings for different buffer portions?

Does the minor mode whitespace library provide any way to apply different settings to different portions of the same buffer? For example, I might like to highlight `TAB characters in a comment block, ...
3 votes
2 answers
2k views

Disable hl-line-mode at startup

Something turned hl-line-mode on, which is painful to look at with my color theme. I've added this to my .emacs (hl-line-mode -1) (global-hl-line-mode -1) to no avail. I've tried commenting out ...
16 votes
1 answer
684 views

Is there a plugin that does color HTML matching tags like rainbow delimiters?

I would like some plugin which colors html tags with a corresponding color based on which tag they match. For example <div> <p></p></div> <div> and </div> would ...
0 votes
1 answer
78 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 ...
2 votes
1 answer
36 views

Highlight prettified code

is there a way of highlighting a prettified phrase? Something like: (push '("\\qquad " . "⧢") prettify-symbols-alist) (highlight-phrase "⧢" 'shadow) (highlight-...
0 votes
1 answer
35 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 ...
0 votes
1 answer
308 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,...
0 votes
2 answers
172 views

In org-agenda, highlight marked entries

Running Doom Emacs v2.0.9 on Emacs 27.1. I can mark several entries in the agenda buffer and work on all of them together. Is there a way to keep marked entries highlighted? This would give more ...
1 vote
1 answer
64 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 ...
0 votes
1 answer
48 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 ...
0 votes
1 answer
235 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 ...
1 vote
1 answer
658 views

Blinking Paren Mode

I'm trying to get Paren Mode to be a little more clear, cause I can hardly see the other matching pair of parenthesis. Is there any way I could make this blinking yellow?;) I'm in gnome-terminal. Here ...
7 votes
3 answers
6k views

Enable hl-line-mode globally

Running M-x hl-line-mode enables highlighting for the current buffer. How can i set highlighting current line to be enabled in init.el?
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 ...
0 votes
1 answer
193 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 ...
1 vote
4 answers
69 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 ...
2 votes
2 answers
397 views

Highlighting automatically on file open

I would like to highlight lines with a certain pattern whenever the file is opened. Specifically when Journal.org is opened I want to run commands like M-s h l to highlight a set of patterns and ...
0 votes
1 answer
467 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-...
0 votes
0 answers
43 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-...
8 votes
4 answers
667 views

Turn off mouse highlighting in org-agenda

When I am viewing my org-agenda, whatever line I have the mouse point on is highlighted. Since I never act on these lines with the mouse, and since the line where point is is also highlighted, the ...
1 vote
1 answer
37 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 ...
1 vote
1 answer
57 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 ...
1 vote
1 answer
81 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-...
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 ...
2 votes
2 answers
291 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 ...
0 votes
2 answers
119 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 ...
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'; ...
2 votes
2 answers
207 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 ...
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 ...
1 vote
1 answer
35 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 ...
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 ...
0 votes
1 answer
78 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 ...
1 vote
1 answer
169 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 \(\...
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 ...
0 votes
1 answer
42 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 '...
1 vote
1 answer
92 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 ...
0 votes
1 answer
399 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. ...
13 votes
3 answers
6k views

Highlight region

How do I highlight a region and it make it remain highlighted when point moves on. Why would I want that? So I can make important snippets of code stand out when I review it later.
0 votes
1 answer
130 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 ...
1 vote
1 answer
232 views

pdf-tools: customize highlight color

How can I customize pdf-tools' default color for highlighting (from yellow to something else)?
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 ...
0 votes
1 answer
102 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 ...
1 vote
0 answers
153 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 ...
0 votes
1 answer
111 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) ...
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 ...
1 vote
1 answer
185 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 ...
4 votes
2 answers
720 views

Change syntax highlighting when doing ps-print-buffer-with-faces

Hopefully a simple question. I code in c++ in emacs with a dark background and the syntax highlighting is perfect for viewing that way, however when I print on white paper, some of the colours like ...
0 votes
2 answers
306 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 ...
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 ...