]> git.eshelyaron.com Git - emacs.git/commitdiff
(comment-forward): Use forward-comment to skip
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 4 Mar 2002 01:10:55 +0000 (01:10 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 4 Mar 2002 01:10:55 +0000 (01:10 +0000)
over whitespace (or comments) even when comment-use-syntax is nil.

lisp/newcomment.el

index 91ad7e64f35ce66e0d217b4bda3986a416bf8eef..0b4e662620dafe81fa85484bc1737e0c8285b8c7 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: code extracted from Emacs-20's simple.el
 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: comment uncomment
-;; Revision: $Id: newcomment.el,v 1.43 2001/12/14 21:53:29 monnier Exp $
+;; Revision: $Id: newcomment.el,v 1.44 2002/01/13 09:59:39 pj Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -389,11 +389,11 @@ and can use regexps instead of syntax."
   (if (< n 0) (error "No comment-backward")
     (if comment-use-syntax (forward-comment n)
       (while (> n 0)
-       (skip-syntax-forward " ")
        (setq n
-             (if (and (looking-at comment-start-skip)
-                      (goto-char (match-end 0))
-                      (re-search-forward comment-end-skip nil 'move))
+             (if (or (forward-comment 1)
+                     (and (looking-at comment-start-skip)
+                          (goto-char (match-end 0))
+                          (re-search-forward comment-end-skip nil 'move)))
                  (1- n) -1)))
       (= n 0))))