comparison lisp/textmodes/fill.el @ 17664:d8cb277f0ce8

Use defgroup and defcustom.
author Richard M. Stallman <rms@gnu.org>
date Mon, 05 May 1997 15:00:53 +0000
parents 98f917a99501
children a9f18d920c11
comparison
equal deleted inserted replaced
17663:d2c64a1563f7 17664:d8cb277f0ce8
26 ;; All the commands for filling text. These are documented in the Emacs 26 ;; All the commands for filling text. These are documented in the Emacs
27 ;; manual. 27 ;; manual.
28 28
29 ;;; Code: 29 ;;; Code:
30 30
31 (defvar fill-individual-varying-indent nil 31 (defcustom fill-individual-varying-indent nil
32 "*Controls criterion for a new paragraph in `fill-individual-paragraphs'. 32 "*Controls criterion for a new paragraph in `fill-individual-paragraphs'.
33 Non-nil means changing indent doesn't end a paragraph. 33 Non-nil means changing indent doesn't end a paragraph.
34 That mode can handle paragraphs with extra indentation on the first line, 34 That mode can handle paragraphs with extra indentation on the first line,
35 but it requires separator lines between paragraphs. 35 but it requires separator lines between paragraphs.
36 A value of nil means that any change in indentation starts a new paragraph.") 36 A value of nil means that any change in indentation starts a new paragraph."
37 37 :type 'boolean
38 (defvar sentence-end-double-space t 38 :group 'fill)
39 "*Non-nil means a single space does not end a sentence.") 39
40 40 (defcustom sentence-end-double-space t
41 (defvar colon-double-space nil 41 "*Non-nil means a single space does not end a sentence."
42 "*Non-nil means put two spaces after a colon when filling.") 42 :type 'boolean
43 :group 'fill)
44
45 (defcustom colon-double-space nil
46 "*Non-nil means put two spaces after a colon when filling."
47 :type 'boolean
48 :group 'fill)
43 49
44 (defvar fill-paragraph-function nil 50 (defvar fill-paragraph-function nil
45 "Mode-specific function to fill a paragraph, or nil if there is none. 51 "Mode-specific function to fill a paragraph, or nil if there is none.
46 If the function returns nil, then `fill-paragraph' does its normal work.") 52 If the function returns nil, then `fill-paragraph' does its normal work.")
47 53
61 (setq fill-prefix nil)) 67 (setq fill-prefix nil))
62 (if fill-prefix 68 (if fill-prefix
63 (message "fill-prefix: \"%s\"" fill-prefix) 69 (message "fill-prefix: \"%s\"" fill-prefix)
64 (message "fill-prefix cancelled"))) 70 (message "fill-prefix cancelled")))
65 71
66 (defvar adaptive-fill-mode t 72 (defcustom adaptive-fill-mode t
67 "*Non-nil means determine a paragraph's fill prefix from its text.") 73 "*Non-nil means determine a paragraph's fill prefix from its text."
68 74 :type 'boolean
69 (defvar adaptive-fill-regexp "[ \t]*\\([#;>*]+ +\\)?" 75 :group 'fill)
76
77 (defcustom adaptive-fill-regexp "[ \t]*\\([#;>*]+ +\\)?"
70 "*Regexp to match text at start of line that constitutes indentation. 78 "*Regexp to match text at start of line that constitutes indentation.
71 If Adaptive Fill mode is enabled, whatever text matches this pattern 79 If Adaptive Fill mode is enabled, whatever text matches this pattern
72 on the second line of a paragraph is used as the standard indentation 80 on the second line of a paragraph is used as the standard indentation
73 for the paragraph. If the paragraph has just one line, the indentation 81 for the paragraph. If the paragraph has just one line, the indentation
74 is taken from that line.") 82 is taken from that line."
75 83 :type 'regexp
76 (defvar adaptive-fill-function nil 84 :group 'fill)
85
86 (defcustom adaptive-fill-function nil
77 "*Function to call to choose a fill prefix for a paragraph. 87 "*Function to call to choose a fill prefix for a paragraph.
78 This function is used when `adaptive-fill-regexp' does not match.") 88 This function is used when `adaptive-fill-regexp' does not match."
89 :type 'function
90 :group 'fill)
79 91
80 (defun current-fill-column () 92 (defun current-fill-column ()
81 "Return the fill-column to use for this line. 93 "Return the fill-column to use for this line.
82 The fill-column to use for a buffer is stored in the variable `fill-column', 94 The fill-column to use for a buffer is stored in the variable `fill-column',
83 but can be locally modified by the `right-margin' text property, which is 95 but can be locally modified by the `right-margin' text property, which is
516 (if (>= (point) initial) 528 (if (>= (point) initial)
517 (fill-region-as-paragraph (point) end justify nosqueeze) 529 (fill-region-as-paragraph (point) end justify nosqueeze)
518 (goto-char end))))))) 530 (goto-char end)))))))
519 531
520 532
521 (defvar default-justification 'left 533 (defcustom default-justification 'left
522 "*Method of justifying text not otherwise specified. 534 "*Method of justifying text not otherwise specified.
523 Possible values are `left', `right', `full', `center', or `none'. 535 Possible values are `left', `right', `full', `center', or `none'.
524 The requested kind of justification is done whenever lines are filled. 536 The requested kind of justification is done whenever lines are filled.
525 The `justification' text-property can locally override this variable. 537 The `justification' text-property can locally override this variable.
526 This variable automatically becomes buffer-local when set in any fashion.") 538 This variable automatically becomes buffer-local when set in any fashion."
539 :type '(choice (const left)
540 (const right)
541 (const full)
542 (const center)
543 (const none))
544 :group 'fill)
527 (make-variable-buffer-local 'default-justification) 545 (make-variable-buffer-local 'default-justification)
528 546
529 (defun current-justification () 547 (defun current-justification ()
530 "How should we justify this line? 548 "How should we justify this line?
531 This returns the value of the text-property `justification', 549 This returns the value of the text-property `justification',