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
0 answers
29 views

Doom Emacs AsciiDoc syntax highlighting?

I want to write AsciiDoc documents in Emacs (more specifically Doom Emacs) with syntax highlighting. I've tried: Adding (package! adoc-mode) to the bottom of ~/.doom.d/packages.el . Adding adoc-mode ...
1 vote
1 answer
33 views

Highlight car of each sexpr in source

All the syntax highlighting suggestions I've managed to find so far are keyword driven. I'm reading data written in s-expressions that doesn't have keywords, but the car of each list is still somewhat ...
0 votes
0 answers
26 views

Org-reveal not working with highlight.js

Here is my .org file #+REVEAL_THEME: Moon #+REVEAL_PLUGINS: (highlight) #+begin_src html <h2 class="headline1> Hello </h2> #+end_src The highlighting is not ...
  • 101
1 vote
0 answers
36 views

How to apply changes from a major mode that I'm currently creating?

I'm writing a syntax highlighting mode for emacs, and wondering if there is a way to improve my workflow. Currently I do this: make edits to mymode.el restart emacs open mymode.el eval buffer open a ...
1 vote
1 answer
84 views

Ligatures without font-lock

Is there a way to enable ligatures in Emacs other than using font-lock? I'm asking because font-lock is slow on reasonably large buffers. After having read it https://www.reddit.com/r/emacs/comments/...
  • 467
1 vote
1 answer
72 views

Why can't I install package yaml-mode on my Emacs via use-package declaration?

I am trying to install a package called yaml-mode on my Emacs. Basically, a syntax highlighting for .yaml files. My current syntax highlighters do not have support for yaml files, apparently. Hence, I ...
0 votes
1 answer
93 views

How to set a specific background color for a certain string in text?

I would like to highlight each occurence of some word e.g. "covid" in a text when the file is loaded. It will be in org files but even global scope for all files is not a problem. So, I can ...
  • 35
4 votes
0 answers
61 views

org-mode - how to ignore link syntax inside of src blocks?

The link syntax [[link]] is parsed as an org-link inside of a source block, as shown in the code and figure below, where my mouse if placed on top of [[2]]. #+begin_src emacs-lisp [[2]] #+end_src ...
  • 3,483
1 vote
0 answers
106 views

Unusual behavior in Python syntax highlighting

I have Emacs 28.1 installed via brew running on macOS Monterey. No further customization. When I open a very basic Python program, I get unusual syntax highlighting. See below for a screenshot; you ...
0 votes
0 answers
13 views

Diff SQL in Literal Examples

