Mercurial > emacs
comparison lisp/indent.el @ 48581:023f680b7cfe
(indent-according-to-mode, indent-region): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 29 Nov 2002 15:06:59 +0000 |
parents | 7a6c116b0d4a |
children | e88404e8f2cf |
comparison
equal
deleted
inserted
replaced
48580:02ae07f0375b | 48581:023f680b7cfe |
---|---|
52 or in the line's indentation, otherwise it insert a `real' tab character." | 52 or in the line's indentation, otherwise it insert a `real' tab character." |
53 :group 'indent | 53 :group 'indent |
54 :type '(choice (const nil) (const t) (const always))) | 54 :type '(choice (const nil) (const t) (const always))) |
55 | 55 |
56 (defun indent-according-to-mode () | 56 (defun indent-according-to-mode () |
57 "Indent line in proper way for current major mode." | 57 "Indent line in proper way for current major mode. |
58 The buffer-local variable `indent-line-function' determines how to do this, | |
59 but the functions `indent-relative' and `indent-relative-maybe' are | |
60 special; we don't actually use them here." | |
58 (interactive) | 61 (interactive) |
59 (if (memq indent-line-function | 62 (if (memq indent-line-function |
60 '(indent-relative indent-relative-maybe)) | 63 '(indent-relative indent-relative-maybe)) |
61 ;; These functions are used for tabbing, but can't be used for | 64 ;; These functions are used for tabbing, but can't be used for |
62 ;; indenting. Replace with something ad-hoc. | 65 ;; indenting. Replace with something ad-hoc. |
323 "Short cut function to indent region using `indent-according-to-mode'. | 326 "Short cut function to indent region using `indent-according-to-mode'. |
324 A value of nil means really run `indent-according-to-mode' on each line.") | 327 A value of nil means really run `indent-according-to-mode' on each line.") |
325 | 328 |
326 (defun indent-region (start end &optional column) | 329 (defun indent-region (start end &optional column) |
327 "Indent each nonblank line in the region. | 330 "Indent each nonblank line in the region. |
328 With no prefix argument, indent each line using `indent-according-to-mode', | 331 A numeric prefix argument specifies a column: indent each line to that column. |
329 or use `indent-region-function' to do the whole region if that's non-nil. | 332 |
330 If there is a fill prefix, make each line start with the fill prefix. | 333 With no prefix argument, the command chooses one of these methods and |
331 With argument COLUMN, indent each line to that column. | 334 indents all the lines with it: |
332 | 335 |
333 When you call this from a program, START and END specify | 336 1) If `fill-prefix' is non-nil, insert `fill-prefix' at the |
334 the region to indent, and COLUMN specifies the indentation column. | 337 beginning of each line in the region that does not already begin |
335 If COLUMN is nil, then indent each line according to the mode." | 338 with it. |
339 2) If `indent-region-function' is non-nil, call that function | |
340 to indent the region. | |
341 3) Indent each line as specified by the variable `indent-line-function'. | |
342 | |
343 Called from a program, START and END specify the region to indent. | |
344 If the third argument COLUMN is an integer, it specifies the | |
345 column to indent to; if it is nil, use one of the three methods above." | |
336 (interactive "r\nP") | 346 (interactive "r\nP") |
337 (if (null column) | 347 (if (null column) |
338 (if fill-prefix | 348 (if fill-prefix |
339 (save-excursion | 349 (save-excursion |
340 (goto-char end) | 350 (goto-char end) |