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.

249 questions
5
votes
2 answers

Highlight as Comment if character is not present

I am writing a simple syntax highlighting mode for a special file type. In the syntax, a line is only valid if it starts with a & character, otherwise it is treated as a comment (basically it is an 'inverse' comment). Is there a way of implementing…
WJahn
  • 153
  • 5
3
votes
2 answers

How do I turn off highlighting for $...$ in tex-mode

I like to use highlighting when working with emacs. But I don't like some of the default settings. I recently installed emacs 24.4 on my iMac. I really don't like all the highlighting of math expressions such as $5$ I used to do something…
A.Ellett
  • 131
  • 2
2
votes
0 answers

Which mode to get syntax-highlighting for commit messages (svn/git/hg... etc)

When editing commit messages for various version control, what should I enable to get syntax highlighting? (without having to use some heavy mode for all other VCS operations like magit)
ideasman42
  • 8,786
  • 1
  • 32
  • 114
2
votes
2 answers

Is it possible to create case-insensitive keywords in a generic-mode?

I am very new to Emacs and I am discovering the functionality of "generic-mode" for the first time. I am trying to add a generic-mode to create basic syntax highlighting for an obscure programming language that I use. It's very simple: ;; BEGIN…
Q''
  • 173
  • 7
1
vote
1 answer

Defining color for "$"variable in bash

Unfortunately the dollar-sign in variable-names in the syntax-highlight is in the theme I use defined as 'default' face instead of being part of the variable name. Is there a way to customize this?
OsunSeyi
  • 31
  • 4
1
vote
1 answer

What libraries are available for working with Apache Avro IDL?

I noticed there is no library listed in melpa for highlighting and working with Apache Avro IDL schemata. Is there any, or else how people who work with Avro have set up their configuration to ease their work?
dmvianna
  • 392
  • 4
  • 21
1
vote
1 answer

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 the colours manually), just setting all the text…
Luctins
  • 120
  • 7
1
vote
1 answer

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 file, which I have my bash-aliases in e.i…
1
vote
1 answer

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, && as and, etc.
Eleno
  • 1,448
  • 11
  • 17
1
vote
1 answer

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.emacswiki.org/emacs/scilab.el Any help?
user25789
1
vote
0 answers

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 buffer. Currently font-lock-function-name-face and…
xged
  • 151
  • 4
1
vote
0 answers

Modified mode highlighting

I want to modify the highlighting of my JS files, so that every line starting with LOG gets shown in a different color.1 I wrote the following (require 'font-core) (font-lock-mode 1) (defface mg-js-pseudo-face '((t (:background "White"))) "..."…
maaartinus
  • 235
  • 1
  • 7
1
vote
1 answer

Emacs Live Syntax/Error Highlighting

How do I make Emacs give me live feedback on my syntax? Like, after I finish typing a line of code, how can I make it so that Emacs tells me if that line isn't using correct syntax? For example, in Eclipse, it'll tell you before you compile when a…
CodeSammich
  • 365
  • 3
  • 12
0
votes
1 answer

Enable highlighting symbols in prog-mode

I am trying to configure highlight-symbol mode with use-package for only programming modes. This is what I have: (use-package highlight-symbol :ensure t :init (add-hook 'prog-mode-hook (lambda() …
Swarnendu Biswas
  • 1,450
  • 1
  • 12
  • 25