unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 41692@debbugs.gnu.org
Subject: bug#41692: 26.3; Enhancement request, `query-replace': let user use text at point as default
Date: Fri, 05 Jun 2020 01:05:27 +0300	[thread overview]
Message-ID: <878sh2lctc.fsf@mail.linkov.net> (raw)
In-Reply-To: <ba336808-1c07-4604-a5ec-3a39272f4fdc@default> (Drew Adams's message of "Wed, 3 Jun 2020 16:22:52 -0700 (PDT)")

> I see, for `C-M-%', only these two defaults:
>
> 1. A word at point (e.g. `foo'),
> 2. A regexp that matches a symbol at point (e.g. `\_<foo\_>'.
>
> But yes, that's better than nothing - a good start.
> `query-replace' could likewise use some love.

I agree that `query-replace' should at least do the same as
`query-replace-regexp', and `query-replace-regexp' could be extended.
Currently `query-replace-read-from' has:

                (if regexp-flag
                    (read-regexp prompt nil 'minibuffer-history)
                  (read-from-minibuffer
                   prompt nil nil nil nil (car search-ring) t))

It's easy to extend `read-regexp' with more options,
but what to do for non-regexp case?

Maybe to try to use `read-string' and extend it with more M-n options
like in `read-regexp'.





  reply	other threads:[~2020-06-04 22:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 18:35 bug#41692: 26.3; Enhancement request, `query-replace': let user use text at point as default Drew Adams
2020-06-03 22:54 ` Juri Linkov
2020-06-03 23:22   ` Drew Adams
2020-06-04 22:05     ` Juri Linkov [this message]
2020-06-04 23:01       ` Drew Adams
2020-06-11 22:58         ` Juri Linkov
2020-06-12  0:34           ` Drew Adams
2020-06-12  0:46             ` Drew Adams
2021-01-27 18:33               ` Juri Linkov
2021-01-27 18:55                 ` bug#41692: [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878sh2lctc.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=41692@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).