0

When I run

(setq-default show-trailing-whitespace t)

on startup, the Echo Area is affected. I can usually turn this off with hooks, e.g.

  (add-hook 'minibuffer-setup-hook
    (lambda () (setq show-trailing-whitespace nil)))
  (add-hook 'messages-buffer-mode-hook
    (lambda () (setq show-trailing-whitespace nil)))

However, I can't seem to find a suitable hook in this case. I'm used to inspecting modes of a buffer with C-h m, but the Echo Area disappears when clicked with a mouse or typing resumes.

The only Echo Area hook I can find mention of doesn't seem to do the trick:

  (add-hook 'echo-area-clear-hook
    (lambda () (setq show-trailing-whitespace nil)))

Defaulting show-trailing-whitespace to nil does turn off trailing whitespace showing in the Echo Area, but would necessitate manual enumeration of all modes in which to turn it on.

How can one disable show-trailing-whitespace in the Echo Area if the setting is defaulted to true?

1
  • You can explicitly visit an echo area buffer: C-x b *Echo Area 0* (note that there is a space before the initial asterisk in the name of these buffers). And you can do C-h m on that, but I didn't see anything that could be used to override the customization.
    – NickD
    Commented Jun 4 at 15:37

1 Answer 1

0

The following solves the problem:

(with-current-buffer " *Echo Area 0*" (setq show-trailing-whitespace nil))

I'm not yet sure how robust/permanent this is; i.e., whether "*Echo Area 1*", "*Echo Area 2*"..., "*Echo Area n*" might eventually be created and need similar treatment.

1
  • There are two echo area buffers: 0 and 1. See xdisp.c.
    – NickD
    Commented Jun 4 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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