From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: A better UI than perform-replace Date: Thu, 19 Nov 2015 14:03:29 -0800 (PST) Message-ID: <4153be56-d881-4e31-a28e-e11f0333bacd@default> References: <56480D6C.2080408@yandex.ru> <876112xj2i.fsf@gmail.com> <87vb90yum7.fsf@mail.linkov.net> <87egfl6acs.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1447970653 12734 80.91.229.3 (19 Nov 2015 22:04:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 22:04:13 +0000 (UTC) Cc: Juri Linkov , emacs-devel , Oleh Krehel , Dmitry Gutov To: David Kastrup , John Yates Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 23:04:00 2015 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 1ZzXJ9-0003aK-If for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 23:03:59 +0100 Original-Received: from localhost ([::1]:44224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzXJ8-0006Lo-OP for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 17:03:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzXIt-0006Lh-RN for emacs-devel@gnu.org; Thu, 19 Nov 2015 17:03:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzXIq-00085Y-FC for emacs-devel@gnu.org; Thu, 19 Nov 2015 17:03:43 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:50543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzXIq-00080X-7o; Thu, 19 Nov 2015 17:03:40 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tAJM3X6m012515 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Nov 2015 22:03:33 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tAJM3VrB022346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 19 Nov 2015 22:03:31 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tAJM3VZv030286; Thu, 19 Nov 2015 22:03:31 GMT In-Reply-To: <87egfl6acs.fsf@fencepost.gnu.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:194823 Archived-At: > > 4) respond to the query-replace prompt > > Following 4) token replacement occurs and the display updates to > > the next match. >=20 > Wrong response to the query-replace prompt then. Exactly. > Type Space or =E2=80=98y=E2=80=99 to replace one match, Delete or =E2= =80=98n=E2=80=99 to skip to next, > RET or =E2=80=98q=E2=80=99 to exit, Period to replace one match and e= xit, > Comma to replace but not move point immediately, > C-r to enter recursive edit (C-M-c to get out again), > C-w to delete match and recursive edit, > C-l to clear the screen, redisplay, and offer same replacement again, > ! to replace all remaining matches in this buffer with no more > questions, > ^ to move point back to previous match, > E to edit the replacement string. > In multi-buffer replacements type =E2=80=98Y=E2=80=99 to replace all = remaining > matches in all remaining buffers with no more questions, > =E2=80=98N=E2=80=99 to skip to the next buffer without replacing rema= ining matches > in the current buffer. >=20 > So you should have typed a comma. >=20 > Or, once you consider yourself foiled, follow the "press ? for help" > prompt and discover "^ to move point back to previous match". Not to mention that the very first paragraph of `C-h k M-%' says: Replace some occurrences of FROM-STRING with TO-STRING. As each match is found, the user must type a character saying what to do with it. For directions, type C-h at that time. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ And yes, newbies too (nay, newbies _especially_) should learn first _how to ask Emacs_. And having learned that, they should _ask Emacs_ first. It's really not complicated to ask Emacs what `M-%' does: `C-h k M-%'. And it should really not be hard to see "For directions, type C-h" up front. And if you do hit `C-h' (or `?'), it should really not be hard to understand how to replace without moving to the next search hit. (But maybe the text should say "Comma (`,')..." instead of "Comma...". Oh, and each of the keys should be enclosed in quotes, or else none of them should be, IMO.) Every tutorial and intro to Emacs should start with a basic lesson about how to _ask Emacs_. (And every intermediate lesson about Emacs should include deeper info about how to ask Emacs about itself, including Elisp.) I already agreed that an enhancement of `occur' along the lines of what Oleh suggested should be a welcome addition. But I disagree about it being difficult to understand or discover the behavior of `query-replace' (`M-%') - assuming that you've learned about `C-h k'. And as David points out, even if you do not check `C-h k M-%', the prompt itself tells you, over and over, that you can "press `?' for help". How someone could claim that the behavior is difficult to discover is beyond me. (But people are different.)