From unknown Sun Aug 17 09:11:20 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#51171 <51171@debbugs.gnu.org> To: bug#51171 <51171@debbugs.gnu.org> Subject: Status: 27.2; `forward-word' w/arg bug in narrowed buffer Reply-To: bug#51171 <51171@debbugs.gnu.org> Date: Sun, 17 Aug 2025 16:11:20 +0000 retitle 51171 27.2; `forward-word' w/arg bug in narrowed buffer reassign 51171 emacs submitter 51171 Ian Nehera severity 51171 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 12 20:20:54 2021 Received: (at submit) by debbugs.gnu.org; 13 Oct 2021 00:20:54 +0000 Received: from localhost ([127.0.0.1]:56169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maS0r-0002Sq-FI for submit@debbugs.gnu.org; Tue, 12 Oct 2021 20:20:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:51596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maRxT-0002MF-1l for submit@debbugs.gnu.org; Tue, 12 Oct 2021 20:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maRxR-00006l-Ui for bug-gnu-emacs@gnu.org; Tue, 12 Oct 2021 20:17:22 -0400 Received: from omta001.cacentral1.a.cloudfilter.net ([3.97.99.32]:47085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maRxN-000739-Vi for bug-gnu-emacs@gnu.org; Tue, 12 Oct 2021 20:17:21 -0400 Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id aNjVm3D9qczbLaRxLmT528; Wed, 13 Oct 2021 00:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1634084235; bh=io8ya6ypof/xy43sBuZ9dYBGABzqP0PA5vsENTv5xXQ=; h=From:Subject:Date:To; b=KvhU+HqmGhVSwuCwp0BsW9rw0so+Wxgw6UfawBXMhwzxu4geJrPHVN8Xn6+2jOGQ1 OwIuoo73oqekL2d7xyZLo25Riup/5x/xydhH6ObtH5KqAi54XtKXMZHNG0nq3mSCT8 Uq2h9uvdIyeQXIPhVS15BKgf3W85qOpmJQh1DaC6ZM3G2XkR+9I0oMIZ4aQ2hfQLdx SIVPsCyw+9Izh1mldG64DdIer7Cjs94ZJ6wUPPauPW++0HZ423IH231xBYwsnDuRbX tZ02RA6P/1gvxfOAOFurPjIydUyi7AggX5woaO9xmwWIPoV0SYn4FK66ouQrPzo4G8 4Mf55n5PlUzDA== Received: from ians-mbp.hitronhub.home ([24.80.41.162]) by cmsmtp with ESMTPA id aRxKmgkbG2J2faRxLmkquj; Wed, 13 Oct 2021 00:17:15 +0000 Authentication-Results: ; auth=pass (PLAIN) smtp.auth=delta29@shaw.ca X-Authority-Analysis: v=2.4 cv=P8xZOgMu c=1 sm=1 tr=0 ts=6166258b a=68GUtf/ThuVGfj9FO3ScHA==:117 a=68GUtf/ThuVGfj9FO3ScHA==:17 a=Ko3Y0Lly6hIM5F5IRsgA:9 a=CjuIK1q_8ugA:10 a=mrGQFXgL3o5Yvq6BKJoA:9 a=JMNH9X61SiQA:10 a=h55ZjLXlAAAA:8 a=WZbH0z1Gn1WUqwY2jh8A:9 a=QEXdDO2ut3YA:10 a=bVIcrEQjCtdAe-SrG74p:22 From: Ian Nehera Content-Type: multipart/mixed; boundary="Apple-Mail=_0C4DBB23-2F7E-4567-B540-6F2B9B9203FA" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: 27.2; `forward-word' w/arg bug in narrowed buffer Message-Id: <31D3ED6E-A1EB-4214-901F-FB62BF2A6922@shaw.ca> Date: Tue, 12 Oct 2021 17:17:14 -0700 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.21) X-CMAE-Envelope: MS4xfOm9q5sajyC7pJQC8acIlo1vueHSfrJZq+p/u7XPWYHP3Gqu14iVxf2UiG4yE4/gUSVR1vXbEYtwVuG9iuDvCgfSSNKuJPW3grHuJ6ZCHzQ870g8X7ap RjNcfwMIcDeJs97MA7rOA3Dne4MiaH183yTduQ6S4WLPBueBemn8nVxSfqvbeT5eOxb79amY1oxCGCavZcmiAeEb4USq/YefhOE= Received-SPF: pass client-ip=3.97.99.32; envelope-from=delta29@shaw.ca; helo=omta001.cacentral1.a.cloudfilter.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 12 Oct 2021 20:20:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_0C4DBB23-2F7E-4567-B540-6F2B9B9203FA Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hi, I found a bug relating to subword mode in narrowed buffers. --Apple-Mail=_0C4DBB23-2F7E-4567-B540-6F2B9B9203FA Content-Disposition: attachment; filename=dcl.c Content-Type: application/octet-stream; x-unix-mode=0755; name="dcl.c" Content-Transfer-Encoding: 7bit #include #include #include #define MAXTOKEN 100 /* can't go below 3 */ #define MAXOUTPUT 1000 /* should always be >= MAXTOKEN */ enum { NAME, PARENS, BRACKETS } TokenType; enum { OK, ERROR }; static const char *Typelist[] = { "char", "int", "short", "long", "unsigned", "float", "double", "void", NULL }; static char Name[MAXTOKEN], Output[MAXOUTPUT], Token[MAXTOKEN]; static int OutSpc = MAXOUTPUT; void undeclaration(void); void declaration(void); int dcl(void); int dirdcl(void); void outputCat(const char *s); void flushline(void); int gettoken(void); int main(const int argc, const char *argv[]) { if (argc > 1 && strcmp(argv[1], "--undcl") == 0) undeclaration(); else declaration(); return 0; } void undeclaration(void) { char type, temp[MAXOUTPUT]; int ispointer = 0; while (gettoken() != EOF) { strcpy(Output, Token); OutSpc = MAXOUTPUT - strlen(Token); while ((type = gettoken()) != '\n') { if (type == PARENS || type == BRACKETS) { if (ispointer) { OutSpc -= snprintf(temp, MAXOUTPUT, "(%s)%s", Output, Token); /* C99 feature */ strcpy(Output, temp); ispointer = 0; } else { outputCat(Token); } } else if (type == '*') { snprintf(temp, MAXOUTPUT, "*%s", Output); strcpy(Output, temp); ispointer = 1; } else if (type == NAME) { snprintf(temp, MAXOUTPUT, "%s %s", Token, Output); strcpy(Output, temp); ispointer = 0; } else { printf("ERROR: Invalid input at %s\n", Token); } } printf("%s\n", Output); ispointer = 0; /* reset for next line of input */ } } char gettype(char *s); void declaration(void) { char datatype[MAXTOKEN]; while (gettype(datatype) != EOF) { Output[0] = '\0'; if (dcl() == ERROR) { flushline(); } else if (TokenType != '\n' && TokenType != ',') { printf("ERROR: Syntax error for %s.\n", datatype); flushline(); } else { printf("%s: %s %s\n", Name, Output, datatype); Token[0] = '\0'; } } } int dcl(void) { int ns = 0; while (gettoken() == '*') ++ns; if (dirdcl() == ERROR) return ERROR; while (ns-- > 0) outputCat(" pointer to"); return OK; } int dirdcl(void) { if (TokenType == '(') { if (dcl() == ERROR) { return ERROR; } if (TokenType != ')') { printf("ERROR: Closing ')' paren missing.\n"); return ERROR; } } else if (TokenType == NAME) { strcpy(Name, Token); } else { printf("ERROR: Expected name or (dcl).\n"); return ERROR; } while (gettoken() == PARENS || TokenType == BRACKETS) { if (TokenType == PARENS) { outputCat(" function returning"); } else { outputCat(" array"); strcat(Output, Token); outputCat(" of"); } } return OK; } char getch(void); void ungetch(const char c); int gettoken(void) { char c, *p = Token; while (isblank(c = getch())) /* C99 feature */ ; if (c == '(') { if ((c = getch()) == ')') { strcpy(Token, "()"); TokenType = PARENS; } else { ungetch(c); TokenType = '('; } } else if (c == '[') { for (*p++ = c; (*p++ = getch()) != ']' && p-Token < MAXTOKEN-1; ) ; *p = '\0'; TokenType = BRACKETS; } else if (isalpha(c) || c == '_') { for (*p++ = c; (isalnum(c = getch()) || c == '_') && p-Token < MAXTOKEN-1; ) { *p++ = c; } *p = '\0'; ungetch(c); TokenType = NAME; } else { TokenType = c; } return TokenType; } char gettype(char *s) { static const char *last, *start, **type; static char c; while (isblank(c = getch())) ; last = start = s; while (isalpha(c) || c == '_') { last = s; for (*s++ = c; (isalnum(c = getch()) || c == '_') && s-start < MAXTOKEN-1; ) { *s++ = c; } if (isblank(c) && s-start < MAXTOKEN-1) { *s++ = ' '; /* no point in printing a tab char */ while (isblank(c = getch())) ; } } ungetch(c); if (*(s-1) == ' ') /* should only be one 'space' at most */ --s; *s = '\0'; if (last != start) { for (type = Typelist; *type != NULL && strcmp(*type, last); ++type) ; if (*type == NULL) { do { ungetch(*--s); } while (s >= last); *s = '\0'; } } TokenType = '\n'; return c; } void outputCat(const char *s) { if ((OutSpc -= strlen(s)) > 0) { strcat(Output, s); } else { printf("ERROR: Not enough space in Output[] to add:\n\ \"%s\"\n", s); } } void flushline(void) { static char c; /* flush both buffer[] and stdin */ while ((c = getch()) != '\n' && c != EOF) ; if (c == EOF) ungetch(c); } #define BUFFER 1000 char buffer[BUFFER]; char *bp = buffer; char getch(void) { return (bp > buffer) ? *--bp : getchar(); } void ungetch(const char c) { if (bp - buffer < BUFFER) *bp++ = c; else printf("ERROR: ungetch(); not enough room to unget '%c'.\n"); } --Apple-Mail=_0C4DBB23-2F7E-4567-B540-6F2B9B9203FA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 To reproduce from 'emacs -Q /path/to/dcl.c=E2=80=99 (file attached): 1. M-x `subword-mode' (side question: should C-c C-w still use the obsolete alias `c-subword-mode'?). 2. Navigate to the function 'int dirdcl(void)' and use `narrow-to-defun' (C-x n d). 3. =46rom the top of the buffer, use `forward-word' with an arg = greater than 1 (like C-u 2 M-f). 4. Repeat this with C-x z z z z... until you get an error around the start of the while loop (2nd to last message in list below). 5. Moving point forward then trying the same command again will yield the last message with a number greater than `point-max' (5741). Other notes: - The bug dissapears with a widened buffer or when narrowing to earlier functions. - `backward-word=E2=80=99 doesn=E2=80=99t seem to have the same = problem. - I'm reporting this from OSX 10.14.6 (homebrew), but it also = occurs on Arch Linux (emacs being installed from the standard pacman = repos). Thanks, Ian = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 = Version 10.14.6 (Build 18G95)) of 2021-03-27 built on builder10-14.porkrind.org Windowing system distributor 'Apple', version 10.3.1671 System Description: Mac OS X 10.14.6 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Subword mode enabled in current buffer You can run the command =E2=80=98subword-mode=E2=80=99 with M-x sub-mo = RET Subword mode enabled in current buffer Mark saved where search started Repeating command 2 forward-word [22 times] funcall-interactively: Error in syntax_table logic for to-the-end = intervals funcall-interactively: Point 5751 after end of properties Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER GMP Important settings: value of $LANG: en_CA.UTF-8 locale-coding-system: utf-8-unix Major mode: C/*l Minor modes in effect: subword-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils repeat misearch multi-isearch cap-words superword subword cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 67774 7216) (symbols 48 8485 1) (strings 32 21588 2096) (string-bytes 1 819438) (vectors 16 12983) (vector-slots 8 159689 12408) (floats 8 21 47) (intervals 56 528 0) (buffers 1000 12)) --Apple-Mail=_0C4DBB23-2F7E-4567-B540-6F2B9B9203FA-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 14 05:23:02 2021 Received: (at 51171) by debbugs.gnu.org; 14 Oct 2021 09:23:02 +0000 Received: from localhost ([127.0.0.1]:34652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mawx4-0001QF-EA for submit@debbugs.gnu.org; Thu, 14 Oct 2021 05:23:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mawx3-0001Pi-OG for 51171@debbugs.gnu.org; Thu, 14 Oct 2021 05:23:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40030) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mawwx-0006fH-3A; Thu, 14 Oct 2021 05:22:55 -0400 Received: from [87.69.77.57] (port=1652 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mawwv-0006U5-FT; Thu, 14 Oct 2021 05:22:55 -0400 Date: Thu, 14 Oct 2021 12:22:50 +0300 Message-Id: <83v920kljp.fsf@gnu.org> From: Eli Zaretskii To: Ian Nehera , Stefan Monnier In-Reply-To: <31D3ED6E-A1EB-4214-901F-FB62BF2A6922@shaw.ca> (message from Ian Nehera on Tue, 12 Oct 2021 17:17:14 -0700) Subject: Re: bug#51171: 27.2; `forward-word' w/arg bug in narrowed buffer References: <31D3ED6E-A1EB-4214-901F-FB62BF2A6922@shaw.ca> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51171 Cc: 51171@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ian Nehera > Date: Tue, 12 Oct 2021 17:17:14 -0700 > > To reproduce from 'emacs -Q /path/to/dcl.c’ (file attached): > 1. M-x `subword-mode' (side question: should C-c C-w still use the > obsolete alias `c-subword-mode'?). > 2. Navigate to the function 'int dirdcl(void)' and use > `narrow-to-defun' (C-x n d). > 3. From the top of the buffer, use `forward-word' with an arg greater > than 1 (like C-u 2 M-f). > 4. Repeat this with C-x z z z z... until you get an error around the > start of the while loop (2nd to last message in list below). > 5. Moving point forward then trying the same command again will yield > the last message with a number greater than `point-max' (5741). > > Other notes: > - The bug dissapears with a widened buffer or when narrowing to > earlier functions. > - `backward-word’ doesn’t seem to have the same problem. > - I'm reporting this from OSX 10.14.6 (homebrew), but it also occurs on > Arch Linux (emacs being installed from the standard pacman repos). Stefan, any suggestions wrt this? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 08:02:21 2022 Received: (at 51171) by debbugs.gnu.org; 12 Sep 2022 12:02:21 +0000 Received: from localhost ([127.0.0.1]:44454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXi8q-0006JF-RQ for submit@debbugs.gnu.org; Mon, 12 Sep 2022 08:02:21 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXi8p-0006J0-1a for 51171@debbugs.gnu.org; Mon, 12 Sep 2022 08:02:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=i5oXKlyWSBuZy52amOXh4jKHXOn4wsL/kPzaCRYy7Sw=; b=SUhhuZU2ZUBM0zUO/YgGGaLJxs hVxH3zzXuknHxsCDbZz7LBE/8rNOLWlTRaTYR9QLP890Tntt+AogFbsY2wOusqznQP0GJiTNNodtG vfvGPl80Mkbkn/QMagiOl1rEfauQZgov51Fk00jhu0Slbrs1rksjiZZyNTUSunmsmjS0=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXi8e-0005re-05; Mon, 12 Sep 2022 14:02:10 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#51171: 27.2; `forward-word' w/arg bug in narrowed buffer In-Reply-To: <83v920kljp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Oct 2021 12:22:50 +0300") References: <31D3ED6E-A1EB-4214-901F-FB62BF2A6922@shaw.ca> <83v920kljp.fsf@gnu.org> X-Now-Playing: Moor Mother's _Jazz Codes_: "Dust Together (feat Wolf Weston & Aquiles Navarro)" Date: Mon, 12 Sep 2022 14:02:03 +0200 Message-ID: <87k0687qdg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> To reproduce from 'emacs -Q /path/to/dcl.c’ (file attached): >> 1. M-x `subword-mode' (side question: should C-c C-w still use the >> obsolete alias `c-subword-mode'?). >> 2. Navigate to the func [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51171 Cc: 51171@debbugs.gnu.org, Stefan Monnier , Ian Nehera X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> To reproduce from 'emacs -Q /path/to/dcl.c=E2=80=99 (file attached): >> 1. M-x `subword-mode' (side question: should C-c C-w still use the >> obsolete alias `c-subword-mode'?). >> 2. Navigate to the function 'int dirdcl(void)' and use >> `narrow-to-defun' (C-x n d). >> 3. From the top of the buffer, use `forward-word' with an arg greater >> than 1 (like C-u 2 M-f). >> 4. Repeat this with C-x z z z z... until you get an error around the >> start of the while loop (2nd to last message in list below). >> 5. Moving point forward then trying the same command again will yield >> the last message with a number greater than `point-max' (5741). >>=20 >> Other notes: >> - The bug dissapears with a widened buffer or when narrowing to >> earlier functions. >> - `backward-word=E2=80=99 doesn=E2=80=99t seem to have the same pr= oblem. >> - I'm reporting this from OSX 10.14.6 (homebrew), but it also occu= rs on >> Arch Linux (emacs being installed from the standard pacman repos= ). > > Stefan, any suggestions wrt this? The backtrace is: Debugger entered--Lisp error: (error "Error in syntax_table logic for to-th= e-end interva...") forward-word(2) funcall-interactively(forward-word 2) call-interactively(forward-word nil nil) Slightly easier recipe: Open that file, `M-x subword-mode', and then navigate to while (gettoken() =3D=3D PARENS || TokenType =3D=3D BRACKETS) { `C-x n d', put point after BRACKETS and then say `M-2 M-f'. Then you get that error message. Just `M-f' works fine. I tried to narrow this down to a simpler file, but I was unable to -- it seems like the error depends on lots of state in that specific file.