unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Josh <josh@foxtail.org>
To: Juri Linkov <juri@jurta.org>
Cc: Tom <adatgyujto@gmail.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: History for query replace pairs
Date: Sat, 9 Aug 2014 18:18:56 -0700	[thread overview]
Message-ID: <CANdFEAHNivteExwdX1oO=-i409nyXg_Rv-O5Z4ZFoA+NB=ySJA@mail.gmail.com> (raw)
In-Reply-To: <87a97ejxuo.fsf@mail.jurta.org>

[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]

On Fri, Aug 8, 2014 at 4:38 PM, Juri Linkov <juri@jurta.org> wrote:

> > The question is: how could it be integrated into the current
> > query-replace interface, that is how could the user choose
> > from a history of defaults (if he does not want to choose the
> > latest default which he can access with RET).
>
> Since the default values are displayed in a special format
> using an arrow
>
>   Query replace (default from1 -> to1):
>
> a history navigation key should bring the pair into the minibuffer
> in the same format like
>
>   Query replace (default from1 -> to1): from2 -> to2
>

I've often wished for the sort of pair-wise history Tom described
myself, and thought a bit about possible UIs.  So far, the idea I
find most appealing is a history ring whose elements are
single-line yasnippet-style snippets with `from' and `to' fields
that defaulted to the values for that history element.  So after
the first M-p the minibuffer could look something like
  Query replace (TAB for next field, RET to accept): [|from1] -> [to1]
with the point at the start of the from1 field.  Entering any text
would replace from1, while hitting TAB would advance the point
to the to1 field, which would behave similarly.  Entering RET
at any time would commit the current from and to values in
whatever state they were in.  Subsequent M-p's would cycle
through previous pairs as you would expect.  Hitting RET
immediately after any M-p would accept the current default
pair and replacing or editing one or both fields would be
convenient as well.

I'm afraid I have no clue about how to go about implementing
such behavior though :)

Josh

[-- Attachment #2: Type: text/html, Size: 2259 bytes --]

  parent reply	other threads:[~2014-08-10  1:18 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 20:20 History for query replace pairs Tom
2014-08-08 20:28 ` Drew Adams
2014-08-08 23:38 ` Juri Linkov
2014-08-09  5:35   ` Herring, Davis
2014-08-10  1:18   ` Josh [this message]
2014-08-10  5:59     ` Tom
2014-08-11 18:34       ` Tom
2014-10-04 21:45         ` Ted Zlatanov
2014-10-04 23:36           ` Juri Linkov
2014-10-05  1:52             ` Yuri Khan
2014-10-05 21:54               ` Juri Linkov
2014-10-05  7:09             ` Andreas Schwab
2014-10-05  1:52           ` Stefan Monnier
2014-10-05  5:59           ` Tom
2014-10-06  0:46             ` Ted Zlatanov
2014-10-06 20:17               ` Tom
2014-10-06 22:35               ` Juri Linkov
2014-10-07 22:11                 ` Juri Linkov
2014-10-14 17:14                   ` Stefan Monnier
2014-10-14 19:02                     ` Juri Linkov
2014-10-14 19:13                       ` Alan Mackenzie
2014-10-14 19:44                         ` Juri Linkov
2014-10-14 20:15                           ` Alan Mackenzie
2014-10-14 20:16                           ` Drew Adams
2014-10-14 20:28                             ` Juri Linkov
2014-10-14 21:19                               ` Drew Adams
2014-10-14 20:05                         ` Andreas Schwab
2014-10-14 20:09                           ` Alan Mackenzie
2014-10-14 20:23                             ` Andreas Schwab
2014-10-21 18:23                       ` Stefan Monnier
2014-10-21 22:53                         ` Juri Linkov
2014-10-22 12:58                           ` Stefan Monnier
2014-10-23  9:06                             ` Artur Malabarba
2014-10-25 20:57                               ` Juri Linkov
2014-10-26  1:12                                 ` Artur Malabarba
2014-10-26  2:31                                   ` Stefan Monnier
2014-10-26  6:58                                   ` Andreas Schwab
2014-10-25 20:52                             ` Juri Linkov
2014-10-26  2:29                               ` Stefan Monnier
2014-10-26 23:27                                 ` Juri Linkov
2014-11-03 13:30                               ` Ted Zlatanov
2014-11-03 23:46                                 ` Juri Linkov
2014-11-04  0:59                                   ` Ted Zlatanov
2014-11-04 23:09                                     ` Juri Linkov
2014-11-05  1:55                                       ` Stefan Monnier
2014-11-05 23:20                                         ` Juri Linkov
2014-11-06  2:35                                           ` Stefan Monnier
2014-11-07 23:34                                             ` Juri Linkov
2014-11-08  0:59                                               ` Ted Zlatanov
2014-11-08  8:46                                                 ` Eli Zaretskii
2014-11-08 10:29                                                   ` Juri Linkov
2014-11-08 11:24                                                     ` Eli Zaretskii
2014-11-08 15:28                                                       ` Stefan Monnier
2014-11-08 17:29                                                         ` Eli Zaretskii
2014-11-08 22:52                                                         ` Juri Linkov
2014-11-09  2:01                                                           ` Stefan Monnier
2014-11-09 16:15                                                             ` Eli Zaretskii
2014-11-09 17:11                                                               ` Juri Linkov
2014-11-09 22:14                                                                 ` Stefan Monnier
2014-11-09 23:12                                                                   ` Juri Linkov
2014-11-09 22:10                                                               ` Stefan Monnier
2014-11-09  2:29                                                           ` Paul Eggert
2014-11-09 17:15                                                             ` Juri Linkov
2014-11-08 22:51                                                       ` Juri Linkov
2014-11-09 17:29                                                         ` Eli Zaretskii
2014-11-08 10:15                                                 ` Juri Linkov
2014-11-08  8:25                                               ` Eli Zaretskii

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='CANdFEAHNivteExwdX1oO=-i409nyXg_Rv-O5Z4ZFoA+NB=ySJA@mail.gmail.com' \
    --to=josh@foxtail.org \
    --cc=adatgyujto@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /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).