From 5605893d03d128a088eca3ea36af392bf7d111eb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 1 Apr 2007 19:33:44 +0000 Subject: (comment-search-forward): Discard comment starters before point. --- lisp/newcomment.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/newcomment.el') diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 7fce0f7bde8..b0a166465fa 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -391,7 +391,9 @@ and raises an error or returns nil if NOERROR is non-nil." pt (or limit (point-max)) nil nil (list nil nil nil (nth 3 s) nil nil nil nil) t))) - (if (not (and (nth 8 s) (not (nth 3 s)))) + (if (or (not (and (nth 8 s) (not (nth 3 s)))) + ;; Make sure the comment starts after PT. + (< (nth 8 s) pt)) (unless noerror (error "No comment")) ;; We found the comment. (let ((pos (point)) -- cgit v1.2.1