Questions tagged [font-lock]

Font-lock is a minor mode of GNU Emacs. It assigns faces locally to a particular buffer.

Font Lock mode is a minor mode of GNU Emacs. Font Lock mode is:

always local to a particular buffer, which assigns faces to (or fontifies) the text in the buffer. Each buffer's major mode tells Font Lock mode which text to fontify; for instance, programming language modes fontify syntactically relevant constructs like comments, strings, and function names.

Font Lock mode is enabled by default. To toggle it in the current buffer, type M-x font-lock-mode. A positive numeric argument unconditionally enables Font Lock mode, and a negative or zero argument disables it.

[section 14.12 Gnu Emacs Manual]

111 questions
1
vote
1 answer

Overriding emacs org-mode faces

I am trying to override the default syntax highlighting in org-mode and org-agenda-mode buffers. To clarify my intention: my current reason for doing this is to highlight headings (or parts of headings) based on their tags. The built-in variable…
user3219877
1
vote
1 answer

different font-lock scheme for "special" comments in emacs derived-mode

I am defining an Emacs major mode by deriving from prog-mode. Font-locking works except for one thing: I'd like to highlight a special comment type that contains special linker directives, using a font different from the one used for regular…
user52366
  • 1,035
  • 1
  • 10
  • 21
1
vote
1 answer

Emacs Specifying Rules for font-lock

I'm putting the parsing techniques I'm learning into practice. I'm trying to write a programming mode in Emacs,so I can take advantage of syntax highlighting and the like. unfortunately, font-lock isn't working. Searching on Google and following the…
Haden Pike
  • 259
  • 2
  • 7
1
vote
1 answer

Emacs font-lock function name in definitions with more than one parameter

(Emacs 23.4.1) I'm looking for a solution to where the color of the function name turn to regular text whenever the function parameterlist is equal to, or above 2 arguments. So functions that takes 0 or 1 argument, have the nice color which I've…
user3855483
1
vote
1 answer

How do I set Org Mode Agenda default formatting in Emacs?

I want the Org Mode Agenda to have very different formatting to the rest of Emacs. How can I make this happen every time the Agenda is generated? (N.b. this is not the same question as this because Org Mode specifies different faces depending on how…
Conor
  • 1,509
  • 2
  • 20
  • 28
1
vote
2 answers

Remove all fontlock faces (except flyspell-incorrect flyspell-duplicate)

To shave off approximately .3 seconds from the run-time of a custom function that is set with a 2 second idle timer (which custom function combs through the buffer), I disable font-lock mode with (font-lock-mode -1). The side effect is that my…
lawlist
  • 13,099
  • 3
  • 49
  • 158
1
vote
3 answers

Match string ignoring comments

How might I match a string for Font Lock fontification while ignoring comments within that string? e.g. (setq str-regexp "^foobar$" comment-regexp "/\\*[^*]*\\*/") Now how might I return match data to fontify the string "foobar" in the…
rnkn
  • 495
  • 3
  • 13
1
vote
1 answer

Is it possible to change the display of words into symbols in Vim?

I recently ran across a post on Jay Fields' blog, in which Jay uses emacs' font-lock mode to change the display of words into symbols. Is there any way to do this in Vim?
Jamie Schembri
  • 6,047
  • 4
  • 25
  • 37
1
vote
1 answer

How do I change the font of a parameter to a function in elisp / latex-mode

I know I can add keywords to font-lock-mode using font-lock-add-keywords. However, I would like to change the font color of the parameter to a latex function. In Latex mode, if I write: \cite{Somebody1999} then Somebody1999 will be highlighted in…
pnj
  • 1,349
  • 1
  • 11
  • 14
1
vote
1 answer

Regexp to highlight differently 1 asterisk, versus 2 asterisks, versus 3 astericks

I'm looking for a regexp to highlight differently one asterisk (e.g., red), and two asterisks (e.g., blue), and three asterisks (yellow). I have a working example of three (3) all together. Defining just one, however, would affect everything…
lawlist
  • 13,099
  • 3
  • 49
  • 158
1
vote
1 answer

syntaxic highlighting in emacs with LaTeX French quotation

I would like to have syntaxic highlighting in emacs when I write LaTeX code in French. More precisely, I want emacs to recognize when I'm quoting someone. In english when you write : ``quote'' Emacs reconizes that it's a quotation and put "quote"…
ppr
  • 685
  • 7
  • 24
1
vote
2 answers

Highlight opening and closing tags xhtml in emacs just like notepad++

I really find convenient with the feature of highlighting opening and closing tag in XHTML document in Notepad++. Is there any equivalent feature in Emacs? I am using Emacs 24.3.1
Truong Ha
  • 10,468
  • 11
  • 40
  • 45
1
vote
1 answer

word boundary in Emacs font lock keywords

The following code fails to highlight 23's in 23-23 if pasted and evaluated in the scratch buffer, but not if done in a text buffer. ;; Example 1 '(1234 23 23-23 end) (progn (font-lock-add-keywords nil `(("\\b23\\b" …
Jisang Yoo
  • 3,670
  • 20
  • 31
1
vote
1 answer

Conflict between font-lock and string literal coloring in Emacs

In Emacs, I am writing a PHP file that mixes both PHP and non-PHP code, which will be in C++ mode. I would like the PHP code to be highlighted with a link-pink background in order to make it stand out visually. To do this, I use the font-lock…
Jon Claus
  • 2,862
  • 4
  • 22
  • 33
1
vote
1 answer

Emacs syntax highlight of nested backquote forms in lisp buffers

Is there a package for it? If not, what should I look into to create a package for it? This package should highlight levels of parts of a nested backquote form in different colors. `(a :i-am-in-level-1 `(a :i-in-level-2 ,(a :level-1 `(a…
Jisang Yoo
  • 3,670
  • 20
  • 31