diff options
author | Stephen Berman <stephen.berman@gmx.net> | 2020-09-21 16:35:31 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-21 16:35:31 +0200 |
commit | 7a2ac61b5d3adbfa7c54434056b9b772f83078af (patch) | |
tree | 3df89c3adc945bb60023d45dd11a9bc99651c080 | |
parent | e8d80f1e14c8efe42d59cf856cf403ec48dfe70b (diff) | |
download | emacs-7a2ac61b5d3adbfa7c54434056b9b772f83078af.tar.gz emacs-7a2ac61b5d3adbfa7c54434056b9b772f83078af.tar.bz2 emacs-7a2ac61b5d3adbfa7c54434056b9b772f83078af.zip |
Fix check in `newline' for blank lines
* lisp/simple.el (newline): Clarify doc string and fix check for
blank lines (bug#13810).
-rw-r--r-- | lisp/simple.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 7dc695848bf..d7486e51ddc 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -516,7 +516,7 @@ This hook is run by `delete-selection-uses-region-p', which see.") "Propertized string representing a hard newline character.") (defun newline (&optional arg interactive) - "Insert a newline, and move to left margin of the new line if it's blank. + "Insert a newline, and move to left margin of the new line. With prefix argument ARG, insert that many newlines. If `electric-indent-mode' is enabled, this indents the final new line @@ -553,7 +553,7 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (save-excursion (goto-char beforepos) (beginning-of-line) - (and (looking-at "[ \t]$") + (and (looking-at "[ \t]+$") (> (current-left-margin) 0) (delete-region (point) (line-end-position)))) |