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
1answer
84 views

Highlight matched string in loops

I'm writing a loop to perform some interactive replacements on matched strings: (while (search-forward-regexp "REGEXP" nil t) (read-char "Options:...") ; Replacements... ) and I need the ...
5
votes
2answers
4k 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
1answer
61 views

How to account for tabs in `hl-line-range-function`?

To avoid conflicts with highlighting indentation, I made the highlight line begin after the current indentation. This works well, except when tabs are used as leading white space. How could the my-...
2
votes
1answer
346 views

A compilation-mode conundrum - matching and highlighting

Whilst playing around with compilation-mode for running tests and using HIGHLIGHT faces for failed expectations I've encountered a bit of a conundrum. Question: why does my compilation-errors-regexp-...
0
votes
1answer
160 views

Setting hl-line-mode for programming modes

In my init file I have this: (add-hook 'prog-mode-hook (lambda () (linum-mode 1))) So it shows line numbers only for programming modes. I tried to do the same with hl-line-mode, but it does not work:...
1
vote
1answer
93 views

Highlight with Evil's `:g` command

Evil has a beautiful :s(ubstitute) implementation, which shows the regexp inline as you type: However, the feature doesn't exist for the global command, :g (such that :%g/emacs/... will find the line ...
7
votes
2answers
157 views

How to highlight preceeding space-indentation that isn't rounded to current width?

Is there a way to highlight (set the background color for example) the space before a line, when it's indentation isn't aligned to the current indentation-width? 4 spaces indentation for eg: fn ...
2
votes
2answers
268 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 ...
12
votes
1answer
2k views

How to highlight current line only in selected window?

Q: is there a way to have hl-line-mode highlight the current line only in the selected window? When I have multiple windows showing buffers with hl-line-mode on, it is difficult to tell, at a ...
1
vote
0answers
416 views

Can I override global-hl-line-mode in a buffer/window?

I have the following line turning hl-line-mode on globally in my init file: (global-hl-line-mode) Most of the time, that's how I like it. But sometimes I want to turn it off. I'd hoped that I could ...
0
votes
1answer
252 views

Eval-buffer works, init does not hl-line fix

I have written the following bit of emacs lisp that allows hl-line to extend past end of buffer to the rest of the line. Problem is, this only works if I use (eval-buffer) after start-up and not when ...
5
votes
1answer
929 views

Combine highlight-symbol-mode and hl-line-mode

I want to highlight the current symbol under the cursor as well as the current line, but with different background colors. Combining highlight-symbol-mode and hl-line-mode only highlights the entire ...
0
votes
1answer
92 views

Highlight text based on condition on consecutive lines

How can we visually add separators in log files, based on conditions between consecutive lines? Sample log file: [DEBUG][2016-05-26 10:24:51,714][FileHelper] - [realContextPath] [DEBUG][2016-05-26 ...
1
vote
1answer
2k views

How to automatically highlight all the words same with selection just like Notepad++

For example when I select a word I want the same words to be automatically highlighted just like it in Notepad++: When I select the word "install" in Notepad++ (all other "install" are highlighted"): ...
2
votes
3answers
721 views

Is there a way to underline symbol under cursor?

I want to highlight somehow symbol under cursor, is there a way to customize font for that current symbol? Ideally I want to add underline with some color to it, or maybe change bg color of text, is ...
3
votes
0answers
425 views

Highlight indent guides in org-mode src blocks

is it possible to show indentation guides in org-mode source code blocks? I use highlight-indent-guides-mode for highlighting indention and it does not work in org-mode (I think this is because the ...
0
votes
2answers
78 views

Keep selection on/reselect for multiple query-replace sessions

Following this thread: https://stackoverflow.com/questions/39808820/replacing-on-mouse-selected-area-in-emacsI can highlight an area, and do replace only on this area. Great! Now, I want to do several ...
2
votes
0answers
22 views

Is it possible to highlight the region uniformly across different sizes/fonts?

Highlighting the region when it includes text with different heights/fonts shows gaps and different highlighting heights as follows: Is there any way of highlighting continuously (no gaps) and ...
1
vote
2answers
440 views

Syntax highlighting (in Emacs) for SQL code in log files

How can we highlight SQL code in some log files, with Emacs? Sample log file: [DEBUG][2016-05-26 09:04:51,714][FileHelper] - [realContextPath=[/server.xml]] [DEBUG][2016-05-26 10:24:22,369][...
2
votes
1answer
509 views

Can't change the line-highlight color

I try to set a new hex-color to highlight the current line in the distinguished theme, but this can have no effects. I put this in init.el: ;;highlight current LINE (global-hl-line-mode 1) (set-face-...
6
votes
1answer
122 views

Whitespace highlighting

I've tried whitespace-mode, but I can't configure it the way I want. There are others, but some of them are obsolete and I don't want to try them all. I always indent via tabs and can't stand ...
2
votes
1answer
565 views

change how initial parenthesis is highlighted

I recently installed a programming package, "Haskell mode," and apparently I changed how "initial parenthesis highlighting" works. I'm used to a quick black/white box superimposed on the initial ...
3
votes
1answer
999 views

How can I specify the background color for matching search results?

When I incrementally search for a phrase with C-S, emacs usually highlights all matching results visible in the buffer by giving them a different background color. However, my current theme apparently ...
1
vote
1answer
107 views

How to pass multiple arguments to hc-highlight-chars?

How do you pass arguments to a function using lambda? I have looked through: https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html#Argument-List and https://www.emacswiki.org/...
4
votes
0answers
103 views

Highlight *other* occurrences of symbol

I've found that using the highlight-symbol-mode provided by highlight-symbol works very nicely for highlighting all occurrences of the symbol at point, automatically (without my pressing anything). ...
2
votes
3answers
119 views

What does “^[” represent?

I wrote a terminal output to a plain text file and opened it in Emacs, and I see "^[" here and there. I'd like to change it to tabs in terminal before writing its output to the file, but I don't know ...
1
vote
0answers
160 views

Dynamic background colour for code blocks

Years ago I saw a feature in XCode where nested code blocks (delimited by {}) containing my cursor had graded background shades, with the lightest at my cursor, and the darkest at the outer level. .e....
7
votes
1answer
604 views

Line highlighting canceling out syntax highlighting

I use hl-line-mode and I really like the built-in misterioso theme. However, the way that lines are highlighted with this theme cancels out syntax highlighting or any other properties of the ...
2
votes
1answer
234 views

Highlighting selected region in same buffer, displayed in multiple windows

Q:  I am seeking a proposed modification of simple.el at lines 5251 to 5308 of the master branch relating to highlighting a selected region to achieve a better visual representation when the same ...
7
votes
1answer
2k views

How to highlight specific keywords inside strings/quotes?

I have another syntax highlighting for SQL keywords inside strings (inside quotes) in VIM. It looks like this: Then in Emacs with PHP-mode, everything between quotes (') will be considered as a ...
5
votes
0answers
686 views

ps-print-buffer-with-faces with color-theme'ed dark background

Similar to Change syntax highlighting when doing ps-print-buffer-with-faces I typically use emacs with a dark background, but I'd like to print my buffer onto a white background (i.e. white paper). ...
7
votes
0answers
468 views

How to indicate the currently clocked-in task?

I'm using org-mode's clocking functions to track the hours I spend on projects. Since my main org file is rather large and I scroll through it a lot, it would be great to have a visual cue of the task ...
3
votes
0answers
100 views

Highlighting the changed line in the source file in the resulting pdf using auctex and pdf-tools?

Is it possible to highlight the changed line in the resulting pdf using auctex and pdf-tools. I have this feature enabled in Skim with the following lines in my setup. (add-hook 'LaTeX-mode-hook (...
1
vote
1answer
177 views

Focus/highlight selected text among other

I want to focus/highlight part of text(marked or selected in some other way) as shown in the picture(selected texts stays as it was but other text is dimmed) Maybe there is some way or some package ...
3
votes
0answers
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-...
4
votes
1answer
572 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 ...
5
votes
1answer
322 views

How can I get VolatileHighlights to work with evil-yank, evil-delete, etc?

With the guide on extending Emacs, I discovered the volatile highlights package. But it only works on Emacs operations like kill and yank. I would like to use it with Evil operations like evil-yank ...
1
vote
1answer
91 views

How do I change the background highlight color for a selection I marked with C-Spacebar?

I think that question explains it all. I tried changing highlight face but nothing happened.
7
votes
1answer
93 views

How to highlight text based on regions--not regular expresions

When font-lock-mode is enabled I cannot get custom faces to stick with add-text-properties or set-text-properties. I've looked through libraries like hi-lock.el, but they all seem to be regexp based. ...

1 2
3