From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: History for query replace pairs Date: Sun, 05 Oct 2014 02:36:57 +0300 Organization: JURTA Message-ID: <87mw9b8l0m.fsf@mail.jurta.org> References: <87a97ejxuo.fsf@mail.jurta.org> <87lhovik5c.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412466082 14383 80.91.229.3 (4 Oct 2014 23:41:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2014 23:41:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 05 01:41:15 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 1XaYwr-0004w8-Ej for ged-emacs-devel@m.gmane.org; Sun, 05 Oct 2014 01:41:13 +0200 Original-Received: from localhost ([::1]:45627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaYwr-0000kz-0t for ged-emacs-devel@m.gmane.org; Sat, 04 Oct 2014 19:41:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaYwi-0000ks-DC for emacs-devel@gnu.org; Sat, 04 Oct 2014 19:41:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaYwc-0001IM-9j for emacs-devel@gnu.org; Sat, 04 Oct 2014 19:41:04 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.222.226]:46408 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaYwc-0001I7-3l for emacs-devel@gnu.org; Sat, 04 Oct 2014 19:40:58 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D55B13061F6726 for ; Sat, 4 Oct 2014 16:40:55 -0700 (PDT) In-Reply-To: <87lhovik5c.fsf@lifelogs.com> (Ted Zlatanov's message of "Sat, 04 Oct 2014 17:45:35 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.163.222.226 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:174974 Archived-At: > T> I created a quick proof of concept implementation. It changes the behavior > T> of the arrow keys for the query-replace(-regexp) FROM prompt. You can stll > T> access the original behavior with M-p/n. > > T> So when you start a query-replace and press the up arrow then > T> search/replace history is rendered as FROM -> TO pairs. The -> marker is > T> highlighted and intangible, the cursor jumps over it and you are free to > T> edit the search/replace string. If you submit a FROM->TO pair from the FROM > T> input field with RET then the replacement is started immediately. If you > T> submit a simple string (without the marker) then it behaves as usual and > T> asks for a TO string. > > I'd like to make this part of the Emacs core, disabled by default. Any > objections? I think it's nicer-looking than the current UI. > > If not, maybe Tom would like to make it a GNU ELPA package? I realized right now that the most intuitive and convenient way is to implement a new general function to read two values in the minibuffer with two entry fields. These fields could be like in Widget/Customization UI where the user can switch the entry point between two fields. Anything between them would be read-only like the current prompt is, e.g. Query replace: [from] with: [to] where [from] and [to] are entry fields. `M-p' will update these two fields with the previous values from the history.