comparison man/programs.texi @ 52153:6b84fb503a42

(Lisp Indent): Don't describe lisp-indent-function property here. Use xref to Lisp Manual.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Aug 2003 01:45:08 +0000
parents 75df22371834
children 695cf19ef79e
comparison
equal deleted inserted replaced
52152:b41c6ef00205 52153:6b84fb503a42
484 additional columns beyond the open-parenthesis that starts the 484 additional columns beyond the open-parenthesis that starts the
485 expression. 485 expression.
486 486
487 @cindex @code{lisp-indent-function} property 487 @cindex @code{lisp-indent-function} property
488 You can override the standard pattern in various ways for individual 488 You can override the standard pattern in various ways for individual
489 functions, according to the @code{lisp-indent-function} property of the 489 functions, according to the @code{lisp-indent-function} property of
490 function name. There are four possibilities for this property: 490 the function name. Normally you would use this for macro definitions
491 491 and specify it using the @code{declare} construct (@pxref{Defining
492 @table @asis 492 Macros,,, elisp, the Emacs Lisp Reference Manual}).
493 @item @code{nil}
494 This is the same as no property---use the standard indentation pattern.
495 @item @code{defun}
496 Handle this function like a @samp{def} construct: treat the second
497 line as the start of a @dfn{body}.
498 @item a number, @var{number}
499 The first @var{number} arguments of the function are
500 @dfn{distinguished} arguments; the rest are considered the body
501 of the expression. A line in the expression is indented according to
502 whether the first argument on it is distinguished or not. If the
503 argument is part of the body, the line is indented @code{lisp-body-indent}
504 more columns than the open-parenthesis starting the containing
505 expression. If the argument is distinguished and is either the first
506 or second argument, it is indented @emph{twice} that many extra columns.
507 If the argument is distinguished and not the first or second argument,
508 the line uses the standard pattern.
509 @item a symbol, @var{symbol}
510 @var{symbol} should be a function name; that function is called to
511 calculate the indentation of a line within this expression. The
512 function receives two arguments:
513 @table @asis
514 @item @var{state}
515 The value returned by @code{parse-partial-sexp} (a Lisp primitive for
516 indentation and nesting computation) when it parses up to the
517 beginning of this line.
518 @item @var{pos}
519 The position at which the line being indented begins.
520 @end table
521 @noindent
522 It should return either a number, which is the number of columns of
523 indentation for that line, or a list whose car is such a number. The
524 difference between returning a number and returning a list is that a
525 number says that all following lines at the same nesting level should
526 be indented just like this one; a list says that following lines might
527 call for different indentations. This makes a difference when the
528 indentation is being computed by @kbd{C-M-q}; if the value is a
529 number, @kbd{C-M-q} need not recalculate indentation for the following
530 lines until the end of the list.
531 @end table
532 493
533 @node C Indent 494 @node C Indent
534 @subsection Commands for C Indentation 495 @subsection Commands for C Indentation
535 496
536 Here are special features for indentation in C mode and related modes: 497 Here are special features for indentation in C mode and related modes: