Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

3
votes
1answer
22 views

How to re-enable syntax highlighting of code that have been disabled by #if preprocessor statements

Code between #if SYMBOL and #endif is greyed out in cc-mode if the SYMBOL has not been defined within the current file. The project that I´m currently working on has a common code base for Mac and ...
0
votes
1answer
53 views

Using org-mode for writing. Would like text in quotes to be highlighted and also character names

I'm using org-mode to write a novel and I would like to have any text between "quotes" to be a different color, just to be able to easily see when a character is talking. Also, if I could have a ...
0
votes
0answers
19 views

Improper syntax highlighting of LaTeX expressions wrapped by $..$

I have set the following option: (setq org-highlight-latex-and-related '(latex script entities)) Yet: All of these expressions should be syntax highlighted, yet they are exhibiting weird coloring. ...
0
votes
0answers
57 views

Syntax highlighting not working in Emacs (in Python mode)

When I Python-mode I have noticed that occasionally my syntax highlighting is not working. I have noticed this when using the Cyberpunk theme as well as the Tango-Dark theme. Closing and reopening ...
0
votes
0answers
125 views

Export org-mode code blocks with minted style

I am trying to export org-mode source blocks to pdf via Latex and I use minted to get syntax highlighting. My org file looks like this: #+latex_header: \usepackage[utf8]{inputenc} %% For unicode ...
0
votes
1answer
31 views

Dynamic syntax highlighting (font-lock-mode) stops working in emacs 25.3

About 15-20 minutes into using emacs my syntax highlighting stops dynamically updating. Instead any new text just uses the color of the text right before it. Any ideas on how to debug this issue or ...
5
votes
1answer
80 views

Highlight matching quotes

Is it possible to highlight matching quotes as show-paren-mode does with parentheses? The characters I'm looking to highlight are "dumb" quotes, both single (Unicode: apostrophe, U+0027) and double (...
0
votes
0answers
28 views

Fix org-mode agenda highlighting

I'm having an issue with highlighting in Org agenda: Can't make the link and tags Gray when the item is marked as Done. I've tried to play with different properties of the font-lock definition, but ...
2
votes
1answer
37 views

Preventing syntax highlighting in the wrap-prefix

When Emacs wraps long lines, is there a way to prevent the wrap prefix from having syntax highlighting (font-lock) or any such special properties? Specifically, I have the following settings: ;; ...
0
votes
1answer
83 views

org-mode only highlights some source blocks, not all

I write my emacs configuration file in org mode, which works fine, only that org-mode does not highlight some source blocks. I set (setq org-src-fontify-natively t), but this only seems to take ...
0
votes
0answers
21 views

emacs language independent plugin for browsing source code and indentation

I am working with some language for which I dont have all the features that I reuire. I was wondering if there are any plugins where I can customize the variable declaration name(like instead of int ...
0
votes
1answer
42 views

Search based fontification not working

In trying to learn Emacs Lisp on Emacs 25.3.1, I decided to implement a minimal version of fic-mode. Following is the code: (defun todo/pos-in-doc-or-comment-region-p (pos) (memq (get-char-property ...
0
votes
0answers
50 views

Auto highlighting text when paste a new content

This is my first post here. I have Emacs installed at work and at home. The functionality is slightly different when I use highlighting and I cannot figure out which options to change. At work, I ...
2
votes
0answers
129 views

How to syntax highlight Python f-strings so {…} uses regular code colors?

Python 3.6 supports F strings, eg: So: print(f'Test {} me!'.format(2 + 2)) Can be written as: print(f'Test {2 + 2} me!') Which print's Test 4 me, Is there a way to adjust emacs syntax ...
1
vote
2answers
122 views

Detect missing > html emacs web-mode

Hello I am new to Emacs and I am currently using it for web development projects. I am currently using Laravel and VueJS on my development. I search online what is the best major mode for this web ...
0
votes
1answer
29 views

Highlight a buffer with custom programming language syntax

I have files which are not .py but they are python code. I want to highlight them as if they were python files. How can I do that.
0
votes
0answers
21 views

Coloring logfiles interactively [duplicate]

When reading logfiles I like to call highlight-regexp interactively to mark points of interest. However I also do have hl-line-mode enabled (via global-hl-line-mode). I get different behaviour here ...
2
votes
1answer
253 views

org-mode batch export: Missing syntax highlighting

I'm having issues achieving any syntax highlighting in the results of the following command: emacs nix.org --batch -f org-html-export-to-html --kill I know this question has been asked a few times ...
0
votes
1answer
47 views

Why does text surrounded by tildes in org mode turn grey

I noticed that text surrounded by tildes in org-mode turns grey (as least in my colour theme, and I assume the colour changes in others as well). What is that about?
0
votes
0answers
31 views

Using advice-add messes up syntax highlighting

I have the following (stripped down) code in my .emacs: (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (package-initialize) (let ((default-directory (...
1
vote
0answers
33 views

Hide region from syntax highlighting and indentation

c++-mode does not handle the C++17 R"delim()delim" string literals. Is there a way to mark a region (via comments?) so it will not be syntax highlighted and will not confuse the indenter?
2
votes
0answers
159 views

How to highlight graphql template literals (gql) in js(x) files?

Inside of a jsx file, I want to use a gql template literal to define GraphQL queries. Could I in emacs make that section of the jsx file highlight graphql syntax, instead of just showing it as a ...
0
votes
0answers
28 views

Neotree file colour based on permissions

I'd like to be able to see file permissions in neotree in a similar way to ls --color. Is this possible?
2
votes
2answers
248 views

Can I highlight Lisp like this?

I'm using Spacemacs, and I REALLY love how Dr. Racket background highlights parentheses as you move around. I'm wondering if I can do this in Emacs instead of this God forsaken "rainbow delimiters" ...
3
votes
0answers
49 views

how to highlight imported functions in python code?

python-mode or elpy-mode in Emacs only highlight the basic Python library functions. If you work a lot with other libraries like numpy and matplotlib, would be nice to have these functions and ...
1
vote
1answer
95 views

Highlight labels/flet/macrolet definitions in lisp-mode

I found this solution (https://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00322.html, fully cited below), but it isn't working as expected. It highlights only the first definition inside labels/...
0
votes
1answer
38 views

How can I make syntax-propertize skip part of the buffer?

In SPARQL, comments starts with a # and follows to the end of the line. The problem is that URI's, which is a big part of SPARQL, can also contain #, but then they are not the start of a comment. Like ...
0
votes
0answers
46 views

How to highlight fragments of source and example blocks within an org-mode buffer itself

This is a variation on the theme of How to <mark> code fragments in org-export. Here the question is about making portions of src and example blocks stand out (preferably without breaking the ...
0
votes
0answers
15 views

lipsum triggers syntax highliting

I have a fresh install of emacs-nox on Ubuntu 16.04.3 LTS. I opened up an html page that has a bunch of lipsum placeholder text. The first line is of course: Lorem ipsum dolor sit amet, ...
1
vote
2answers
129 views

How to export babel source blocks with syntax highlighting to ODT in org-mode in Emacs 27?

In Emacs 27, babel source blocks do not export syntax highlighting to ODT format. The same org document is exported as expected in Emacs 25. Versions: GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-...
0
votes
1answer
59 views

Default syntax highlighting as in “emacs -Q”

I want to use the syntax highlighting that you get when running emacs -Q. If I run emacs -q, or run Emacs with no ~/.emacs file existent, or not load any custom theme, I get a dark-backgrounded color ...
3
votes
0answers
49 views

How to place asterisks in beginning and end of lines in a marked region?

I use org-mode a a lot and take notes in Org files. I like to sometimes highlight some important text. I colored bold to be red but it doesn't span multiple lines. And I couldn't get that to work ...
1
vote
1answer
99 views

Syntax highlighting inside HTML5 <script> tags

I was curious if there was a way to get highlighting/indentation for any JavaScript that's inside of HTML5 tags? I don't frequently use JavaScript but for a class I'm in we're working with it. I ...
1
vote
1answer
157 views

Is there a way to highlight the (s) expression you are in?

I currently have (paren-set-mode 'paren) in my init.el, and it does a good job of highlighting the area between parentheses. However, I was wondering if there was a way to highlight the expression I ...
1
vote
3answers
604 views

Different colors for questions and answers in org-mode

I'm writing questions and answers in org-mode for project purposes (like meeting notes). A sample looks like this: 1. [X] Equipment name for tags associated with pumps - Discuss Comment: We can ...
0
votes
1answer
111 views

Adding new syntax highlighting for some major modes does not work

My question is similar to this one and that one: I would like to add highlighting of some characters that are not highlighted in some programming modes, like python-mode and fortran-mode. So, ...
0
votes
0answers
45 views

Highlight code in Text mode

I'm a newcomer, I use emacs for less than a week, but I'm already familiar with the basics. I've started to use the Feynman Technique to study and I'm doing my annotations in Text-mode with auto-fill-...
1
vote
0answers
38 views

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)
1
vote
0answers
41 views

How can I activate my syntax-table?

I'm using SampleMode and the ModeTutorial to create my own mode. I have a problem with the syntax table. As I understand, // and # start one-line comments like this: (defvar my-mode-syntax-table (...
1
vote
0answers
44 views

LaTeX highlighting: Dollar expressions across lines

I'm having some trouble with LaTeX math expressions between (single) dollar signs. Specifically, syntax highlighting breaks across lines. Things looks something like this: if there exists $\alpha&...
9
votes
1answer
599 views

Fontify broken links in org-mode

If I create a bad [[file:link]] or an internal [[Link]] that does not exist, I would like to org-mode to fontify this using org-warning face. How can I get this done? Thanks,
0
votes
1answer
88 views

How to highlight other square brackets in custom major mode?

I'm working in a custom major mode, and part of the syntax are the square brackets, like [Hello world] and so they can contain nested square brackets as in [Hello [World]], however I see this problem ...
3
votes
1answer
321 views

Set web-mode engine per directory

I'm hoping this is possible. I work in a variety of environments and languages. Right now it's mostly django and Node.js, but there have been others. What I would like to do is set the web-mode engine ...
0
votes
1answer
323 views

How to activate AUCTeX support for beamer without preamble?

Usually, AUCTeX activates beamer-specific settings (e.g. syntax highlighting) depending on \documentclass. In my LaTeX templates, however, I have separated the preamble from the rest of the document ...
0
votes
1answer
19 views

Apply a background to code with font-lock

I have a command file that uses syntax such as -TAG <ARGS> -TAG- to pass arguments to a sub program. I want to Highlight everything between the opening and closing tags with specific background ...
2
votes
1answer
107 views

How to syntax-colour py.test output?

In compilation-mode (or some similar mode), how can I make the default py.test output be colourized? I'm not talking about clickable links, but about just 'syntax' colouring the various parts of the ...
2
votes
1answer
394 views

Gray-out preprocessor conditionals

Is there a package that will gray out or hide the false portion of a c preprocessor macro? #define ENABLE 1 #if ENABLE bool hide = false; #else bool hide = true; #endif In the above example, ...
3
votes
1answer
68 views

Adding a rule to color text

I'd like to add a rule to supersede a tex mode. I'd like to colour text between two strings over multiple lines in a similar way that the character % is used as a comment character and so colours (...
1
vote
0answers
60 views

Eclim problems not being highlighted/problems not being shown in minibuffer

I know I have eclim setup correctly because everything else works, I.E I can do autocomplete, jump to definition etc. I can even see problems with eclim-problems. However, when I make a syntax error, ...
4
votes
1answer
822 views

How to change syntax highlighting for mode?

I've been able to partially modify how emacs highlights syntax of python files. For example I find highlighting the definition of variable to be disturbing and I've done this '(font-lock-constant-...