From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriele Nicolardi Newsgroups: gmane.emacs.bugs Subject: bug#67124: 26.3; query-replace Arg out of range with comma option (at end-buffer) Date: Sat, 11 Nov 2023 20:40:27 +0100 Message-ID: <020a72b2-b896-4ecf-abab-111a6c1c9eac@medialab.sissa.it> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8210"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 67124@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 12 08:51:56 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r25G8-0001u8-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Nov 2023 08:51:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r25Fd-0003Vf-1g; Sun, 12 Nov 2023 02:51:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r25Fa-0003V6-UR for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 02:51:22 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r25Fa-00066V-MS for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 02:51:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r25GF-0008AR-Eq for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 02:52:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gabriele Nicolardi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2023 07:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67124 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169977547131290 (code B ref -1); Sun, 12 Nov 2023 07:52:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2023 07:51:11 +0000 Original-Received: from localhost ([127.0.0.1]:55030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r25FN-00088V-Os for submit@debbugs.gnu.org; Sun, 12 Nov 2023 02:51:10 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:50924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1trD-0005Hl-O1 for submit@debbugs.gnu.org; Sat, 11 Nov 2023 14:41:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1tqR-0006wC-88 for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 14:40:39 -0500 Original-Received: from smtp04.cbsolt.net ([185.97.217.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1tqO-0002eQ-WD for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 14:40:38 -0500 Original-Received: from [10.0.2.15] (host-82-60-177-34.retail.telecomitalia.it [82.60.177.34]) by smtp04.cbsolt.net (Postfix) with ESMTPSA id 4SSQyh5yM9z3wbv for ; Sat, 11 Nov 2023 20:40:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1699731629; bh=lsZA45SwU4ePu39xBinRdLfQ4w7A6UPFPIxwz+YMK1g=; h=Date:To:Subject:From:From; b=QZjOXsRdFZ9xkTztvWFUHP7TE3knd2kFFWqtvCMzAarP9T+Tmqmk8pdPfCQq8blsL aqEKsTf0asN66NIFZb5QtN73SfJeE2E8f+728Cfh3XgAbkcz0mLXmBON0NJu5tI+ZW XI7CGGpJlDP4CXhzveolK93JrZYqXNxXaZRmEM68= Content-Language: en-US Received-SPF: pass client-ip=185.97.217.43; envelope-from=gabriele@medialab.sissa.it; helo=smtp04.cbsolt.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 12 Nov 2023 02:51:04 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274188 Archived-At: Hi, I'm resending the bug report trying to do better than the previous one. When I run `query-replace-regexp` command if I type `?` I get this explanation of the function's options: Type Space or ‘y’ to replace one match, Delete or ‘n’ to skip to next, RET or ‘q’ to exit, Period to replace one match and exit, Comma to replace but not move point immediately, C-r to enter recursive edit (C-M-c to get out again), C-w to delete match and recursive edit, C-l to clear the screen, redisplay, and offer same replacement again, ! to replace all remaining matches in this buffer with no more questions, ^ to move point back to previous match, u to undo previous replacement, U to undo all replacements, E to edit the replacement string. In multi-buffer replacements type ‘Y’ to replace all remaining matches in all remaining buffers with no more questions, ‘N’ to skip to the next buffer without replacing remaining matches in the current buffer. I often type `,` (`comma`) to check the replacement. It happens that, some times, I get the error (e.g.): match-substitute-replacement: Args out of range: #, 1667, 1679 The error doesn't happen if I type `y` (or `n`) Try this: (query-replace ",.\\footnote{" ".\\footnote{" nil) With the string ",.\footnote{" at the end of the buffer. To see the error "{" must be the last char in the buffer. (I see often this bug because I use "narrowing" a lot) Is it a known bug? My emacs version is GNU Emacs 26.3. In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian built on lcy01-amd64-020 Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.6 LTS Recent messages: Mark set next-line: End of buffer Mark set funcall-interactively: End of buffer Quit Mark set Entering debugger... Mark set previous-line: Beginning of buffer Mark set previous-line: Beginning of buffer Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-mEZBk7/emacs-26.3+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: it_IT.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq dired dired-loaddefs format-spec rfc822 ...) Memory information: ((conses 16 97042 8905) (symbols 48 20561 1) (miscs 40 86 120) (strings 32 28945 1187) (string-bytes 1 762727) (vectors 16 14159) (vector-slots 8 504582 10748) (floats 8 56 120) (intervals 56 316 55) (buffers 992 12))