|
From: | Jacob Bachmeyer |
Subject: | Re: PATCH: solution for rogue whitespace in ChangeLog |
Date: | Fri, 14 Dec 2018 21:04:24 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 |
Ben Elliston wrote:
On Thu, Dec 13, 2018 at 06:47:21PM -0600, Jacob Bachmeyer wrote:A bit of rogue whitespace has slipped into ChangeLog again. I spent some time reading the Emacs manual and found that Emacs can automatically fix the issue if the "whitespace-auto-cleanup" variable is set.It's a good idea. I am just concerned that it doesn't work for me. ;-) Which Emacs version are you using?
An ancient 22.1.1 that has been kept because it works for my purposes. ;-) (There was an upgrade attempt that went very wrong in the past; "once bitten, twice shy" but I tend to occasionally find odd bugs because of an unusual version mix.) (A complete rebuild to modern software has been "planned" for some years, but that will be its own irritation -- some of the larger programs I use are configured with some very nice extensions that do not work in the newer versions.)
apropos whitespace-auto-cleanup finds nothing on my GNU Emacs 25.2.2 installation. Does this depend on another Emacs package?
No, it is part of whitespace.el in the old version.Apparently, the new version of whitespace.el has rolled the old whitespace-auto-cleanup into a new whitespace-action variable, so changing "whitespace-auto-cleanup: t" to "whitespace-action: '(auto-cleanup)" looks like it should work. Too bad that there does not seem to be an actually stable interface for specifying this in a file. :-/
The other (probably better) option is to add something to your .emacs file along the lines of: (warning: untested)
(add-hook 'find-file-hook (lambda ()(when (string= (file-name-nondirectory (buffer-file-name)) "ChangeLog")
(set (make-local-variable 'whitespace-action) '(auto-cleanup)))))That will of course have to be updated when the "whitespace" internals change again. :-/
-- Jacob
[Prev in Thread] | Current Thread | [Next in Thread] |