From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lenny Foner Newsgroups: gmane.emacs.bugs Subject: bug#3823: skip-chars-forward "[:space:]" does not work if used after forward-comment Date: Fri, 5 Feb 2010 01:00:29 -0500 (EST) Message-ID: <20100205060029.9A89040261@darkstar.media.mit.edu> References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1265435593 17890 80.91.229.12 (6 Feb 2010 05:53:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2010 05:53:13 +0000 (UTC) To: 3823@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 06 06:53:08 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NddbO-0000L5-4c for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2010 06:53:06 +0100 Original-Received: from localhost ([127.0.0.1]:58338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NddbN-0005Ts-Lb for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2010 00:53:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdI8N-0002qL-1U for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2010 01:57:43 -0500 Original-Received: from [199.232.76.173] (port=44385 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdI8K-0002ma-LY for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2010 01:57:40 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdI8I-0006S9-3e for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2010 01:57:40 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46002) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NdI8H-0006S3-QU for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2010 01:57:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NdI5m-0007Av-CO; Fri, 05 Feb 2010 01:55:02 -0500 X-Loop: bug-gnu-emacs@gnu.org In-Reply-To: Resent-From: Lenny Foner Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Feb 2010 06:55:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 3823 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3823-submit@debbugs.gnu.org id=B3823.126535284827569 (code B ref 3823); Fri, 05 Feb 2010 06:55:02 +0000 Original-Received: (at 3823) by debbugs.gnu.org; 5 Feb 2010 06:54:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NdI4u-0007Ac-69 for submit@debbugs.gnu.org; Fri, 05 Feb 2010 01:54:08 -0500 Original-Received: from belladonna.media.mit.edu ([18.85.44.34]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NdHF3-0006gc-C0 for 3823@debbugs.gnu.org; Fri, 05 Feb 2010 01:00:33 -0500 Original-Received: from darkstar.media.mit.edu (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by belladonna.media.mit.edu (Postfix) with ESMTP id 44C531481B; Fri, 5 Feb 2010 01:00:30 -0500 (EST) Original-Received: by darkstar.media.mit.edu (Postfix, from userid 1000) id 9A89040261; Fri, 5 Feb 2010 01:00:29 -0500 (EST) X-Mailman-Approved-At: Fri, 05 Feb 2010 01:54:07 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 05 Feb 2010 01:55:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 06 Feb 2010 00:53:00 -0500 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34924 Archived-At: This bug just nailed me too. The original report was in Emacs 23, but I'm running 22, and it doesn't work here, either, so it's obviously been broken a long time. Here's a toy function I was in the middle of writing, as part of making Meta-. more to my liking: (defun bmd-beginning-of-function-including-comments () "Positions point at the start of any comments preceding the current function. Assumes it starts at the very beginning of a definition, as Meta-. will leave us. This is defined as all non-code lines before the current function, until we find either another line of code, or the beginning of the buffer. If we wind up at the beginning of the buffer, we stop there. If we find another line of code, we then skip forward over any whitespace after that code, so as to land at the first line of comments but not on any whitespace before them. (This means that we will skip backwards over any number of interspersed blank lines and comments but will not waste screen real estate on a blank line when we're done.) Narrowing is considered, so the beginning of the buffer really means the beginning of the accessible portion if narrowing is in effect." (interactive) (forward-comment (- (buffer-size))) (unless (= (point) (point-min)) (forward-line 1) ;; NOTE! Trying to use "[:space:]" instead of the regexp below DOES NOT WORK! ;; It only works if some other (interactive?) commands have -intervened- after the forward-comment! ;; Someone else has apparently tripped over this; c.f. http://debbugs.gnu.org/db/38/3823.html (skip-chars-forward " \t\r\n"))) This works if I use M-: to evaluate each of the forward-comment, forward-line, and skip-chars-forward by hand, but not in the function; after wasting a bunch of time trying to figure out if I was nuts or Emacs was, I found this report, whose workaround works for me. So much for trying to be elegant and actually -use- the defined syntax classes... Feh. I presume that forward-comment is leaving the syntax tables messed up in some way that gets fixed by the command-loop, or something weird like that. My configuration: In GNU Emacs 22.2.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2009-11-10 on yellow, modified by Ubuntu configured using `configure '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LC_ALL: C value of $LC_COLLATE: C value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t dynamic-completion-mode: t show-paren-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t