changeset 2446:11ca45403cf5

(indent-for-comment): Use skip-syntax-backward in place of skip-chars-backward. Correctly set INDENT to the return value of comment-indent-function.
author Roland McGrath <roland@gnu.org>
date Wed, 31 Mar 1993 23:42:37 +0000
parents c6ad6845e1b2
children 6ff9eee5cdc9
files lisp/simple.el
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Wed Mar 31 23:30:25 1993 +0000
+++ b/lisp/simple.el	Wed Mar 31 23:42:37 1993 +0000
@@ -1523,18 +1523,19 @@
 		 ;; position at the end of the first pair.
 		 (if (match-end 1)
 		     (goto-char (match-end 1))
-		   ;; If comment-start-skip matched a string with internal
-		   ;; whitespace (not final whitespace) then the delimiter
-		   ;; start at the end of that whitespace.
-		   ;; Otherwise, it starts at the beginning of what was matched.
-		   (skip-chars-backward " \t" (match-beginning 0))
-		   (skip-chars-backward "^ \t" (match-beginning 0)))))
+		   ;; If comment-start-skip matched a string with
+		   ;; internal whitespace (not final whitespace) then
+		   ;; the delimiter start at the end of that
+		   ;; whitespace.  Otherwise, it starts at the
+		   ;; beginning of what was matched.
+		   (skip-syntax-backward " " (match-beginning 0))
+		   (skip-syntax-backward "^ " (match-beginning 0)))))
       (setq begpos (point))
       ;; Compute desired indent.
       (if (= (current-column)
-	     (if comment-indent-hook
-		 (funcall comment-indent-hook)
-	       (funcall comment-indent-function)))
+	     (setq indent (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")