1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 06:21:02 -08:00
emacs/test/lisp
Michal Nazarewicz 7c6317a049 Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace
* lisp/simple.el (delete-trailing-whitespace): Set newline’s character
syntax to non-whitespace so that ‘\s-’ regular expression does not match
it.

This simplifies the loop slightly since a simple ‘\s-+$’ can be used and
as a consequence ‘line-beginning-position’ function does not need to be
called any longer.

Furthermore, when newline has whitespace syntax, ‘\s-$’ regular
expression ends up matching empty lins since ‘\s-’ matches newline
characetr of proceeding line.  This leads to needless loop iterations.

Since previous change to ‘delete-trailing-whitespace’ already introduced
‘with-syntax-table’, take advantage of it and also overwrite newline’s
character syntax.
2016-07-04 23:44:06 +02:00
..
calc Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
calendar Remove ‘ert-with-function-mocked’ macro in favour of ‘cl-letf’ macro 2016-06-08 19:10:59 +02:00
emacs-lisp Fix seq-contains 2016-06-18 10:10:00 +02:00
emulation Merge from origin/emacs-25 2016-06-26 00:16:25 +02:00
erc ; Comment tweak. 2016-04-29 13:31:45 -04:00
eshell Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
gnus Remove ‘ert-with-function-mocked’ macro in favour of ‘cl-letf’ macro 2016-06-08 19:10:59 +02:00
international Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
legacy Added tests for dos unibyte decoding. 2016-05-21 00:13:43 -04:00
mail ; Add 2016 to copyright years for files not in emacs-25 branch 2016-01-12 16:20:00 -05:00
net Add Google Drive support to Tramp 2016-07-04 15:36:30 +02:00
progmodes Also handle escaping when string begins with a quote 2016-06-27 07:31:52 +03:00
textmodes Add completion of colors in CSS mode 2016-05-22 12:54:02 +02:00
url * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth): 2016-02-12 21:18:13 -05:00
vc Remove ‘ert-with-function-mocked’ macro in favour of ‘cl-letf’ macro 2016-06-08 19:10:59 +02:00
abbrev-tests.el abbrev-tests.el fix 2016-05-03 19:21:47 +02:00
auth-source-tests.el Move low-level library files from the lisp/gnus directory 2016-02-24 13:04:03 +11:00
autorevert-tests.el autorevert: Resume with polling if file is deleted 2016-04-19 11:05:55 +02:00
char-fold-tests.el Merge from origin/emacs-25 2016-05-26 12:55:06 -07:00
comint-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
dabbrev-tests.el * test/lisp/dabbrev-tests.el: Merge fix: move here from test/automated. 2016-03-16 08:58:10 -07:00
descr-text-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
dired-tests.el ; Add 2016 to copyright years for files not in emacs-25 branch 2016-01-12 16:20:00 -05:00
electric-tests.el Merge from origin/emacs-25 2016-05-02 10:46:53 -07:00
epg-tests.el epg: Add a way to detect gpg1 executable for tests 2016-05-20 16:29:04 +09:00
faces-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
filenotify-tests.el ; Simplify in filenotify-tests.el 2016-06-20 15:05:52 +02:00
help-fns-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
htmlfontify-tests.el ; Add 2016 to copyright years for files not in emacs-25 branch 2016-01-12 16:20:00 -05:00
ibuffer-tests.el ; Add 2016 to copyright years for files not in emacs-25 branch 2016-01-12 16:20:00 -05:00
imenu-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
info-xref-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
isearch-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
jit-lock-tests.el Fix the jit-lock-fontify-now test names 2016-05-09 12:29:38 +03:00
json-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
man-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
minibuffer-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
mouse-tests.el ; * test/lisp/mouse-tests.el: Standardize license notice. 2016-05-22 17:20:48 -07:00
obarray-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
ps-print-tests.el ; Add 2016 to copyright years for files not in emacs-25 branch 2016-01-12 16:20:00 -05:00
replace-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
simple-tests.el Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace 2016-07-04 23:44:06 +02:00
sort-tests.el Merge from origin/emacs-25 2016-04-11 09:07:15 -07:00
subr-tests.el Merge from origin/emacs-25 2016-05-31 08:07:41 -07:00
thingatpt-tests.el Merge from origin/emacs-25 2016-01-11 22:48:07 -08:00
xml-tests.el Merge from origin/emacs-25 2016-03-11 13:32:13 -08:00
xt-mouse-tests.el * test/lisp/xt-mouse-tests.el: Move from test/automated/. 2016-04-23 10:46:08 -07:00