diff options
| -rw-r--r-- | lisp/simple.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 61d031d211b..fd9cd5d1caa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3219,14 +3219,16 @@ unless optional argument SOFT is non-nil." | |||
| 3219 | (if (not comment-multi-line) | 3219 | (if (not comment-multi-line) |
| 3220 | (save-excursion | 3220 | (save-excursion |
| 3221 | (if (and comment-start-skip | 3221 | (if (and comment-start-skip |
| 3222 | (let ((opoint (point)) | 3222 | (let ((opoint (1- (point))) |
| 3223 | inside) | 3223 | inside) |
| 3224 | (forward-line -1) | 3224 | (forward-line -1) |
| 3225 | ;; Determine (more or less) whether | 3225 | ;; Determine (more or less) whether |
| 3226 | ;; target position is inside a comment. | 3226 | ;; target position is inside a comment. |
| 3227 | (while (and (setq inside (re-search-forward comment-start-skip opoint t)) | 3227 | (while (and (re-search-forward comment-start-skip opoint t) |
| 3228 | (not (setq inside (not (search-forward comment-end opoint t)))))))) | 3228 | (not (setq inside (or (equal comment-end "") |
| 3229 | ;; The old line is a comment. | 3229 | (not (search-forward comment-end opoint t))))))) |
| 3230 | inside)) | ||
| 3231 | ;; The old line has a comment and point was inside the comment. | ||
| 3230 | ;; Set WIN to the pos of the comment-start. | 3232 | ;; Set WIN to the pos of the comment-start. |
| 3231 | ;; But if the comment is empty, look at preceding lines | 3233 | ;; But if the comment is empty, look at preceding lines |
| 3232 | ;; to find one that has a nonempty comment. | 3234 | ;; to find one that has a nonempty comment. |