diff lisp/newcomment.el @ 57301:800ede9cd8e3

comment-beginning: doc-fix and don't choke on unset comment-end-skip when at beginning of comment
author Daniel Pfeiffer <occitan@esperanto.org>
date Sun, 03 Oct 2004 15:33:38 +0000
parents 902c984fa20a
children d0bca414ad07 58db929d96c6
line wrap: on
line diff
--- a/lisp/newcomment.el	Sat Oct 02 18:23:27 2004 +0000
+++ b/lisp/newcomment.el	Sun Oct 03 15:33:38 2004 +0000
@@ -423,7 +423,7 @@
 (defun comment-beginning ()
   "Find the beginning of the enclosing comment.
 Returns nil if not inside a comment, else moves point and returns
-the same as `comment-search-forward'."
+the same as `comment-search-backward'."
   ;; HACK ATTACK!
   ;; We should really test `in-string-p' but that can be expensive.
   (unless (eq (get-text-property (point) 'face) 'font-lock-string-face)
@@ -435,7 +435,7 @@
 	      (and
 	       ;; For modes where comment-start and comment-end are the same,
 	       ;; the search above may have found a `ce' rather than a `cs'.
-	       (or (not (looking-at comment-end-skip))
+	       (or (if comment-end-skip (not (looking-at comment-end-skip)))
 		   ;; Maybe font-lock knows that it's a `cs'?
 		   (eq (get-text-property (match-end 0) 'face)
 		       'font-lock-comment-face)