Am 12.06.2011 15:47, schrieb Stephen J. Turnbull:
[ ... ]
> as it happens `whitespace-trailing-regexp' already exists,
Not in XEmacs core or packages as far as I can tell,
Ah, sorry, it's in recent GNU's whitespace.el
(defcustom whitespace-trailing-regexp
"\\([\t \u00A0]+\\)$"
"Specify trailing characters regexp.
If you're using `mule' package, there may be other characters besides:
\" \" \"\\t\" \"\\u00A0\"
that should be considered blank.
NOTE: Enclose always by \"\\\\(\" and \"\\\\)$\" the elements to
highlight.
Use exactly one pair of enclosing elements above.
Used when `whitespace-style' includes `trailing'."
:type '(regexp :tag "Trailing Chars")
:group 'whitespace)
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,
No, that's my own version.
it still runs into the fact that this is
redundant.
In which respect? Could drop `save-match-data' and beg-end
specification. Both are not redundant, just protecting for less probable
cases.
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)
(delete-horizontal-space))
This should typically be good enough,
Agreed.
OTOH: why not implement a more powerful form if it's ready?
Don't have a show case for now. Just imagine for example a case, where
textes are inserted from outside. If they have been edited by hand,
trailing whitespaces will happen.
If that insertion is done by a function again, beg and end are known.
Running it as a hook after insertion makes sense, beg-end specifications
too.
Andreas
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta