Questions tagged [syntax-highlighting]

is the feature of displaying text, especially source code, in different colors and fonts according to the meaning of different terms.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

Emacs >27.1: How to highlight in different colors for variables inside `fstring` in python-mode

I am using python-mode which colors the parameters. When I concatinate strings the variable color is represented as different: On the other hand, if I use fstring, the variable is not represented as ...
0
votes
0answers
52 views

Unable to activate expl3 syntax highlighting for LaTeX mode

I have read that expl3 highlighting is already integrated in AUCTeX (see here), but I haven't been able to make it effective. Being fairly new to emacs, after browsing the web for solutions I still ...
0
votes
0answers
19 views

No PHP blade block syntax highlight or indentation

I am creating an app with Laravel using Emacs and I can't get Emacs to highlight syntax using web-mode in blade with neither @php @endphp blocks or using <?php ?> blocks. I saw this question ...
1
vote
1answer
26 views

How to change #+begin_comment … #+end_comment background and text color?

When I have this code: #+begin_comment So this is my comment's body text. I want it to have these features: 1. text color will be yellow 2. background color will be blue 3. text will be cursive #+...
0
votes
0answers
19 views

Avoid font lock in special strings

Consider the following python code: As you see the content of expr is font locked as string. How can I emacs make to format it as if expr=''' and ''' were gone: Other strings should be font locked ...
0
votes
1answer
67 views

Syntax Highlighting of Common Lisp User-Defined Macros in Emacs

I would like to start writing a few simple Domain Specific Languages in Common Lisp and would like the names of macros I define to be highlighted as if they were Common Lisp functions or macros in ...
1
vote
1answer
23 views

Syntax highlighting in C++ fails in user-defined literals

The C++11 way to separate the parts of a user-defined numeric (integer or floating point) literal with ' as e.g. in 1'500ms stalls parsing for syntax highlighting. I couldn't find anything on the net ...
1
vote
1answer
47 views

How to change syntax highlight inside #if 0?

In cc-mode, I want a way set all syntax highlight colours to slightly more desaturated versions when inside a #if 0 ... #endif block. If that would be troublesome/hard to maintain (having to set all ...
0
votes
0answers
14 views

How to get asm file highlighting to be to be similar to vi?

