Subject: bug#67050: closed (Re: bug#67124: 26.3; query-replace Arg out of range with comma option (at end-buffer))

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 15 Nov 2023 16:08:06 +0000

Your bug report

#67124: 26.3; query-replace Arg out of range with comma option (at end-buffer)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67124: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67124
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#67124: 26.3; query-replace Arg out of range with comma option (at end-buffer)
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Wed, 15 Nov 2023 15:18:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> Date: Sun, 12 Nov 2023 11:48:17 +0200
> From: Eli Zaretskii <[email-masked]>
> 
> > 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: #<buffer *scratch*>, 
> > 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?
> 
> The kludgey solution in the patch below should fix this.  Please see
> if it indeed fixes your real-life use cases.

I've now installed this on master, and I'm closing this bug.

Subject: 26.3; query-replace Arg out of range with comma option (at end-buffer)
From: Gabriele Nicolardi <[email-masked]>
To: [email-masked]
Date: Fri, 10 Nov 2023 17:35:58 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi, I described the issue on Stackexchange:

https://emacs.stackexchange.com/q/79436/15606

I hope that's enough to replicate the problem.

Please let me know if you require any further information. Your prompt 
attention to this matter is highly valued.

Gabriele Nicolardi

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:
Undo! [5 times]
fix-mult-punct-before-footnote
Mark set
La punteggiatura ripetuta contiene simboli eterogenei.
Scegli quale simbolo mantenere tra "." e ",",
La punteggiatura ripetuta contiene simboli eterogenei.
Scegli quale simbolo mantenere tra "," e ".",
Replaced 0 occurrences
Making completion list...
Type C-x 1 to delete the help window.
Quit
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:
diff-auto-refine-mode: t
shell-dirtrack-mode: t
show-paren-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
mouse-wheel-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
column-number-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
/home/gabriele/SissaMedialab/elisp/queries-helper hides 
~/typeset/elisp/queries-helper
/home/gabriele/SissaMedialab/elisp/config hides ~/typeset/elisp/config
/home/gabriele/SissaMedialab/elisp/google-search hides 
~/typeset/elisp/google-search
~/typeset/elisp/footnote hides /usr/share/emacs/26.3/lisp/mail/footnote

Features:
(shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml
mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr ibuf-ext ibuffer
ibuffer-loaddefs jka-compr cl-extra find-dired dired dired-loaddefs grep
eieio-opt speedbar sb-image ezimage dframe find-func help-fns radix-tree
help-mode cl-print debug texmathp misearch multi-isearch hi-lock server
vc-git diff-mode ieee-abbrevs queries-from-guidelines xml-tools
typ-editing-mode typ-lib tested-macros experimental-macros
proofs-editing-mode layout-and-checks-mode
biblio-fix-multiple-refs-interactive xml biblio-arXivnumber-from-title
biblio-duplicate-bibitem-hunter biblio-toggle-bibitems-overlay-numbering
biblio-j-names-formatter biblio-uncomment-bibitem-at-point cl json-mode
json-snatcher js advice sgml-mode dom json map imenu thingatpt cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs request autorevert filenotify mail-utils
biblio-proceedings-fix-where-when biblio-macros
biblio-revert-author-titles biblio-pybib-cleaner biblio-pybib-execute
typ-macros typ-predicates biblio-tools biblio-editing-min-mode
biblio-mode-defvars biblio-editing-mode biblio-links-mode
equations-static-refs-to-links maths-editing-tools maths-editing-mode
easy-mmode preamble-editing-mode figures-files-tools proofs-tex4author
unwrapper region-to-pdf production-macros tex-mode compile shell
pcomplete comint ansi-color ring latexenc elec-pair typ-backup-tools
typ-defvars typ-functions typ-custom-macros edmacro kmacro google-search
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap windmove finder-inf rx package epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cus-edit easymenu wid-edit cl-loaddefs cl-lib paren
cus-start cus-load time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer 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 dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 528466 58997)
(symbols 48 33025 5)
(miscs 40 1111 2179)
(strings 32 77031 3414)
(string-bytes 1 2274171)
(vectors 16 32963)
(vector-slots 8 1365680 143002)
(floats 8 93 663)
(intervals 56 33566 1183)
(buffers 992 24))