Mercurial > emacs
comparison lisp/simple.el @ 4477:7101a887f80d
(do-auto-fill): Don't keep breaking the line
if it doesn't help matters.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 07 Aug 1993 08:19:18 +0000 |
parents | 1a64d641cea4 |
children | b0a70d8d9af4 |
comparison
equal
deleted
inserted
replaced
4476:e7de1b007447 | 4477:7101a887f80d |
---|---|
1910 ;; If there is a space on the line before fill-point, | 1910 ;; If there is a space on the line before fill-point, |
1911 ;; and nonspaces precede it, break the line there. | 1911 ;; and nonspaces precede it, break the line there. |
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 |
1928 (defconst comment-multi-line nil | 1934 (defconst comment-multi-line nil |
1929 "*Non-nil means \\[indent-new-comment-line] should continue same comment | 1935 "*Non-nil means \\[indent-new-comment-line] should continue same comment |