diff options
| author | Richard M. Stallman | 1998-03-09 06:36:42 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-09 06:36:42 +0000 |
| commit | dbe524b6329f13700951c1f1617ff06ef7692a20 (patch) | |
| tree | 9adb6750223cd042a37bf6a5ebf6ac4da3a37791 | |
| parent | 9bd4f69c5df4a6206b680a04fc9482826ab6a3e6 (diff) | |
| download | emacs-dbe524b6329f13700951c1f1617ff06ef7692a20.tar.gz emacs-dbe524b6329f13700951c1f1617ff06ef7692a20.zip | |
(do-auto-fill): Obey fill-nobreak-predicate.
| -rw-r--r-- | lisp/simple.el | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 27f977a5fb4..62a6ea2e877 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -338,17 +338,17 @@ Interactively, ARG is the prefix arg (default 1) | |||
| 338 | and KILLP is t if a prefix arg was specified." | 338 | and KILLP is t if a prefix arg was specified." |
| 339 | (interactive "*p\nP") | 339 | (interactive "*p\nP") |
| 340 | (when (eq backward-delete-char-untabify-method 'untabify) | 340 | (when (eq backward-delete-char-untabify-method 'untabify) |
| 341 | (let ((count arg)) | 341 | (let ((count arg)) |
| 342 | (save-excursion | 342 | (save-excursion |
| 343 | (while (and (> count 0) (not (bobp))) | 343 | (while (and (> count 0) (not (bobp))) |
| 344 | (if (= (preceding-char) ?\t) | 344 | (if (= (preceding-char) ?\t) |
| 345 | (let ((col (current-column))) | 345 | (let ((col (current-column))) |
| 346 | (forward-char -1) | 346 | (forward-char -1) |
| 347 | (setq col (- col (current-column))) | 347 | (setq col (- col (current-column))) |
| 348 | (insert-char ?\ col) | 348 | (insert-char ?\ col) |
| 349 | (delete-char 1))) | 349 | (delete-char 1))) |
| 350 | (forward-char -1) | 350 | (forward-char -1) |
| 351 | (setq count (1- count)))))) | 351 | (setq count (1- count)))))) |
| 352 | (delete-backward-char | 352 | (delete-backward-char |
| 353 | (if (eq backward-delete-char-untabify-method 'hungry) | 353 | (if (eq backward-delete-char-untabify-method 'hungry) |
| 354 | (let ((wh (- (point) (save-excursion (skip-chars-backward " \t") | 354 | (let ((wh (- (point) (save-excursion (skip-chars-backward " \t") |
| @@ -2683,9 +2683,11 @@ indicating whether it should use soft newlines. | |||
| 2683 | 2683 | ||
| 2684 | Setting this variable automatically makes it local to the current buffer.") | 2684 | Setting this variable automatically makes it local to the current buffer.") |
| 2685 | 2685 | ||
| 2686 | ;; This function is the auto-fill-function of a buffer | 2686 | ;; This function is used as the auto-fill-function of a buffer |
| 2687 | ;; when Auto-Fill mode is enabled. | 2687 | ;; when Auto-Fill mode is enabled. |
| 2688 | ;; It returns t if it really did any work. | 2688 | ;; It returns t if it really did any work. |
| 2689 | ;; (Actually some major modes use a different auto-fill function, | ||
| 2690 | ;; but this one is the default one.) | ||
| 2689 | (defun do-auto-fill () | 2691 | (defun do-auto-fill () |
| 2690 | (let (fc justify bol give-up | 2692 | (let (fc justify bol give-up |
| 2691 | (fill-prefix fill-prefix)) | 2693 | (fill-prefix fill-prefix)) |
| @@ -2725,11 +2727,11 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 2725 | (looking-at (regexp-quote fill-prefix)) | 2727 | (looking-at (regexp-quote fill-prefix)) |
| 2726 | (setq after-prefix (match-end 0))) | 2728 | (setq after-prefix (match-end 0))) |
| 2727 | (move-to-column (1+ fc)) | 2729 | (move-to-column (1+ fc)) |
| 2728 | ;; Move back to the point where we can break the | 2730 | ;; Move back to the point where we can break the line. |
| 2729 | ;; line at. We break the line between word or | 2731 | ;; We break the line between word or |
| 2730 | ;; after/before the character which has character | 2732 | ;; after/before the character which has character |
| 2731 | ;; category `|'. We search space, \c| followed by | 2733 | ;; category `|'. We search space, \c| followed by |
| 2732 | ;; a character, or \c| follwoing a character. If | 2734 | ;; a character, or \c| following a character. If |
| 2733 | ;; not found, place the point at beginning of line. | 2735 | ;; not found, place the point at beginning of line. |
| 2734 | (while (or first | 2736 | (while (or first |
| 2735 | ;; If this is after period and a single space, | 2737 | ;; If this is after period and a single space, |
| @@ -2741,7 +2743,11 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 2741 | sentence-end-double-space | 2743 | sentence-end-double-space |
| 2742 | (save-excursion (forward-char -1) | 2744 | (save-excursion (forward-char -1) |
| 2743 | (and (looking-at "\\. ") | 2745 | (and (looking-at "\\. ") |
| 2744 | (not (looking-at "\\. ")))))) | 2746 | (not (looking-at "\\. "))))) |
| 2747 | (and (not (bobp)) | ||
| 2748 | (not bounce) | ||
| 2749 | fill-nobreak-predicate | ||
| 2750 | (funcall fill-nobreak-predicate))) | ||
| 2745 | (setq first nil) | 2751 | (setq first nil) |
| 2746 | (re-search-backward "[ \t]\\|\\c|.\\|.\\c|\\|^") | 2752 | (re-search-backward "[ \t]\\|\\c|.\\|.\\c|\\|^") |
| 2747 | ;; If we find nowhere on the line to break it, | 2753 | ;; If we find nowhere on the line to break it, |