changeset 2299:53abb56a18fa

* 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.
author Jim Blandy <jimb@redhat.com>
date Sun, 21 Mar 1993 07:04:44 +0000
parents 872a3a2c3fed
children dfef2f43f4bf
files lisp/emacs-lisp/bytecomp.el lisp/simple.el
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/bytecomp.el	Sun Mar 21 06:53:04 1993 +0000
+++ b/lisp/emacs-lisp/bytecomp.el	Sun Mar 21 07:04:44 1993 +0000
@@ -2994,6 +2994,7 @@
 (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)
 
--- a/lisp/simple.el	Sun Mar 21 06:53:04 1993 +0000
+++ b/lisp/simple.el	Sun Mar 21 07:04:44 1993 +0000
@@ -1491,7 +1491,12 @@
   "*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 @@
       (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")