[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r105750: Doc fixes related to lisp-in
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r105750: Doc fixes related to lisp-indent-function (bug#9484) |
Date: |
Mon, 12 Sep 2011 23:55:10 -0700 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 105750
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2011-09-12 23:55:10 -0700
message:
Doc fixes related to lisp-indent-function (bug#9484)
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Doc fix.
* lisp/progmodes/scheme.el (scheme-indent-function): Give it a doc string.
* lisp/emacs-lisp/cl-indent.el (common-lisp-indent-function): Comment.
modified:
lisp/ChangeLog
lisp/emacs-lisp/cl-indent.el
lisp/emacs-lisp/lisp-mode.el
lisp/progmodes/scheme.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-09-12 20:45:56 +0000
+++ b/lisp/ChangeLog 2011-09-13 06:55:10 +0000
@@ -1,3 +1,8 @@
+2011-09-13 Glenn Morris <address@hidden>
+
+ * emacs-lisp/lisp-mode.el (lisp-indent-function):
+ * progmodes/scheme.el (scheme-indent-function): Doc fixes.
+
2011-09-12 Chong Yidong <address@hidden>
* dired-aux.el (dired-mark-read-string): Don't return default
=== modified file 'lisp/emacs-lisp/cl-indent.el'
--- a/lisp/emacs-lisp/cl-indent.el 2011-05-13 19:27:52 +0000
+++ b/lisp/emacs-lisp/cl-indent.el 2011-09-13 06:55:10 +0000
@@ -167,6 +167,7 @@
(+ loop-indentation lisp-loop-forms-indentation)))))
+;; Cf (info "(elisp)Specification List")
;;;###autoload
(defun common-lisp-indent-function (indent-point state)
"Function to indent the arguments of a Lisp function call.
=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el 2011-07-06 16:46:27 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el 2011-09-13 06:55:10 +0000
@@ -1102,25 +1102,31 @@
(defun lisp-indent-function (indent-point state)
"This function is the normal value of the variable `lisp-indent-function'.
-It is used when indenting a line within a function call, to see if the
-called function says anything special about how to indent the line.
+The function `calculate-lisp-indent' calls this to determine
+if the arguments of a Lisp function call should be indented specially.
INDENT-POINT is the position where the user typed TAB, or equivalent.
Point is located at the point to indent under (for default indentation);
STATE is the `parse-partial-sexp' state for that position.
-If the current line is in a call to a Lisp function
-which has a non-nil property `lisp-indent-function',
-that specifies how to do the indentation. The property value can be
-* `defun', meaning indent `defun'-style;
+If the current line is in a call to a Lisp function that has a non-nil
+property `lisp-indent-function' (or the deprecated `lisp-indent-hook'),
+it specifies how to indent. The property value can be:
+
+* `defun', meaning indent `defun'-style
+ \(this is also the case if there is no property and the function
+ has a name that begins with \"def\", and three or more arguments);
+
* an integer N, meaning indent the first N arguments specially
- like ordinary function arguments and then indent any further
+ (like ordinary function arguments), and then indent any further
arguments like a body;
-* a function to call just as this function was called.
- If that function returns nil, that means it doesn't specify
- the indentation.
-
-This function also returns nil meaning don't specify the indentation."
+
+* a function to call that returns the indentation (or nil).
+ `lisp-indent-function' calls this function with the same two arguments
+ that it itself received.
+
+This function returns either the indentation to use, or nil if the
+Lisp function does not specify a special indentation."
(let ((normal-indent (current-column)))
(goto-char (1+ (elt state 1)))
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
=== modified file 'lisp/progmodes/scheme.el'
--- a/lisp/progmodes/scheme.el 2011-08-22 03:38:30 +0000
+++ b/lisp/progmodes/scheme.el 2011-09-13 06:55:10 +0000
@@ -442,9 +442,19 @@
(defvar calculate-lisp-indent-last-sexp)
-;; Copied from lisp-indent-function, but with gets of
-;; scheme-indent-{function,hook}.
+
+;; FIXME this duplicates almost all of lisp-indent-function.
+;; Extract common code to a subroutine.
(defun scheme-indent-function (indent-point state)
+ "Scheme mode function for the value of the variable `lisp-indent-function'.
+This behaves like the function `lisp-indent-function', except that:
+
+i) it checks for a non-nil value of the property `scheme-indent-function'
+\(or the deprecated `scheme-indent-hook'), rather than `lisp-indent-function.'
+
+ii) if that property specifes a function, it is called with three
+arguments (not two), the third argument being the default (i.e., current)
+indentation."
(let ((normal-indent (current-column)))
(goto-char (1+ (elt state 1)))
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r105750: Doc fixes related to lisp-indent-function (bug#9484),
Glenn Morris <=