After putting face to whitespace-style:

(setq whitespace-style '(trailing tabs empty face))
(global-whitespace-mode 1)

string enclosed in a double quote started to be highlighted by font-lock-string-face in fundamental-mode.

As workaround I disabled global-whitespace-mode and switched to old good v21.1 style:

(setq-default show-trailing-whitespace t)
(set-face-attribute 'trailing-whitespace nil :background "magenta")

Still I like whitespace-mode goodies. It is a bug? How can I debug an issue with double quotation highlighting?

EXTRA When problem is here font-lock-keywords has value:

  (#1="\\(  +\\)" . #2=(1 whitespace-tab t))
  (whitespace-trailing-regexp . #3=(1 whitespace-trailing t))
  (whitespace-empty-at-bob-regexp . #4=(1 whitespace-empty t))
  (whitespace-empty-at-eob-regexp . #5=(1 whitespace-empty t)))
  (0 nil))
 (#1# #2#)
 (whitespace-trailing-regexp #3#)
 (whitespace-empty-at-bob-regexp #4#)
 (whitespace-empty-at-eob-regexp #5#))

The following will do it. It's source is from font-lock.el which is included in emacs.

(setq font-lock-string-face nil)
  • Interesting, but I have to make font-lock-string-face buffer local based on complicated condition + highlighting engine still works under the hood. I need this for large log files so it is not particularly suitable workaround for my case... I think I have to report bug... – gavenkoa Dec 16 '20 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.