diff options
| author | Stefan Monnier | 2004-03-08 01:07:13 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-03-08 01:07:13 +0000 |
| commit | e4b7444db4a69af0bdb4230aa42f1127beafc23b (patch) | |
| tree | 3bd07c13a79a5c18f3a84b6ddd8e3b09fe12ed09 | |
| parent | 7d46398ac9b26bc3178ae6094fd2969606f82a99 (diff) | |
| download | emacs-e4b7444db4a69af0bdb4230aa42f1127beafc23b.tar.gz emacs-e4b7444db4a69af0bdb4230aa42f1127beafc23b.zip | |
(fill) <defgroup>: Move from cus-edit.el.
(enable-kinsoku): Make it a defcustom.
(fill-comment-paragraph): Don't rely on fill-prefix to bound the
paragraph to same-comment-start-marker.
| -rw-r--r-- | lisp/textmodes/fill.el | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 7a794d67c5e..57ba513cd7f 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -30,6 +30,11 @@ | |||
| 30 | 30 | ||
| 31 | ;;; Code: | 31 | ;;; Code: |
| 32 | 32 | ||
| 33 | (defgroup fill nil | ||
| 34 | "Indenting and filling text." | ||
| 35 | :link '(custom-manual "(emacs)Filling Text") | ||
| 36 | :group 'editing) | ||
| 37 | |||
| 33 | (defcustom fill-individual-varying-indent nil | 38 | (defcustom fill-individual-varying-indent nil |
| 34 | "*Controls criterion for a new paragraph in `fill-individual-paragraphs'. | 39 | "*Controls criterion for a new paragraph in `fill-individual-paragraphs'. |
| 35 | Non-nil means changing indent doesn't end a paragraph. | 40 | Non-nil means changing indent doesn't end a paragraph. |
| @@ -49,13 +54,14 @@ A value of nil means that any change in indentation starts a new paragraph." | |||
| 49 | If the function returns nil, then `fill-paragraph' does its normal work.") | 54 | If the function returns nil, then `fill-paragraph' does its normal work.") |
| 50 | 55 | ||
| 51 | (defvar fill-paragraph-handle-comment t | 56 | (defvar fill-paragraph-handle-comment t |
| 52 | "If non-nil, paragraph filling will try to pay attention to comments.") | 57 | "Non-nil means paragraph filling will try to pay attention to comments.") |
| 53 | 58 | ||
| 54 | (defvar enable-kinsoku t | 59 | (defcustom enable-kinsoku t |
| 55 | "*Non-nil means enable \"kinsoku\" processing on filling paragraph. | 60 | "*Non-nil means enable \"kinsoku\" processing on filling paragraphs. |
| 56 | Kinsoku processing is designed to prevent certain characters from being | 61 | Kinsoku processing is designed to prevent certain characters from being |
| 57 | placed at the beginning or end of a line by filling. | 62 | placed at the beginning or end of a line by filling. |
| 58 | See the documentation of `kinsoku' for more information.") | 63 | See the documentation of `kinsoku' for more information." |
| 64 | :type 'boolean) | ||
| 59 | 65 | ||
| 60 | (defun set-fill-prefix () | 66 | (defun set-fill-prefix () |
| 61 | "Set the fill prefix to the current line up to point. | 67 | "Set the fill prefix to the current line up to point. |
| @@ -317,7 +323,7 @@ be tested. If it returns t, fill commands do not break the line there." | |||
| 317 | :options '(fill-french-nobreak-p fill-single-word-nobreak-p)) | 323 | :options '(fill-french-nobreak-p fill-single-word-nobreak-p)) |
| 318 | 324 | ||
| 319 | (defcustom fill-nobreak-invisible nil | 325 | (defcustom fill-nobreak-invisible nil |
| 320 | "Non-nil means that fill command do not break lines in invisible text." | 326 | "Non-nil means that fill commands do not break lines in invisible text." |
| 321 | :type 'boolean | 327 | :type 'boolean |
| 322 | :group 'fill) | 328 | :group 'fill) |
| 323 | 329 | ||
| @@ -365,7 +371,7 @@ and `fill-nobreak-invisible'." | |||
| 365 | Don't move back past the buffer position LIMIT. | 371 | Don't move back past the buffer position LIMIT. |
| 366 | 372 | ||
| 367 | This function is called when we are going to break the current line | 373 | This function is called when we are going to break the current line |
| 368 | after or before a non-ascii character. If the charset of the | 374 | after or before a non-ASCII character. If the charset of the |
| 369 | character has the property `fill-find-break-point-function', this | 375 | character has the property `fill-find-break-point-function', this |
| 370 | function calls the property value as a function with one arg LINEBEG. | 376 | function calls the property value as a function with one arg LINEBEG. |
| 371 | If the charset has no such property, do nothing." | 377 | If the charset has no such property, do nothing." |
| @@ -428,7 +434,7 @@ Point is moved to just past the fill prefix on the first line." | |||
| 428 | (string-to-list sentence-end-without-space))) | 434 | (string-to-list sentence-end-without-space))) |
| 429 | (while (re-search-forward eol-double-space-re to t) | 435 | (while (re-search-forward eol-double-space-re to t) |
| 430 | (or (>= (point) to) (memq (char-before) '(?\t ?\ )) | 436 | (or (>= (point) to) (memq (char-before) '(?\t ?\ )) |
| 431 | (memq (char-after (match-beginning 0)) | 437 | (memq (char-after (match-beginning 0)) |
| 432 | sentence-end-without-space-list) | 438 | sentence-end-without-space-list) |
| 433 | (insert-and-inherit ?\ )))) | 439 | (insert-and-inherit ?\ )))) |
| 434 | 440 | ||
| @@ -844,8 +850,13 @@ can take care of filling. JUSTIFY is used as in `fill-paragraph'." | |||
| 844 | (concat paragraph-start "\\|[ \t]*\\(?:" | 850 | (concat paragraph-start "\\|[ \t]*\\(?:" |
| 845 | comment-start-skip "\\)\\(?:" | 851 | comment-start-skip "\\)\\(?:" |
| 846 | (default-value 'paragraph-start) "\\)")) | 852 | (default-value 'paragraph-start) "\\)")) |
| 847 | (paragraph-ignore-fill-prefix nil) | 853 | ;; We used to reply on fill-prefix to break paragraph at |
| 848 | (fill-prefix comment-fill-prefix) | 854 | ;; comment-starter changes, but it did not work for the |
| 855 | ;; first line (mixed comment&code). | ||
| 856 | ;; We now use comment-re instead to "manually" make sure | ||
| 857 | ;; we treat comment-marker changes as paragraph boundaries. | ||
| 858 | ;; (paragraph-ignore-fill-prefix nil) | ||
| 859 | ;; (fill-prefix comment-fill-prefix) | ||
| 849 | (after-line (if has-code-and-comment | 860 | (after-line (if has-code-and-comment |
| 850 | (line-beginning-position 2)))) | 861 | (line-beginning-position 2)))) |
| 851 | (setq end (progn (forward-paragraph) (point))) | 862 | (setq end (progn (forward-paragraph) (point))) |
| @@ -892,7 +903,7 @@ as specified by its text properties. | |||
| 892 | The fourth arg NOSQUEEZE non-nil means to leave | 903 | The fourth arg NOSQUEEZE non-nil means to leave |
| 893 | whitespace other than line breaks untouched, and fifth arg TO-EOP | 904 | whitespace other than line breaks untouched, and fifth arg TO-EOP |
| 894 | non-nil means to keep filling to the end of the paragraph (or next | 905 | non-nil means to keep filling to the end of the paragraph (or next |
| 895 | hard newline, if `use-hard-newlines' is on). | 906 | hard newline, if variable `use-hard-newlines' is on). |
| 896 | 907 | ||
| 897 | Return the fill-prefix used for filling the last paragraph. | 908 | Return the fill-prefix used for filling the last paragraph. |
| 898 | 909 | ||
| @@ -976,8 +987,8 @@ beginning and end of the region are not at paragraph breaks, they are | |||
| 976 | moved to the beginning and end \(respectively) of the paragraphs they | 987 | moved to the beginning and end \(respectively) of the paragraphs they |
| 977 | are in. | 988 | are in. |
| 978 | 989 | ||
| 979 | If `use-hard-newlines' is true, all hard newlines are taken to be paragraph | 990 | If variable `use-hard-newlines' is true, all hard newlines are |
| 980 | breaks. | 991 | taken to be paragraph breaks. |
| 981 | 992 | ||
| 982 | When calling from a program, operates just on region between BEGIN and END, | 993 | When calling from a program, operates just on region between BEGIN and END, |
| 983 | unless optional fourth arg WHOLE-PAR is non-nil. In that case bounds are | 994 | unless optional fourth arg WHOLE-PAR is non-nil. In that case bounds are |