summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 9483170a0b6..bcf2b067704 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -639,8 +639,9 @@ buffer if the variable `delete-trailing-lines' is non-nil."
(while (re-search-forward "\\s-$" end-marker t)
(skip-syntax-backward "-" (line-beginning-position))
(let ((b (point)) (e (match-end 0)))
- (when (region-modifiable-p b e)
- (delete-region b e)))))
+ (if (region-modifiable-p b e)
+ (delete-region b e)
+ (goto-char e)))))
(if end
(set-marker end-marker nil)
;; Delete trailing empty lines.