[Q] copy delete-trailing-whitespace from Emacs 23.
Stephen J. Turnbull
stephen at xemacs.org
Sun Jun 12 09:47:57 EDT 2011
Andreas Röhler writes:
Please trim your posts, Andreas.
> as it happens `whitespace-trailing-regexp' already exists,
Not in XEmacs core or packages as far as I can tell, and that's a
horrible name for a core variable, although it's easy to see why it
would arise as an internal variable of the "whitespace" library.
> what about that form:
If that's from GNU Emacs, it still runs into the fact that this is
redundant. The basic idea is trivially implementable in only slightly
less sophisticated form, simply treating formfeed as non-whitespace:
(while (search-forward #r"[ \t]$" nil t)
This should typically be good enough, since formfeed is normally
visible as "^L", so whitespace preceding "^L" at end of line will
usually be quite visible), and much more sophisticated functionality
is available in the package distribution as whitespace.el and
OTOH, I have trouble imagining a use case for the more general feature
that would not be more useful if non-trailing whitespace were cleaned
up, too. That is, I don't understand why someone would go to the
trouble of entering no-break spaces or non-default-width spaces at the
end of the line if they didn't specifically want them there, and I
don't see any reason why they would get them inadvertantly, while
there are all kinds of reasons why people inadvertantly end up with
trailing ASCII whitespace.
AFAIK Didier is not actively improving whitespace.el, but he made a
point of accepting maintainership, and I'm sure he'd respond quickly
to patch submissions.
More information about the XEmacs-Beta