diff options
| author | Richard M. Stallman | 1993-08-07 08:19:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-07 08:19:18 +0000 |
| commit | 34b45e324e4ba164d28bfedea9400c4ed11e673e (patch) | |
| tree | 4cdbfa745a4875695a0ac07069d0f7268896659f | |
| parent | b30b24cbc359a7db4e6c1dda28f119377d630009 (diff) | |
| download | emacs-34b45e324e4ba164d28bfedea9400c4ed11e673e.tar.gz emacs-34b45e324e4ba164d28bfedea9400c4ed11e673e.zip | |
(do-auto-fill): Don't keep breaking the line
if it doesn't help matters.
| -rw-r--r-- | lisp/simple.el | 26 |
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 | ||