GNU bug report logs - #78038
26.3; query-replace

Previous Next

Package: emacs;

Reported by: Niclas Olsson <olsson_lund <at> yahoo.com>

Date: Thu, 24 Apr 2025 14:41:03 UTC

Severity: normal

Found in version 26.3

To reply to this bug, email your comments to 78038 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Thu, 24 Apr 2025 14:41:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niclas Olsson <olsson_lund <at> yahoo.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 Apr 2025 14:41:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Niclas Olsson <olsson_lund <at> yahoo.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.3; query-replace
Date: Thu, 24 Apr 2025 09:31:54 +0000 (UTC)
[Message part 1 (text/plain, inline)]
Hi gnu/emacs,
first: thank you all for many years of providing a great editor.
last: sorry to say but my patience with emacs >23.1 is almost gone
PLEASE, PLEASE; PLEASE start putting new behaviors disabled.The query-replace (default FROM -> TO) is a major disaster.I do not want FROM -> TO suggestions and no matter what I tryand spend on googling this crap I cant turn it off.Have you ever imagined to try out a very long FROM stringand then want to do another search/replace after???For some yers I have actually been trying more and more to leaveemacs for good, it is closing in to the the swap.The last really decent version was 23.1 something.Every single new version simply just adds more and more strangenessand more meaningless settings to figure out. I have work to do...The faces is also simply just annouying. Now left with a too darkbuffer name of the inactive buffer when having two verticals one.Cant hardly read what file is opened in the inactive before I clickin it to activate it. Have been emacs fan since 2004 but...
I have tried all setq on the:
query-replace-defaults        query-replace-from-history-variablequery-replace-from-to-separator        query-replace-helpquery-replace-highlight        query-replace-historyquery-replace-interactive        query-replace-lazy-highlightquery-replace-map        query-replace-show-replacementquery-replace-skip-read-only        query-replace-to-history-variable
but I simply cant get rid of the very annoying, totally unnecessary:(default FROM -> TO). Some settings to nil brakes everything and nothing seems to turn off something no one really needs...
The UTF handling is still after many years a constant pain which destroyssome files having swedish characters in them, iso-8859-1 is not workingcorrectly anymore.
I use emacs:privately (NT emacs on win10, a very old one but does the job)professionally: every single day. Due to all different versions I often
nowadays faces emacs behaviors I do not ask for or wants. Old  versionssilently disappears from linux distos and leaveas me and many othersscratching our heads what emacs strangeness now has been introduced inthis newer version...
Reagrds Niclas Olsson, Sweden

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Thu, 24 Apr 2025 16:09:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Niclas Olsson via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: Niclas Olsson <olsson_lund <at> yahoo.com>, 78038 <at> debbugs.gnu.org
Subject: Re: bug#78038: 26.3; query-replace
Date: Thu, 24 Apr 2025 18:08:26 +0200
On Thu, 24 Apr 2025 09:31:54 +0000 (UTC) Niclas Olsson via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> wrote:
[...]
> The query-replace (default FROM -> TO) is a major disaster.
> I do not want FROM -> TO suggestions and no matter what I try
> and spend on googling this crap I cant turn it off.
> Have you ever imagined to try out a very long FROM string
> and then want to do another search/replace after???
[...]
> I have tried all setq on the:
>
> query-replace-defaults
>         query-replace-from-history-variable
> query-replace-from-to-separator
>         query-replace-help
> query-replace-highlight
>         query-replace-history
> query-replace-interactive
>         query-replace-lazy-highlight
> query-replace-map
>         query-replace-show-replacement
> query-replace-skip-read-only
>         query-replace-to-history-variable
>
> but I simply cant get rid of the very annoying, totally unnecessary:
> (default FROM -> TO). [...]

Making query-replace-read-from-default return the empty string seems to
work; try adding this to your ~/.emacs file:

(setq query-replace-read-from-default (lambda () (make-string 0 32)))

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Thu, 24 Apr 2025 16:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Thu, 24 Apr 2025 16:14:03 GMT) Full text and rfc822 format available.

Message #14 received at 78038 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Niclas Olsson via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: Niclas Olsson <olsson_lund <at> yahoo.com>, 78038 <at> debbugs.gnu.org
Subject: Re: bug#78038: 26.3; query-replace
Date: Thu, 24 Apr 2025 18:13:39 +0200
Niclas Olsson via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Hi gnu/emacs,

[...]

> I have tried all setq on the:

[...]

Hi,

It seems that setting the following does what you want:

(setq query-replace-read-from-default (lambda () ""))

I found this by reading the code since it is not a well documented
custom.  Maybe, we should have one (?)
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Thu, 24 Apr 2025 16:15:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78038; Package emacs. (Fri, 25 Apr 2025 09:10:01 GMT) Full text and rfc822 format available.

Message #20 received at 78038 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Niclas Olsson <olsson_lund <at> yahoo.com>
Cc: "Niclas Olsson via \"Bug reports for GNU Emacs,  the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>, Manuel Giraud <manuel <at> ledu-giraud.fr>,
 78038 <at> debbugs.gnu.org <78038 <at> debbugs.gnu.org>
Subject: Re: bug#78038: 26.3; query-replace
Date: Fri, 25 Apr 2025 11:08:59 +0200
Niclas Olsson <olsson_lund <at> yahoo.com> writes:

>  Hi gnu/emacs!
> Thanks a lot for the quick reply I got. I have tried out both:
> (setq query-replace-read-from-default (lambda () ""))
> and the 
> (setq query-replace-read-from-default (lambda () (make-string 0 32)))
> Unfortunately the irritating (default FROM -> TO) still shows...I also
> did try to read and follow the code but limited in LISP knowledge and
> I didn't find anything which I didn't already try.

You'd have to tell us more about which emacs version you're using.
Those variables were introduced by commit
749ba35bf5e0974384550a0763fd27f08db0678c on Feb 1 2022.

So this probably works since version 28.2.
-- 
Manuel Giraud




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.