I need to store a diff of two SQL files in an org-mode note as a Literal Example. Part of that diff looks like this: +INSERT INTO `foo` VALUES (64,99,1,4,64); -INSERT INTO `bar` VALUES (1,1,'2022-04-...
1 vote
1 answer
30 views

How do I match comments where the start and the end character are the same?

I have a programming language I want to make a major mode for where both the start and the end characters of a comment are the same. Specifically #. # This is a comment # As you can see it can match ...
0 votes
2 answers
141 views

How to modify org headline font face based on WIP/TODO etc?

I have DOING defined as a DONE state. (Odd, I know.) I'm trying to get the font face for the DOING headline to appear the same as DONE. How can I do this? (Using Doom.)
  • 173
1 vote
0 answers
244 views

Changes in python.el do not take place in python-mode

I'm facing the same problem as OP in this question: How can I make python-mode correctly indent python's match statement?. A quote from the OP: "Python 3.10 added a match statement. When I ...
0 votes
0 answers
15 views

Make all colors black in the current buffer, without losing other face attributes

I want to disable colors for the current buffer, but preserve boldness, etc. (Which disabling font-lock-mode does not preserve.) The underlying reason is that sometimes the syntax highlighter goes ...
  • 728
0 votes
1 answer
48 views

mode variant in org-mode code-block

I would like to add a quote from an rpm-spec file fragment in one of my org-mode documentation, e.g.: #+begin_src rpm-spec Name: foo Version: 1.0.0 BuildRequires: bar %description foo the ...
  • 375
1 vote
0 answers
55 views

How to properly use modify-syntax-entry flags to syntax highlight comments in Lua?

I made my own Lua major mode about a month back. There is one thing that is still not working: highlighting comments. At first, I simply added ("--.*" . font-lock-comment-face) to lua-font-...
  • 37
2 votes
1 answer
111 views

Meaning of colon before text in orgmode

I was working with orgmode when I typed colon follwed by a space and text. : text and the whole line got highlighted in blue (in my theme). What does this mean in Org mode?
0 votes
1 answer
23 views

latex-mode keywords string highlight based on patterns

In LaTeX I use a number of custom commands for which I created a keyword highlight in init.el. For example, I have a command to write argmax/argmin and therefore I have the following in in my init.el ;...
0 votes
0 answers
29 views

org-mode babel code color highlight doesn't work in a large file

I am enjoying the org-mode babel code color highlight. I write HTML, Perl, css and js in a single file and the coloring works fine with each languages' mode. This is the org file with some codes. #...
0 votes
1 answer
135 views

Limited Python syntax highlighting when running Emacs via Terminal app on MacOS

On my Macbook, I get different syntax highlighting for Python depending on how I launch Emacs. If I launch via the MacOS app (installed via Homebrew) I get full syntax highlighting (first screenshot) ...
0 votes
1 answer
59 views

How to auto run hide-ifdef-mode's hide-ifdefs command

I've been using hide-ifdef-mode with c-mode buffers for a while, but it is quite tedious to have to manually run hide-ifdefs (C-c @ h) every time a block of code containing preprocessors changes. Is ...
  • 118
1 vote
1 answer
34 views

Point to bound variables in scope

So, Dr. Racket has a very interesting feature where you can see all occurrences of a bound variable if you hover it: Is there a way to do something similar in Emacs? I'm currently editing C++ code. ...
  • 123
0 votes
2 answers
59 views

Is this syntax parse possible with Emacs' regex expressions?

I'm trying to write a small new mode for some input files to a specific computational physics program. I'm doing it the define-derived-mode way, and was specifying the syntax highlighting by setting ...
  • 113
1 vote
1 answer
49 views

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?
0 votes
0 answers
38 views

How to highlight certain symbols only inside math environment?

I'd like to have certain math symbols highlighted. I checked AUCTeX manual but there does not seem to be a built-in way to do that. They are not folded forms or anything, but the real glyphs, which I ...
  • 31
1 vote
1 answer
57 views

After setting syntax-propertize-function, comment is not being fontified with comment face

I'm trying to build a major mode for xwiki, where I'm defining {{{ verbatim }}} as a comment. So far, I've done (eval-when-compile (defconst xwiki-syntax-propertize-rules (syntax-...
1 vote
1 answer
42 views

Trouble with f90 major mode, maltreatment of highlighting in continuation lines

My emacs (version 27.1 on a work computer where I do not have administrative privileges) seems strange. I am editing a *.f90 file and the major mode is correctly identified as f90. But the ...
1 vote
1 answer
72 views

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 ...
  • 370
0 votes
1 answer
55 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 ...
  • 1,114
1 vote
1 answer
36 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 #+...
  • 43
1 vote
1 answer
225 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
1 answer
48 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
1 answer
178 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 ...
  • 118
1 vote
1 answer
200 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
2 answers
268 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
1 answer
96 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 ...
  • 672
0 votes
0 answers
163 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 "...
  • 1,611
0 votes
0 answers
93 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,611
2 votes
0 answers
249 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: ...
  • 857
1 vote
1 answer
47 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 '("...
  • 331
2 votes
2 answers
1k 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 ...
  • 41
1 vote
1 answer
190 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() { ...
  • 71
0 votes
0 answers
86 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
1 answer
60 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.
  • 7,819
6 votes
1 answer
112 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
1 answer
53 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?
  • 3,044
0 votes
0 answers
76 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
1 answer
91 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
0 answers
52 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,044
3 votes
1 answer
375 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 ...
  • 143

1
2 3 4 5