From unknown Tue Jun 17 20:18:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3823 <3823@debbugs.gnu.org> To: bug#3823 <3823@debbugs.gnu.org> Subject: Status: 23.1.50; skip-chars-forward does not move after forward-comment Reply-To: bug#3823 <3823@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:18:28 +0000 retitle 3823 23.1.50; skip-chars-forward does not move after forward-comment reassign 3823 emacs submitter 3823 Lennart Borgman severity 3823 normal thanks From lennart.borgman@gmail.com Sat Jul 11 08:34:50 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Jul 2009 15:34:51 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.9 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BFYl1x013819 for ; Sat, 11 Jul 2009 08:34:48 -0700 Received: from mx10.gnu.org ([199.232.76.166]:33162) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MPeb8-0006ed-Lx for emacs-pretest-bug@gnu.org; Sat, 11 Jul 2009 11:34:46 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MPeb8-0001mO-64 for emacs-pretest-bug@gnu.org; Sat, 11 Jul 2009 11:34:46 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:60184) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MPeb7-0001mC-Re for emacs-pretest-bug@gnu.org; Sat, 11 Jul 2009 11:34:46 -0400 Received: by fxm17 with SMTP id 17so349072fxm.42 for ; Sat, 11 Jul 2009 08:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=RN2/U+3mIzPo/ToCp9ngRu/5biQskzGWICEwkAv9Tg8=; b=xSvRTgKhivx0UZX8OkHnOuNUlMiIvd2bRC0yXwNf//fd3RYrEjG1cMEaI4aqAUSwN3 GVMHt8ooyH3jA4Klx0olYkjCLN+1ySbhqBuoKQLCsPiWStU/aerQNU3dvYUI2hZ0lM9M viK1leACKpAFfvqCswYCyEKBwZ8ucKSVGbgNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=NnUQ9E6vVhlR967jy0gGiUAuWga/x1B2cy9KBwynjEXplB1GnY/B5QFYZ8NzloWFyP yeSp3DsOCUYcTzedJo1xK/Jv1BAdh1s+cy4ICVP0fCqxdfjlTuhLB6hn1wheMQdSD41z X4LVuogl9vtDxXIfIE74mx08SVdyOuZdyHoIs= MIME-Version: 1.0 Received: by 10.223.114.207 with SMTP id f15mr1477540faq.90.1247326484910; Sat, 11 Jul 2009 08:34:44 -0700 (PDT) Date: Sat, 11 Jul 2009 17:34:44 +0200 Message-ID: Subject: 23.1.50; skip-chars-forward does not move after forward-comment From: Lennart Borgman To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Start from "emacs -Q" and in the scratch buffer enter some empty lines at the top and some lines of code there so it looks like (message "i am at the top") ;; This buffer is for notes... ;; If you want to create a file... Place point at the beginning of the line ";; If you ..." and do M-: (progn (forward-comment (- 100)) (message "skipped %s " (skip-chars-forward "[:space:]"))) skip-forward will not move forward above. However if you then do M-: (message "skipped %s " (skip-chars-forward "[:space:]")) it will. In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-06-30 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' From lennart.borgman@gmail.com Sat Jul 11 09:18:40 2009 Received: (at 3823) by emacsbugs.donarmstrong.com; 11 Jul 2009 16:18:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.9 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BGIadK021200 for <3823@emacsbugs.donarmstrong.com>; Sat, 11 Jul 2009 09:18:38 -0700 Received: by fxm9 with SMTP id 9so1517616fxm.1 for <3823@emacsbugs.donarmstrong.com>; Sat, 11 Jul 2009 09:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=v43rRph2QWYxpBi1wLicyNwftaYFIHPVwYxxtrVLdB0=; b=dTk9QILqx/5vxEsbIbgSeaGuJttVBSNa+yhYGz0wWLax/4YQOT01HSljkGpJ1VfBlU YEJ57b70t3Bx1rDZ4ChatZqju9IehC/5fyio8gzUvXi6MUt5JPlluwG9Lw7NmxZj/Nl4 zyquGQJAf7mY/aFP43LR3E6FlDzt7NcEKC35w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=F7i7KME2Zxb/UvdETj/BBn1ExDH62HyHBG8EXzsrtztRPfZKETVkjrH+/cZ5/oydcT FC5ATRTgj/nUjZtEa6/jsOo8Z80UvqjOIS10MSPKX29Ds1KrR9Rvcx5fNyseWbBj9YCH qr5bewF9kDxSihL+l9OU0eMMImOeWbpnLZUXQ= MIME-Version: 1.0 Received: by 10.223.105.16 with SMTP id r16mr1528148fao.24.1247329110985; Sat, 11 Jul 2009 09:18:30 -0700 (PDT) Date: Sat, 11 Jul 2009 18:18:30 +0200 Message-ID: Subject: Seems to be a problem with the syntax table From: Lennart Borgman To: 3823@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Using (skip-forward-chars " \t\r\n") works immediately after forward-comment. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 05 01:54:08 2010 Received: (at 3823) by debbugs.gnu.org; 5 Feb 2010 06:54:08 +0000 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 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 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) Received: by darkstar.media.mit.edu (Postfix, from userid 1000) id 9A89040261; Fri, 5 Feb 2010 01:00:29 -0500 (EST) From: Lenny Foner To: 3823@debbugs.gnu.org Subject: skip-chars-forward "[:space:]" does not work if used after forward-comment Message-Id: <20100205060029.9A89040261@darkstar.media.mit.edu> Date: Fri, 5 Feb 2010 01:00:29 -0500 (EST) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 3823 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 05 13:55:19 2010 Received: (at 3823-done) by debbugs.gnu.org; 5 Mar 2010 18:55:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NncgB-0006FM-7F for submit@debbugs.gnu.org; Fri, 05 Mar 2010 13:55:19 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NncZ0-0006BX-VL for 3823-done@debbugs.gnu.org; Fri, 05 Mar 2010 13:47:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAK/gkEtMCo4j/2dsb2JhbACbR3S4CoR3BIMXh3Q X-IronPort-AV: E=Sophos;i="4.49,588,1262581200"; d="scan'208";a="57603034" Received: from 76-10-142-35.dsl.teksavvy.com (HELO ceviche.home) ([76.10.142.35]) by ironport2-out.pppoe.ca with ESMTP; 05 Mar 2010 13:47:50 -0500 Received: by ceviche.home (Postfix, from userid 20848) id C7BE4B44D4; Fri, 5 Mar 2010 13:47:49 -0500 (EST) From: Stefan Monnier To: Lennart Borgman Subject: Re: 23.1.50; skip-chars-forward does not move after forward-comment Message-ID: References: Date: Fri, 05 Mar 2010 13:47:49 -0500 In-Reply-To: (Lennart Borgman's message of "Sat, 11 Jul 2009 17:34:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 3823-done X-Mailman-Approved-At: Fri, 05 Mar 2010 13:55:17 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Start from "emacs -Q" and in the scratch buffer enter some empty lines > at the top and some lines of code there so it looks like > > (message "i am at the top") > > ;; This buffer is for notes... > ;; If you want to create a file... > > Place point at the beginning of the line ";; If you ..." and do > > M-: (progn (forward-comment (- 100)) (message "skipped %s " > (skip-chars-forward "[:space:]"))) > > skip-forward will not move forward above. Yes, and that's what we want. > However if you then do > M-: (message "skipped %s " (skip-chars-forward "[:space:]")) > it will. Oops, indeed, it does. The patch below fixes it, Stefan PS: The reason [:space:] doesn't skip forward is because in emacs-lisp-mode, like in many other modes, LF has syntax "comment-end" rather than "whitespace". It's usually not a good idea to use the "\\s-" regexp or the [:space:] char-class for that reason: better use something like [ \t\n\r]. === modified file 'src/syntax.c' --- src/syntax.c 2010-01-13 08:35:10 +0000 +++ src/syntax.c 2010-03-05 18:39:56 +0000 @@ -1747,6 +1747,7 @@ } immediate_quit = 1; + SETUP_SYNTAX_TABLE (BEGV, 0); if (forwardp) { if (multibyte) From unknown Tue Jun 17 20:18:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 03 Apr 2010 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator