aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index bf99a38a11a..e3e6a7cebe1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1912,16 +1912,22 @@ Setting this variable automatically makes it local to the current buffer.")
1912 (if (save-excursion 1912 (if (save-excursion
1913 (goto-char fill-point) 1913 (goto-char fill-point)
1914 (not (bolp))) 1914 (not (bolp)))
1915 ;; If point is at the fill-point, do not `save-excursion'. 1915 (let ((prev-column (current-column)))
1916 ;; Otherwise, if a comment prefix or fill-prefix is inserted, 1916 ;; If point is at the fill-point, do not `save-excursion'.
1917 ;; point will end up before it rather than after it. 1917 ;; Otherwise, if a comment prefix or fill-prefix is inserted,
1918 (if (save-excursion 1918 ;; point will end up before it rather than after it.
1919 (skip-chars-backward " \t") 1919 (if (save-excursion
1920 (= (point) fill-point)) 1920 (skip-chars-backward " \t")
1921 (indent-new-comment-line) 1921 (= (point) fill-point))
1922 (save-excursion 1922 (indent-new-comment-line)
1923 (goto-char fill-point) 1923 (save-excursion
1924 (indent-new-comment-line))) 1924 (goto-char fill-point)
1925 (indent-new-comment-line)))
1926 ;; If making the new line didn't reduce the hpos of
1927 ;; the end of the line, then give up now;
1928 ;; trying again will not help.
1929 (if (>= (current-column) prev-column)
1930 (setq give-up t)))
1925 ;; No place to break => stop trying. 1931 ;; No place to break => stop trying.
1926 (setq give-up t))))))) 1932 (setq give-up t)))))))
1927 1933