Commit 9d0f559a authored by Roland McGrath's avatar Roland McGrath
Browse files

(indent-for-comment): Use skip-syntax-backward in place of

skip-chars-backward.
Correctly set INDENT to the return value of comment-indent-function.
parent 17276ed3
...@@ -1523,18 +1523,19 @@ the comment's starting delimiter.") ...@@ -1523,18 +1523,19 @@ the comment's starting delimiter.")
;; position at the end of the first pair. ;; position at the end of the first pair.
(if (match-end 1) (if (match-end 1)
(goto-char (match-end 1)) (goto-char (match-end 1))
;; If comment-start-skip matched a string with internal ;; If comment-start-skip matched a string with
;; whitespace (not final whitespace) then the delimiter ;; internal whitespace (not final whitespace) then
;; start at the end of that whitespace. ;; the delimiter start at the end of that
;; Otherwise, it starts at the beginning of what was matched. ;; whitespace. Otherwise, it starts at the
(skip-chars-backward " \t" (match-beginning 0)) ;; beginning of what was matched.
(skip-chars-backward "^ \t" (match-beginning 0))))) (skip-syntax-backward " " (match-beginning 0))
(skip-syntax-backward "^ " (match-beginning 0)))))
(setq begpos (point)) (setq begpos (point))
;; Compute desired indent. ;; Compute desired indent.
(if (= (current-column) (if (= (current-column)
(if comment-indent-hook (setq indent (if comment-indent-hook
(funcall comment-indent-hook) (funcall comment-indent-hook)
(funcall comment-indent-function))) (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