aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-03-08 01:07:13 +0000
committerStefan Monnier2004-03-08 01:07:13 +0000
commite4b7444db4a69af0bdb4230aa42f1127beafc23b (patch)
tree3bd07c13a79a5c18f3a84b6ddd8e3b09fe12ed09
parent7d46398ac9b26bc3178ae6094fd2969606f82a99 (diff)
downloademacs-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.el35
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'.
35Non-nil means changing indent doesn't end a paragraph. 40Non-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."
49If the function returns nil, then `fill-paragraph' does its normal work.") 54If 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.
56Kinsoku processing is designed to prevent certain characters from being 61Kinsoku processing is designed to prevent certain characters from being
57placed at the beginning or end of a line by filling. 62placed at the beginning or end of a line by filling.
58See the documentation of `kinsoku' for more information.") 63See 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'."
365Don't move back past the buffer position LIMIT. 371Don't move back past the buffer position LIMIT.
366 372
367This function is called when we are going to break the current line 373This function is called when we are going to break the current line
368after or before a non-ascii character. If the charset of the 374after or before a non-ASCII character. If the charset of the
369character has the property `fill-find-break-point-function', this 375character has the property `fill-find-break-point-function', this
370function calls the property value as a function with one arg LINEBEG. 376function calls the property value as a function with one arg LINEBEG.
371If the charset has no such property, do nothing." 377If 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.
892The fourth arg NOSQUEEZE non-nil means to leave 903The fourth arg NOSQUEEZE non-nil means to leave
893whitespace other than line breaks untouched, and fifth arg TO-EOP 904whitespace other than line breaks untouched, and fifth arg TO-EOP
894non-nil means to keep filling to the end of the paragraph (or next 905non-nil means to keep filling to the end of the paragraph (or next
895hard newline, if `use-hard-newlines' is on). 906hard newline, if variable `use-hard-newlines' is on).
896 907
897Return the fill-prefix used for filling the last paragraph. 908Return 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
976moved to the beginning and end \(respectively) of the paragraphs they 987moved to the beginning and end \(respectively) of the paragraphs they
977are in. 988are in.
978 989
979If `use-hard-newlines' is true, all hard newlines are taken to be paragraph 990If variable `use-hard-newlines' is true, all hard newlines are
980breaks. 991taken to be paragraph breaks.
981 992
982When calling from a program, operates just on region between BEGIN and END, 993When calling from a program, operates just on region between BEGIN and END,
983unless optional fourth arg WHOLE-PAR is non-nil. In that case bounds are 994unless optional fourth arg WHOLE-PAR is non-nil. In that case bounds are