aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index f110c6f3267..369fbf71923 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -633,10 +633,9 @@ buffer if the variable `delete-trailing-lines' is non-nil."
633 (with-syntax-table (make-syntax-table (syntax-table)) 633 (with-syntax-table (make-syntax-table (syntax-table))
634 ;; Don't delete formfeeds, even if they are considered whitespace. 634 ;; Don't delete formfeeds, even if they are considered whitespace.
635 (modify-syntax-entry ?\f "_") 635 (modify-syntax-entry ?\f "_")
636 ;; Treating \n as non-whitespace makes things easier. 636 (while (re-search-forward "\\s-$" end-marker t)
637 (modify-syntax-entry ?\n "_") 637 (skip-syntax-backward "-" (line-beginning-position))
638 (while (re-search-forward "\\s-+$" end-marker t) 638 (let ((b (point)) (e (match-end 0)))
639 (let ((b (match-beginning 0)) (e (match-end 0)))
640 (when (region-modifiable-p b e) 639 (when (region-modifiable-p b e)
641 (delete-region b e))))) 640 (delete-region b e)))))
642 (if end 641 (if end