Here I have a random (invalid, but shows the important syntax highlighting) asm file as in Vim: Emacs seems to be highlighing incorrectly (? there are many flavours of asm but I've never seen ...
1
vote
1answer
57 views

Emacs font-highlighting does not work on my own files?

I have an issue that probably has been asked and answered before but I am unable to find it because I seem to be using the wrong search terms for it. However, the issue I have is that if I make my own ...
0
votes
2answers
145 views

elpy flymake does not recognize local .pylintrc

I have the following in the project root for my .pylintrc: [FORMAT] # Maximum number of characters on a single line. max-line-length=1000 # String used as indentation unit. This is usually " ...
0
votes
1answer
28 views

Make mark color overlap highlight symbol at point

I use auto-highlight-symbol-mode package to auto highlight symbol on point. I found it annoying when I mark a text because the symbol highlight overlaps on my marked text, so I don't see if I marked ...
0
votes
0answers
60 views

Unable to install ElPy: “eval-buffer: Cannot open load file: No such file or directory, s”

I followed the instructions to install ElPy from source: I cloned the repo to ~/code/elpy and added these to the Emacs initialization file: (add-to-list 'load-path "~/code/elpy") (load "...
0
votes
0answers
31 views

Error and warning highlighting

I use Emacs to write LISP and Python code. I have tried NetBeans and Eclipse before, which had the advantage of parsing the buffer and highlighting problems, e.g. if one function or symbol is not ...
1
vote
0answers
129 views

How to properly highlight a code block (in-buffer) when inside of another block/environment?

The issue is that my source code blocks, BEGIN_src ... END_src, are not properly highlighted when within another block, e. g., BEGIN_proof ... END_proof. Here is a picture of how that looks like: ...
1
vote
1answer
28 views

Syntax highlighting of keywords only if following builtin

I'm writing a syntax highlighting mode and am trying to highlight certain arguments, only if they are following a specific word. I've written a MWE to show my problem: (defvar mwe-builtin-list '("...
2
votes
2answers
355 views

font-lock-add-keywords is not working

So I've been trying to add custom syntax highlighting for digits using font-lock-add-keywords and regex. I've been looking at all the Emacs resources to do this, and while I have been able to ...
1
vote
1answer
117 views

C++ mode, indendation confusion

Today I realized something odd that bothers me. Here is a little example of a function I wrote. I am using armadillo, but that is is unimportant. Here, the indentation looks just fine. float GetE0() { ...
0
votes
0answers
52 views

GraphQL and Styled Components syntax highlighting in web-mode?

How can I add syntax highlighting for GraphQL and Styled Components in web-mode? Right now it doesn't work, which makes programming much less convenient, and it's surprisingly difficult to find the ...
0
votes
1answer
34 views

Color words based on gramatical categories?

Does there exist any package to color words based on grammatical class? (Noun, verb, adjective... etc). Something like rainbow-mode for grammar instead of colors.
6
votes
1answer
83 views

minor mode to display long integers?

I have to deal with long integers frequently, typically 9+ digits, and all of the digits matter (so scientific notation doesn't help me. Is there a minor mode that helps make it easier to visually ...
2
votes
1answer
51 views

Altering syntax highlighting for a particular expression

In c-mode, I would like all lines beginning with exec sql to have that expression grey and the rest of the line in the default face. How might I achieve that?
0
votes
0answers
48 views

Static function highlighting/locking in C++

In C++ mode, I am finding that static functions are only highlighted when written in the form static ReturnType function_name(args), and not when written ReturnType static function_name(args). Image: ...
1
vote
1answer
52 views

Syntax coloring: Unable to color special syntax

I am writing a mode to color a few common syntax in a symbolic language called FORM. I am a new user of emacs and I took the help of this website to write down the following code. I modified the ...
1
vote
0answers
40 views

Modifying syntax so as to grey out the non-source part of an org file

I thought a nice alternative to (org-edit-special) (which becomes cumbersome with many small blocks), and to tangling-and-untangling (which is incompatible with noweb references), might be simply to ...
3
votes
1answer
139 views

Is there a standard mode for .ini files?

After looking for a mode for .ini files, I found ini-mode via MELPA, but upon installing it in Emacs 26, there was a message about it being an obsolete mode. What are the alternatives? In my limited ...
1
vote
1answer
35 views

show-paren-mode or similar to highlight multi-character parentheses

In latex, "parentheses" such as \(\), $$ and \[\] are constantly used. Is there a way to customize show-paren-mode or is there some other mode to highlight these multi-character parentheses in latex-...
1
vote
1answer
36 views

Alternative text for keywords?

font-lock-add-keywords lets users highlight keywords. Can you also specify an alternative text? For example, in C source code, besides using a special face, we may wish to visualize ! as not, &&...
4
votes
2answers
183 views

Is it possible to selectively disable syntax highlighting rules?

The context : GNU Emacs 26.1 working on Debian 10.3 currently editing YAML files (Ansible code) Here's how my code looks like : As you can see, the syntax highlighting is puzzled by the odd number ...
0
votes
1answer
138 views

Highlight syntax of function names and their arguments in custom mode

I'm trying to create a major mode that handles the following syntax: function someName(value1, value2) # some contents end function I'm using the following to highlight the keywords function,...
0
votes
0answers
93 views

disable syntax highlight on inactive windows

I got the following code for highlighting inactive and active windows with different background color. How do I make so that inactive windows have no syntax highlighting, only the active window has? ...
10
votes
1answer
882 views

How to highlight in different colors for variables inside `fstring` on python-mode

I am using python-mode which colors the parameters. When I concatinate strings the variable color is represented as different: On the other hand, if I use fstring, the variable is not represented as ...
0
votes
1answer
120 views

Automatically highlight elements in an XML buffer

I spend a lot of time in XML buffers using nxml-mode (Emacs 26). Out of hundreds of XML elements, I am only interested in one or two. How can I have Emacs always show the XML elements I'm interested ...
0
votes
0answers
128 views

Emacs font style and colorisation

I am used to Emacs under Windows 10 and trying to switch to Ubuntu. My Windows 10 Emacs font is M-x describe-font: name (opened by): -outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-...
2
votes
1answer
708 views

How does org-mode implement syntax highlighting for code blocks?

How does org-mode implement syntax highlighting for code blocks? More specifically, for a C file, does it use cc-mode or does it have its own algorithm? For example, if I have this org file: test.org: ...
4
votes
1answer
59 views

How to highlight digit groups of 3 in numerals?

I find it very useful to visually distinguish every 3 digit group of numbers in source code so that I can read it. For example something if I see 1000000 it is fairly easy to see that this is 1M ...
2
votes
0answers
34 views

Different face for checked-off items in plain lists?

Q: how can I get a different face for checked-off items in org plain lists? I use org-mode's plain lists a lot: - [X] item 1 - [ ] item 2 - [ ] item 3 - [ ] item 4, with a whole lot of text that ...
0
votes
0answers
242 views

syntax highlighting in ranger

I've been playing around with ranger in emacs and I'm really liking it for browsing new codebases. I would like to get syntax highlighting working, as it does when using ranger in a terminal. I'm not ...
2
votes
1answer
92 views

AUCTeX fontification for any command: overkill?

Reading the AUCTeX manual I see that it is possible to add expressions to those one wants to highlight in a .tex file. There are also many specific suggestions around for how to add specific commands ...
2
votes
0answers
540 views

Markdown and Latex highlighting (font lock) in R Markdown file

I am using polymode to edit rmarkdown files. Exporting to e.g. pdf is super simple and works very well. R code chunks are also properly highlighted. But: I do quite often use latex code inside (r)...
0
votes
1answer
96 views

font-lock keywords and syntax-table mutually interfering

I would like to define something that font-locks a bit like a new sort of string-literal/comment. I might write: (font-lock-add-keywords 'emacs-lisp-mode (list '("<<.*>>" 0 'my-custom-...
1
vote
1answer
111 views

Scilab-mode syntax highlighting

I'm trying to install (and run) scilab-mode, but the syntax highlighting does not work when I open .sci or .sce file. I use the exact configuration described in the scilab.el package. https://www....
1
vote
1answer
1k views

How to disable semantic highlighting in lsp-mode?

Language server mode has a variable for semantic highlighting lsp-ht, I would like to disable all syntax highlighting in lsp-mode. Is this possible? (setq lsp-enable-links nil) (setq lsp-enable-...
1
vote
0answers
87 views

sh-mode: Correctly indent and highlight inside bash's subshell substitution $()?

I noticed that bash will correctly apply syntax highlighting inside the subshell substitution in VALUE="Hello $(echo World)." But when creating a more complicated value, e.g. VALUE="Hello $( ...
2
votes
1answer
29 views

Show @ symbol in different color in clojure mode

I want to show @ symbols (meaning dereference) in red in clojure-mode. How do I do that?
1
vote
1answer
140 views

Improving org-block-begin-line, splitting in several faces

The face org-block-begin-line allows to customize the first line of the following block #+BEGIN_SRC lang :var arg1=1 arg2=2 ... #+END_SRC However, I would like to customize the faces within the line,...
0
votes
0answers
27 views

Refresh code indentation over a region

I have this: #!/usr/bin/bash while read f; do { #Try echo "$f" } || { # Catch printf "error" } done < "${1:-/dev/stdin}"; And I would like this in one ...
1
vote
0answers
144 views

How to highlight references of local functions and variables?

I want my local function names (those declared in the current file and picked by font-lock-function-name-face) and my variable names (font-lock-variable-name-face) to be highlighted across the whole ...
0
votes
2answers
62 views

Chinese Text commentary syntax highlighting

Plain text inherited from ctext.org contain the following syntax: {{...}} 堯年十六,以唐侯升為天子,遂以為號。{{《論語·泰伯》疏 案曰:堯典正義云:徧檢書傳無帝堯卽位之年,則此似非伏生大傳文,疑出書緯。}} 辯章百姓。{{見《毛詩·采菽》正義、《史記·五帝紀》索隱、《後漢書》注}} ...
2
votes
1answer
44 views

Are comment style flags insufficient to separate SQL comments?

I am trying to understand why SQL mode accepts -* as a comment block start. In sql.el, I read: (defvar sql-mode-syntax-table (let ((table (make-syntax-table))) ;; C-style comments /**/ ... ...

1
2 3 4 5