bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18783: 24.4; fixup-whitespace at end of line leaves a trailing space


From: Niels Möller
Subject: bug#18783: 24.4; fixup-whitespace at end of line leaves a trailing space
Date: Tue, 21 Oct 2014 11:59:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (usg-unix-v)

The function fixup-whitespace leaves a trailing space when invoked at
the end of a line (and this bug is a lot older than emacs-24.4).

To reproduce: Run emacs -Q. Type x, to get a line containing "x" and
with point at the end. Type M-x fixup-whitespace RET. A space is added,
so we get a line containing "x ".

I think this is a bug, because it's inconsistent with spacing
conventions I'm aware of, and the space is deleted by emacs' M-x
whitespace-cleanup.

Patch below seems to solve the problem.

Best regards,
/Niels Möller

--- simple.el   2014-08-22 17:52:28.000000000 +0200
+++ simple.el.patched   2014-10-21 11:38:59.000000000 +0200
@@ -787,7 +787,7 @@ Leave one space or none, according to th
   (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



-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]