Commit ec9a76e3 authored by Jim Blandy's avatar Jim Blandy

* simple.el (comment-indent-function): New variable, intended to

	replace comment-indent-hook.
	(comment-indent-hook): Make this default to nil now.
	(indent-for-comment): If comment-indent-hook is non-nil, call it
	for backward compatibility; otherwise, call
	comment-indent-function.
	* bytecomp.el: Declare comment-indent-hook an obsolete variable.
parent 0f85737c
...@@ -2994,6 +2994,7 @@ For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" ...@@ -2994,6 +2994,7 @@ For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\""
(make-obsolete-variable 'unread-command-event (make-obsolete-variable 'unread-command-event
"use unread-command-events; this is now a list of events.") "use unread-command-events; this is now a list of events.")
(make-obsolete-variable 'suspend-hook 'suspend-hooks) (make-obsolete-variable 'suspend-hook 'suspend-hooks)
(make-obsolete-variable 'comment-indent-hook 'comment-indent-function)
(provide 'byte-compile) (provide 'byte-compile)
......
...@@ -1491,7 +1491,12 @@ at the place matched by the close of the first pair.") ...@@ -1491,7 +1491,12 @@ at the place matched by the close of the first pair.")
"*String to insert to end a new comment. "*String to insert to end a new comment.
Should be an empty string if comments are terminated by end-of-line.") 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) '(lambda () comment-column)
"Function to compute desired indentation for a comment. "Function to compute desired indentation for a comment.
This function is called with no args with point at the beginning of This function is called with no args with point at the beginning of
...@@ -1521,7 +1526,9 @@ the comment's starting delimiter.") ...@@ -1521,7 +1526,9 @@ the comment's starting delimiter.")
(setq begpos (point)) (setq begpos (point))
;; Compute desired indent. ;; Compute desired indent.
(if (= (current-column) (if (= (current-column)
(setq indent (funcall comment-indent-hook))) (if comment-indent-hook
(funcall comment-indent-hook)
(funcall comment-indent-function)))
(goto-char begpos) (goto-char begpos)
;; If that's different from current, change it. ;; If that's different from current, change it.
(skip-chars-backward " \t") (skip-chars-backward " \t")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment