comparison lisp/fill.el @ 227:0e522484dd2a r20-5b12

Import from CVS: tag r20-5b12
author cvs
date Mon, 13 Aug 2007 10:12:37 +0200
parents 41ff10fd062f
children 3b3709405255
comparison
equal deleted inserted replaced
226:eea38c7ad7b4 227:0e522484dd2a
36 ;; 97/06/11 Steve Baur (steve@altair.xemacs.org) converted broken 36 ;; 97/06/11 Steve Baur (steve@altair.xemacs.org) converted broken
37 ;; following-char/preceding-char calls to char-after/char-before. 37 ;; following-char/preceding-char calls to char-after/char-before.
38 38
39 ;;; Code: 39 ;;; Code:
40 40
41 (defconst fill-individual-varying-indent nil 41 (defgroup fill nil
42 "Indenting and filling text."
43 :group 'editing)
44
45 (defcustom fill-individual-varying-indent nil
42 "*Controls criterion for a new paragraph in `fill-individual-paragraphs'. 46 "*Controls criterion for a new paragraph in `fill-individual-paragraphs'.
43 Non-nil means changing indent doesn't end a paragraph. 47 Non-nil means changing indent doesn't end a paragraph.
44 That mode can handle paragraphs with extra indentation on the first line, 48 That mode can handle paragraphs with extra indentation on the first line,
45 but it requires separator lines between paragraphs. 49 but it requires separator lines between paragraphs.
46 A value of nil means that any change in indentation starts a new paragraph.") 50 A value of nil means that any change in indentation starts a new paragraph."
47 51 :type 'boolean
48 (defconst sentence-end-double-space t 52 :group 'fill)
53
54 (defcustom sentence-end-double-space t
49 "*Non-nil means a single space does not end a sentence. 55 "*Non-nil means a single space does not end a sentence.
50 This variable applies only to filling, not motion commands. To 56 This variable applies only to filling, not motion commands. To
51 change the behavior of motion commands, see `sentence-end'.") 57 change the behavior of motion commands, see `sentence-end'."
52 58 :type 'boolean
53 (defconst colon-double-space nil 59 :group 'fill)
54 "*Non-nil means put two spaces after a colon when filling.") 60
61 (defcustom colon-double-space nil
62 "*Non-nil means put two spaces after a colon when filling."
63 :type 'boolean
64 :group 'fill)
55 65
56 (defvar fill-paragraph-function nil 66 (defvar fill-paragraph-function nil
57 "Mode-specific function to fill a paragraph, or nil if there is none. 67 "Mode-specific function to fill a paragraph, or nil if there is none.
58 If the function returns nil, then `fill-paragraph' does its normal work.") 68 If the function returns nil, then `fill-paragraph' does its normal work.")
59 69
69 (setq fill-prefix nil)) 79 (setq fill-prefix nil))
70 (if fill-prefix 80 (if fill-prefix
71 (message "fill-prefix: \"%s\"" fill-prefix) 81 (message "fill-prefix: \"%s\"" fill-prefix)
72 (message "fill-prefix cancelled"))) 82 (message "fill-prefix cancelled")))
73 83
74 (defconst adaptive-fill-mode t 84 (defcustom adaptive-fill-mode t
75 "*Non-nil means determine a paragraph's fill prefix from its text.") 85 "*Non-nil means determine a paragraph's fill prefix from its text."
86 :type 'boolean
87 :group 'fill)
76 88
77 ;; #### - this is still weak. Yeah, there's filladapt, but this should 89 ;; #### - this is still weak. Yeah, there's filladapt, but this should
78 ;; still be better... --Stig 90 ;; still be better... --Stig
79 (defconst adaptive-fill-regexp (purecopy "[ \t]*\\([#;>*]+ +\\)?") 91 (defcustom adaptive-fill-regexp (purecopy "[ \t]*\\([#;>*]+ +\\)?")
80 "*Regexp to match text at start of line that constitutes indentation. 92 "*Regexp to match text at start of line that constitutes indentation.
81 If Adaptive Fill mode is enabled, whatever text matches this pattern 93 If Adaptive Fill mode is enabled, whatever text matches this pattern
82 on the second line of a paragraph is used as the standard indentation 94 on the second line of a paragraph is used as the standard indentation
83 for the paragraph. If the paragraph has just one line, the indentation 95 for the paragraph. If the paragraph has just one line, the indentation
84 is taken from that line.") 96 is taken from that line."
85 97 :type 'regexp
86 (defvar adaptive-fill-function nil 98 :group 'fill)
99
100 (defcustom adaptive-fill-function nil
87 "*Function to call to choose a fill prefix for a paragraph. 101 "*Function to call to choose a fill prefix for a paragraph.
88 This function is used when `adaptive-fill-regexp' does not match.") 102 This function is used when `adaptive-fill-regexp' does not match."
103 :type 'function
104 :group 'fill)
89 105
90 ;; Added for kinsoku processing. Use this instead of 106 ;; Added for kinsoku processing. Use this instead of
91 ;; (skip-chars-backward "^ \t\n") 107 ;; (skip-chars-backward "^ \t\n")
92 ;; (skip-chars-backward "^ \n" linebeg) 108 ;; (skip-chars-backward "^ \n" linebeg)
93 (defun fill-move-backward-to-break-point (regexp &optional lim) 109 (defun fill-move-backward-to-break-point (regexp &optional lim)