]> git.eshelyaron.com Git - emacs.git/commitdiff
(indent-new-comment-line): Handle use at a point
authorKarl Heuer <kwzh@gnu.org>
Fri, 26 Mar 1999 18:02:24 +0000 (18:02 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 26 Mar 1999 18:02:24 +0000 (18:02 +0000)
after a comment-end.  Handle multiple comments.

lisp/simple.el

index 92874f5f02e4189bd587c8469b22ffa156ab4400..eb4f7a3f6db849fd820105fdde81f3c1ba19db18 100644 (file)
@@ -3219,9 +3219,13 @@ unless optional argument SOFT is non-nil."
       (if (not comment-multi-line)
          (save-excursion
            (if (and comment-start-skip
-                    (let ((opoint (point)))
+                    (let ((opoint (point))
+                          inside)
                       (forward-line -1)
-                      (re-search-forward comment-start-skip opoint t)))
+                      ;; Determine (more or less) whether
+                      ;; target position is inside a comment.
+                      (while (and (setq inside (re-search-forward comment-start-skip opoint t))
+                                  (not (setq inside (not (search-forward comment-end opoint t))))))))
                ;; The old line is a comment.
                ;; Set WIN to the pos of the comment-start.
                ;; But if the comment is empty, look at preceding lines