diff options
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 1 | ||||
| -rw-r--r-- | lisp/simple.el | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index bab4e9de04d..921737df870 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2994,6 +2994,7 @@ For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" (make-obsolete-variable 'unread-command-event "use unread-command-events; this is now a list of events.") (make-obsolete-variable 'suspend-hook 'suspend-hooks) +(make-obsolete-variable 'comment-indent-hook 'comment-indent-function) (provide 'byte-compile) diff --git a/lisp/simple.el b/lisp/simple.el index adc10d59f1a..9c3a8ecd26e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1491,7 +1491,12 @@ at the place matched by the close of the first pair.") "*String to insert to end a new comment. Should be an empty string if comments are terminated by end-of-line.") -(defconst comment-indent-hook +(defconst comment-indent-hook nil + "Obsolete variable for function to compute desired indentation for a comment. +This function is called with no args with point at the beginning of +the comment's starting delimiter.") + +(defconst comment-indent-function '(lambda () comment-column) "Function to compute desired indentation for a comment. This function is called with no args with point at the beginning of @@ -1521,7 +1526,9 @@ the comment's starting delimiter.") (setq begpos (point)) ;; Compute desired indent. (if (= (current-column) - (setq indent (funcall comment-indent-hook))) + (if comment-indent-hook + (funcall comment-indent-hook) + (funcall comment-indent-function))) (goto-char begpos) ;; If that's different from current, change it. (skip-chars-backward " \t") |
