From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.devel Subject: Re: History for query replace pairs Date: Sat, 9 Aug 2014 18:18:56 -0700 Message-ID: References: <87a97ejxuo.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b4725eaaeb32f05003c3a34 X-Trace: ger.gmane.org 1407633588 27919 80.91.229.3 (10 Aug 2014 01:19:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Aug 2014 01:19:48 +0000 (UTC) Cc: Tom , emacs-devel To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 10 03:19:41 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XGHnQ-0007s1-Lr for ged-emacs-devel@m.gmane.org; Sun, 10 Aug 2014 03:19:40 +0200 Original-Received: from localhost ([::1]:57951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGHnP-00049c-WF for ged-emacs-devel@m.gmane.org; Sat, 09 Aug 2014 21:19:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGHnI-00049T-K1 for emacs-devel@gnu.org; Sat, 09 Aug 2014 21:19:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGHnD-0007Ah-I6 for emacs-devel@gnu.org; Sat, 09 Aug 2014 21:19:32 -0400 Original-Received: from mail-oa0-f47.google.com ([209.85.219.47]:56223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGHnD-0007Ad-Cw for emacs-devel@gnu.org; Sat, 09 Aug 2014 21:19:27 -0400 Original-Received: by mail-oa0-f47.google.com with SMTP id g18so5161420oah.20 for ; Sat, 09 Aug 2014 18:19:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=hhlmNVdfiEQd0Kb0X1nxgwLAJUA2vG9KqDCy8eltZ6g=; b=N+Wjp6MFMJvUZeSiLf+9Eb/ZpRRVloxr6Gbc3rzNzmLfxHf06/V54uwPEmbKy4twcj /06CJKZO0zAp5BkicVnwlyR1PCtOWuRNYtjEhyGtLWbNzyHD5v05cYgzBVCbVLw+gpF4 7sTntweY7IGSzBW5LFJHl9xoGrU1l7ug9splaMbL5oCpqegDbY9WYgxAOVOjcDsLdpLv 2LPmVL7NS7iqb6QpDXRBYeSxpYRYqCmTKWNhuOL0vZcItt1scRj+V2YJDqN8TBiztaUs o8joieKKkexCDZZuHMr61Y0nAinE/4H0h4T2q8vq5pOmMG6MhC6lv3T0eZudl5X78dDK DDMg== X-Gm-Message-State: ALoCoQkbAz38XouIG4t5CfANZmw7O2dfmQXU0S23SJihqZAdeuKVpxmhcJ3kpSlrYzS4i+N3fFJV X-Received: by 10.60.140.234 with SMTP id rj10mr39758108oeb.6.1407633566112; Sat, 09 Aug 2014 18:19:26 -0700 (PDT) Original-Received: by 10.202.74.84 with HTTP; Sat, 9 Aug 2014 18:18:56 -0700 (PDT) In-Reply-To: <87a97ejxuo.fsf@mail.jurta.org> X-Google-Sender-Auth: i0SqwzF5wFwzunQkiBODiB3_tDc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.219.47 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173530 Archived-At: --047d7b4725eaaeb32f05003c3a34 Content-Type: text/plain; charset=UTF-8 On Fri, Aug 8, 2014 at 4:38 PM, Juri Linkov 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 --047d7b4725eaaeb32f05003c3a34 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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 c= urrent
> 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

=C2=A0 Query replace (default from1 -> to1):

a history navigation key should bring the pair into the minibuffer
in the same format like

=C2=A0 Query replace (default from1 -> to1): from2 -> to2

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

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

Josh

--047d7b4725eaaeb32f05003c3a34--