# HG changeset patch # User Stefan Monnier # Date 1015204255 0 # Node ID 5e6a5df9973a40334aedfd9fd96b22668628248b # Parent fc341cea1c3894b167f939ca8f020bc2fe0654af (comment-forward): Use forward-comment to skip over whitespace (or comments) even when comment-use-syntax is nil. diff -r fc341cea1c38 -r 5e6a5df9973a lisp/newcomment.el --- a/lisp/newcomment.el Mon Mar 04 01:09:58 2002 +0000 +++ b/lisp/newcomment.el Mon Mar 04 01:10:55 2002 +0000 @@ -5,7 +5,7 @@ ;; Author: code extracted from Emacs-20's simple.el ;; Maintainer: Stefan Monnier ;; 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 @@ (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))))