aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-14 20:54:08 +0000
committerRichard M. Stallman1994-01-14 20:54:08 +0000
commit10e6ca88b14352139a44e9261ac33f363f7d8fff (patch)
treebbad13bd56937c2aa4211418249c1fc959f2a42b /lisp
parentbb62bd918cb213d70e87f10538b2922690d848a1 (diff)
downloademacs-10e6ca88b14352139a44e9261ac33f363f7d8fff.tar.gz
emacs-10e6ca88b14352139a44e9261ac33f363f7d8fff.zip
Change defconsts to defvars. Doc fixes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/perl-mode.el52
1 files changed, 27 insertions, 25 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 66d9f921bbc..8d39251bdf8 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -146,31 +146,33 @@ The expansion is entirely correct because it uses the C preprocessor."
146 (modify-syntax-entry ?| "." perl-mode-syntax-table) 146 (modify-syntax-entry ?| "." perl-mode-syntax-table)
147) 147)
148 148
149(defconst perl-indent-level 4 149(defvar perl-indent-level 4
150 "*Indentation of Perl statements with respect to containing block.") 150 "*Indentation of Perl statements with respect to containing block.")
151(defconst perl-continued-statement-offset 4 151(defvar perl-continued-statement-offset 4
152 "*Extra indent for lines not starting new statements.") 152 "*Extra indent for lines not starting new statements.")
153(defconst perl-continued-brace-offset -4 153(defvar perl-continued-brace-offset -4
154 "*Extra indent for substatements that start with open-braces. 154 "*Extra indent for substatements that start with open-braces.
155This is in addition to perl-continued-statement-offset.") 155This is in addition to `perl-continued-statement-offset'.")
156(defconst perl-brace-offset 0 156(defvar perl-brace-offset 0
157 "*Extra indentation for braces, compared with other text in same context.") 157 "*Extra indentation for braces, compared with other text in same context.")
158(defconst perl-brace-imaginary-offset 0 158(defvar perl-brace-imaginary-offset 0
159 "*Imagined indentation of an open brace that actually follows a statement.") 159 "*Imagined indentation of an open brace that actually follows a statement.")
160(defconst perl-label-offset -2 160(defvar perl-label-offset -2
161 "*Offset of Perl label lines relative to usual indentation.") 161 "*Offset of Perl label lines relative to usual indentation.")
162 162
163(defconst perl-tab-always-indent t 163(defvar perl-tab-always-indent t
164 "*Non-nil means TAB in Perl mode should always indent the current line, 164 "*Non-nil means TAB in Perl mode always indents the current line.
165regardless of where in the line point is when the TAB command is used.") 165Otherwise it inserts a tab character if you type it past the first
166nonwhite character on the line.")
166 167
167(defconst perl-tab-to-comment t 168(defvar perl-tab-to-comment t
168 "*Non-nil means that for lines which don't need indenting, TAB will 169 "*Non-nil means TAB moves to eol or makes a comment in some cases.
169either indent an existing comment, move to end-of-line, or if at end-of-line 170For lines which don't need indenting, TAB either indents an
170already, create a new comment.") 171existing comment, moves to end-of-line, or if at end-of-line already,
172create a new comment.")
171 173
172(defconst perl-nochange ";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:" 174(defvar perl-nochange ";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:"
173 "*Lines starting with this regular expression will not be auto-indented.") 175 "*Lines starting with this regular expression are not auto-indented.")
174 176
175;;;###autoload 177;;;###autoload
176(defun perl-mode () 178(defun perl-mode ()
@@ -190,7 +192,7 @@ Variables controlling indentation style:
190 either delete an empty comment, indent an existing comment, move 192 either delete an empty comment, indent an existing comment, move
191 to end-of-line, or if at end-of-line already, create a new comment. 193 to end-of-line, or if at end-of-line already, create a new comment.
192 perl-nochange 194 perl-nochange
193 Lines starting with this regular expression will not be auto-indented. 195 Lines starting with this regular expression are not auto-indented.
194 perl-indent-level 196 perl-indent-level
195 Indentation of Perl statements within surrounding block. 197 Indentation of Perl statements within surrounding block.
196 The surrounding block's indentation is the indentation 198 The surrounding block's indentation is the indentation
@@ -200,7 +202,7 @@ Variables controlling indentation style:
200 then-clause of an if or body of a while. 202 then-clause of an if or body of a while.
201 perl-continued-brace-offset 203 perl-continued-brace-offset
202 Extra indentation given to a brace that starts a substatement. 204 Extra indentation given to a brace that starts a substatement.
203 This is in addition to perl-continued-statement-offset. 205 This is in addition to `perl-continued-statement-offset'.
204 perl-brace-offset 206 perl-brace-offset
205 Extra indentation for line if it starts with an open brace. 207 Extra indentation for line if it starts with an open brace.
206 perl-brace-imaginary-offset 208 perl-brace-imaginary-offset
@@ -217,8 +219,7 @@ Various indentation styles: K&R BSD BLK GNU LW
217 perl-brace-imaginary-offset 0 0 4 0 0 219 perl-brace-imaginary-offset 0 0 4 0 0
218 perl-label-offset -5 -8 -2 -2 -2 220 perl-label-offset -5 -8 -2 -2 -2
219 221
220Turning on Perl mode calls the value of the variable perl-mode-hook with no 222Turning on Perl mode runs the normal hook `perl-mode-hook'."
221args, if that value is non-nil."
222 (interactive) 223 (interactive)
223 (kill-all-local-variables) 224 (kill-all-local-variables)
224 (use-local-map perl-mode-map) 225 (use-local-map perl-mode-map)
@@ -262,8 +263,8 @@ args, if that value is non-nil."
262 comment-column)))) ; except leave at least one space. 263 comment-column)))) ; except leave at least one space.
263 264
264(defun electric-perl-terminator (arg) 265(defun electric-perl-terminator (arg)
265 "Insert character. If at end-of-line, and not in a comment or a quote, 266 "Insert character and adjust indentation.
266correct the line's indentation." 267If at end-of-line, and not in a comment or a quote, correct the's indentation."
267 (interactive "P") 268 (interactive "P")
268 (let ((insertpos (point))) 269 (let ((insertpos (point)))
269 (and (not arg) ; decide whether to indent 270 (and (not arg) ; decide whether to indent
@@ -300,13 +301,13 @@ correct the line's indentation."
300 301
301With an argument, indent the current line, regardless of other options. 302With an argument, indent the current line, regardless of other options.
302 303
303If perl-tab-always-indent is nil and point is not in the indentation 304If `perl-tab-always-indent' is nil and point is not in the indentation
304area at the beginning of the line, simply insert a tab. 305area at the beginning of the line, simply insert a tab.
305 306
306Otherwise, indent the current line. If point was within the indentation 307Otherwise, indent the current line. If point was within the indentation
307area it is moved to the end of the indentation area. If the line was 308area it is moved to the end of the indentation area. If the line was
308already indented properly and point was not within the indentation area, 309already indented properly and point was not within the indentation area,
309and if perl-tab-to-comment is non-nil (the default), then do the first 310and if `perl-tab-to-comment' is non-nil (the default), then do the first
310possible action from the following list: 311possible action from the following list:
311 312
312 1) delete an empty comment 313 1) delete an empty comment
@@ -361,7 +362,8 @@ possible action from the following list:
361 (ding t)))))))))))) 362 (ding t))))))))))))
362 363
363(defun perl-indent-line (&optional nochange parse-start) 364(defun perl-indent-line (&optional nochange parse-start)
364 "Indent current line as Perl code. Return the amount the indentation 365 "Indent current line as Perl code.
366Return the amount the indentation
365changed by, or (parse-state) if line starts in a quoted string." 367changed by, or (parse-state) if line starts in a quoted string."
366 (let ((case-fold-search nil) 368 (let ((case-fold-search nil)
367 (pos (- (point-max) (point))) 369 (pos (- (point-max) (point)))