Thank you for your help. I cannot reproduce the error in my computer's original version of Emacs, 22.1.1. I don't know why. What OS and Tex version did you use when trying to replicate the error? If the error cannot be replicated on a computer using the latest versions of Emacs and MacTex, neither installed with Homebrew, then I agree that Homebrew is somehow causing the issue. Best regards, Theodore Ehrenborg Den lör 20 juli 2019 kl 05:59 skrev Eli Zaretskii : > tags 36696 unreproducible > thanks > > > From: Theodore Ehrenborg > > Date: Tue, 16 Jul 2019 16:22:44 -0400 > > > > Type emacs -Q > > Use C-x C-f to open a new file called test.tex > > Type the following three lines in test.tex: > > \foo > > foo > > foo > > (The first line is '\foo', not 'foo') > > Then go to the beginning of the file with M-< > > and use M-% to begin query-replace > > Try to replace 'foo' with 'foo'. > > When prompted for the first line, > > type 'y' to replace. > > Then emacs returns an error: > > Args out of range: #, 0, 1 > > > > I'm using the most recent installation of MacTex and emacs. > > Both were installed with Homebrew. > > I cannot reproduce this in Emacs 26.2, 26.2.90, and 27 built from > sources. > > Maybe it's specific to MacTex and Emacs installed with Homebrew. >