help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabling show-wspace for a specific mode or buffer


From: Alp Aker
Subject: Re: Disabling show-wspace for a specific mode or buffer
Date: Wed, 27 Jun 2012 16:31:36 -0400

> I added your add-hook statements, restarted emacs, but when I open w3m
> they appear to have no effect.

Did you add them to your .emacs *after* you load w3?  You could also
try this (it's overkill, but might work):

(add-hook 'w3m-fontify-before-hook
'show-ws-dont-highlight-trailing-whitespace)

Again, this is untested, as w3m breaks my setup, so I'm just looking
at the sources.

> Also when I run the command
>
> M-x show-ws-dont-highlight-trailing-whitespace
>
> Nothing happens, and "[No match]" is inserted at the end of the mini buffer.

Correct:  show-ws-dont-highlight-trailing-whitespace is not an
interactive command, so you can't invoke it that way.  You could
redefine it by placing the following in your .emacs (after you load
show-wspace):

(defun show-ws-dont-highlight-trailing-whitespace ()
  "Don't highlight whitespace characters at line ends."
  (interactive)
  (when (fboundp 'font-lock-remove-keywords)
    (font-lock-remove-keywords
     nil '(("[\240\040\t]+$" (0 'show-ws-trailing-whitespace t)))))
  (when (called-interactively-p 'any)
    (font-lock-fontify-buffer)))

and then it can be invoked via

  M-x show-ws-dont-highlight-trailing-whitespace



reply via email to

[Prev in Thread] Current Thread [Next in Thread]