3

Since the update, a certain style of formatting code is highlighted with font-lock-warning-face:

How do I turn off this behavior?

enter image description here

Malabarba
  • 22,878
  • 6
  • 78
  • 163
abo-abo
  • 13,943
  • 1
  • 29
  • 43
  • Could it be the theme? I was tweaking [`zop-to-char`](https://github.com/thierryvolpiatto/zop-to-char) yesterday and I don't see that `nil` highlighted in `font-lock-warning-face`: [My screenshot](http://i.imgur.com/nI7ZwX7.png?1). I am also on 24.4. The difference I guess is that I am using `zenburn` theme. And it does highlight `font-lock-warning-face` at places I expect. – Kaushal Modi Oct 31 '14 at 13:15
  • It's reproducible with `emacs -Q`. – abo-abo Oct 31 '14 at 13:18
  • I can confirm this does happen. I find it useful because it highlights that the return value is not what it seems. – Malabarba Oct 31 '14 at 13:20
  • Strange.. why am I not seeing that even on `emacs -Q`? [Screenshot](http://i.imgur.com/YcACYO0.png). Again, I am also using emacs 24.4. – Kaushal Modi Oct 31 '14 at 13:27
  • @Malabarba, it highlights red because `nil` isn't on a new line. It's just a text formatting issue. – abo-abo Oct 31 '14 at 13:29
  • @Malabarba, does that highlighting happen for you for [this exact code snippet](https://github.com/thierryvolpiatto/zop-to-char/blob/master/zop-to-char.el#L56-60)? – Kaushal Modi Oct 31 '14 at 13:32
  • @abo-abo The fact that nil isn't on a newline gives the wrong impression this entire expression returns the return value of `kill-region`. Highlighting the `nil` makes it clear that the expression actually returns nil. – Malabarba Oct 31 '14 at 13:32
  • @kaushalmodi Yes. Though my emacs actually identifies itself as 25.0 now, so it might not be in 24.4. – Malabarba Oct 31 '14 at 13:37
  • Thanks for confirming that. @abo-abo Are you also on the emacs 25.0 development version? My `C-h` `v` `emacs-version` reads `24.4.8`. – Kaushal Modi Oct 31 '14 at 13:39
  • @kaushalmodi Yes, the issue happens for current devel version. – abo-abo Oct 31 '14 at 13:42
  • @abo-abo Phew. We can then still rely on `emacs -Q` :) The version needs to then be updated in the question title. – Kaushal Modi Oct 31 '14 at 13:43

1 Answers1

8

There are two ways

Redefine lisp--match-hidden-arg:

(defun lisp--match-hidden-arg (limit) nil)

Remove lisp--match-hidden-arg from lisp-cl-font-lock-keywords-2 and lisp-el-font-lock-keywords-2

(setq lisp-el-font-lock-keywords-2
      (cl-delete 'lisp--match-hidden-arg lisp-el-font-lock-keywords-2
                 :key #'car))

Please Do NOT Do That!

The coding style detected by lisp--match-hidden-arg is not very readable.

"... a computer language is not just a way of getting a computer to perform operations, but rather ... it is a novel formal medium for expressing ideas about methodology"

Abelson/Sussman "Structure and Interpretation of Computer Programs".

You write code so that people (and you yourself a year from today!) will read and understand it. Coding conventions serve a purpose. Please think before rejecting them.

sds
  • 5,928
  • 20
  • 39