Goal: I want to have show-trailing-whitespace
enabled for all buffers save a few. Exceptions posing a problem are *Shell Command Output*
and its cousin *Async Shell Command*
.
I usually have show-trailing-whitespace
customized to t
. Therefore it is active in all new buffers.
I would also like to have it turned off for certain buffers, foremost amongst them *Shell Command Output*
. This poses a problem for me:
fundamental-mode
. There is no fundamental-mode-hook
that I could hook this setting into.after-major-mode-change-hook
which is run when the major mode is changed to fundamental-mode
, but the buffer starts out in that mode and therefore this hook is not run.get-buffer-create
.I know I can always advise
the function get-buffer-create
for this particular example, but I try to avoid that as much as possible.
Any hints?
You might be better off looking at the problem from the other side, and only set the var in those modes where you want to see trailing whitespace.
But I think you have a good point: these shell output buffers should not use fundamental-mode
. It's probably time for M-x report-emacs-bug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With