From: Niels Möller Date: Tue, 21 Oct 2014 09:59:11 +0000 (+0200) Subject: Stop `fixup-whitespace' adding trailing whitespace (Bug#18783) X-Git-Tag: emacs-26.0.90~522^2~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d1e113ee60a0750acbbc0da569f7cc1bab88f11c;p=emacs.git Stop `fixup-whitespace' adding trailing whitespace (Bug#18783) * lisp/simple.el (fixup-whitespace): Insert no spaces if point is at end of line after deleting horizontal whitespace. Copyright-paperwork-exempt: yes --- diff --git a/lisp/simple.el b/lisp/simple.el index 369fbf71923..48c1a9b15d6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -833,7 +833,7 @@ Leave one space or none, according to the context." (interactive "*") (save-excursion (delete-horizontal-space) - (if (or (looking-at "^\\|\\s)") + (if (or (looking-at "^\\|$\\|\\s)") (save-excursion (forward-char -1) (looking-at "$\\|\\s(\\|\\s'"))) nil