comparison lisp/newcomment.el @ 90182:f042e7c0fe20

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-53 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 302-319) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 69) - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 20 May 2005 04:22:05 +0000
parents f3ec05478165 c905fcf5e3d9
children bb71c6cf2009
comparison
equal deleted inserted replaced
90181:0c828e2b0b6f 90182:f042e7c0fe20
88 to understand comments or not in the given buffer. 88 to understand comments or not in the given buffer.
89 Major modes should set this variable.") 89 Major modes should set this variable.")
90 90
91 (defcustom comment-fill-column nil 91 (defcustom comment-fill-column nil
92 "Column to use for `comment-indent'. If nil, use `fill-column' instead." 92 "Column to use for `comment-indent'. If nil, use `fill-column' instead."
93 :type '(choice (const nil) integer)) 93 :type '(choice (const nil) integer)
94 :group 'comment)
94 95
95 ;;;###autoload 96 ;;;###autoload
96 (defcustom comment-column 32 97 (defcustom comment-column 32
97 "*Column to indent right-margin comments to. 98 "*Column to indent right-margin comments to.
98 Each mode establishes a different default value for this variable; you 99 Each mode establishes a different default value for this variable; you
99 can set the value for a particular mode using that mode's hook. 100 can set the value for a particular mode using that mode's hook.
100 Comments might be indented to a value smaller than this in order 101 Comments might be indented to a value smaller than this in order
101 not to go beyond `comment-fill-column'." 102 not to go beyond `comment-fill-column'."
102 :type 'integer) 103 :type 'integer
104 :group 'comment)
103 (make-variable-buffer-local 'comment-column) 105 (make-variable-buffer-local 'comment-column)
104 106
105 ;;;###autoload 107 ;;;###autoload
106 (defvar comment-start nil 108 (defvar comment-start nil
107 "*String to insert to start a new comment, or nil if no comment syntax.") 109 "*String to insert to start a new comment, or nil if no comment syntax.")
199 (defcustom comment-style 'plain 201 (defcustom comment-style 'plain
200 "*Style to be used for `comment-region'. 202 "*Style to be used for `comment-region'.
201 See `comment-styles' for a list of available styles." 203 See `comment-styles' for a list of available styles."
202 :type (if (boundp 'comment-styles) 204 :type (if (boundp 'comment-styles)
203 `(choice ,@(mapcar (lambda (s) `(const ,(car s))) comment-styles)) 205 `(choice ,@(mapcar (lambda (s) `(const ,(car s))) comment-styles))
204 'symbol)) 206 'symbol)
207 :group 'comment)
205 208
206 ;;;###autoload 209 ;;;###autoload
207 (defcustom comment-padding " " 210 (defcustom comment-padding " "
208 "Padding string that `comment-region' puts between comment chars and text. 211 "Padding string that `comment-region' puts between comment chars and text.
209 Can also be an integer which will be automatically turned into a string 212 Can also be an integer which will be automatically turned into a string
210 of the corresponding number of spaces. 213 of the corresponding number of spaces.
211 214
212 Extra spacing between the comment characters and the comment text 215 Extra spacing between the comment characters and the comment text
213 makes the comment easier to read. Default is 1. nil means 0." 216 makes the comment easier to read. Default is 1. nil means 0."
214 :type '(choice string integer (const nil))) 217 :type '(choice string integer (const nil))
218 :group 'comment)
215 219
216 ;;;###autoload 220 ;;;###autoload
217 (defcustom comment-multi-line nil 221 (defcustom comment-multi-line nil
218 "*Non-nil means `comment-indent-new-line' continues comments. 222 "*Non-nil means `comment-indent-new-line' continues comments.
219 That is, it inserts no new terminator or starter. 223 That is, it inserts no new terminator or starter.
220 This affects `auto-fill-mode', which is the main reason to 224 This affects `auto-fill-mode', which is the main reason to
221 customize this variable. 225 customize this variable.
222 226
223 It also affects \\[indent-new-comment-line]. However, if you want this 227 It also affects \\[indent-new-comment-line]. However, if you want this
224 behavior for explicit filling, you might as well use \\[newline-and-indent]." 228 behavior for explicit filling, you might as well use \\[newline-and-indent]."
225 :type 'boolean) 229 :type 'boolean
230 :group 'comment)
226 231
227 (defcustom comment-empty-lines nil 232 (defcustom comment-empty-lines nil
228 "If nil, `comment-region' does not comment out empty lines. 233 "If nil, `comment-region' does not comment out empty lines.
229 If t, it always comments out empty lines. 234 If t, it always comments out empty lines.
230 if `eol' it only comments out empty lines if comments are 235 if `eol' it only comments out empty lines if comments are
231 terminated by the end of line (i.e. `comment-end' is empty)." 236 terminated by the end of line (i.e. `comment-end' is empty)."
232 :type '(choice (const :tag "Never" nil) 237 :type '(choice (const :tag "Never" nil)
233 (const :tag "Always" t) 238 (const :tag "Always" t)
234 (const :tag "EOl-terminated" 'eol))) 239 (const :tag "EOl-terminated" 'eol))
240 :group 'comment)
235 241
236 ;;;; 242 ;;;;
237 ;;;; Helpers 243 ;;;; Helpers
238 ;;;; 244 ;;;;
239 245
1089 1095
1090 ;;;###autoload 1096 ;;;###autoload
1091 (defcustom comment-auto-fill-only-comments nil 1097 (defcustom comment-auto-fill-only-comments nil
1092 "Non-nil means to only auto-fill inside comments. 1098 "Non-nil means to only auto-fill inside comments.
1093 This has no effect in modes that do not define a comment syntax." 1099 This has no effect in modes that do not define a comment syntax."
1094 :type 'boolean) 1100 :type 'boolean
1101 :group 'comment)
1095 1102
1096 (defun comment-valid-prefix-p (prefix compos) 1103 (defun comment-valid-prefix-p (prefix compos)
1097 (or 1104 (or
1098 ;; Accept any prefix if the current comment is not EOL-terminated. 1105 ;; Accept any prefix if the current comment is not EOL-terminated.
1099 (save-excursion (goto-char compos) (comment-forward) (not (bolp))) 1106 (save-excursion (goto-char compos) (comment-forward) (not (bolp)))