From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4981: C-l during query-replace Date: Sun, 29 Nov 2009 22:29:59 -0800 (PST) Message-ID: <200911300629.nAU6Txdn009909@godzilla.ics.uci.edu> References: <200911200016.nAK0Gxf5005670@godzilla.ics.uci.edu> <873a49ad0f.fsf@mail.jurta.org> <87fx7w7v6p.fsf@mail.jurta.org> Reply-To: Dan Nicolaescu , 4981@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259563808 16279 80.91.229.12 (30 Nov 2009 06:50:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Nov 2009 06:50:08 +0000 (UTC) Cc: 4981@emacsbugs.donarmstrong.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 30 07:50:01 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NF058-0007jx-Ah for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Nov 2009 07:49:58 +0100 Original-Received: from localhost ([127.0.0.1]:46138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NF057-0001XV-W4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Nov 2009 01:49:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NF02n-0008St-AE for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2009 01:47:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NF02i-0008Q6-V7 for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2009 01:47:32 -0500 Original-Received: from [199.232.76.173] (port=55727 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NF02i-0008Pp-Fu for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2009 01:47:28 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55661) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NF02h-00075p-Ql for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2009 01:47:28 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAU6lNGd005383; Sun, 29 Nov 2009 22:47:23 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAU6Z5Ul004090; Sun, 29 Nov 2009 22:35:05 -0800 Resent-Date: Sun, 29 Nov 2009 22:35:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 30 Nov 2009 06:35:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4981 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4981-submit@emacsbugs.donarmstrong.com id=B4981.12595626133731 (code B ref 4981); Mon, 30 Nov 2009 06:35:05 +0000 Original-Received: (at 4981) by emacsbugs.donarmstrong.com; 30 Nov 2009 06:30:13 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAU6UB95003634 for <4981@emacsbugs.donarmstrong.com>; Sun, 29 Nov 2009 22:30:12 -0800 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nAU6U09K015433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Nov 2009 22:30:00 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAU6Txdn009909; Sun, 29 Nov 2009 22:29:59 -0800 (PST) In-Reply-To: <87fx7w7v6p.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 30 Nov 2009 01:44:30 +0200") Original-Lines: 64 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAU6U09K015433 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 30 Nov 2009 01:47:32 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33054 Archived-At: Juri Linkov writes: > > I guess there are many other places that need replacing with the new > > command (e.g. `gnus-recenter'). > > I fixed `gnus-recenter' in gnus-sum.el. > > > But with the patch I proposed in > > http://thread.gmane.org/gmane.emacs.devel/110349/focus=115915 > > the name `recenter-top-bottom' makes no sense anymore. > > Maybe we should rename it to something more suitable > > before replacing `recenter' calls with the new name everywhere? > > Installed. Currently I have no opinion about renaming > `recenter-top-bottom' to something more reasonable. > > >> C-l during query-replace should run `recenter-top-bottom', not > >> `recenter' for consistency with what C-l normally does nowadays. > > I can't find a clean solution because in the case of query-replace, > `this-command' is always `query-replace'. > > This patch kinda works (though it doesn't reset the cycling order), > but I don't like this. > > Index: lisp/window.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/window.el,v > retrieving revision 1.190 > diff -u -r1.190 window.el > --- lisp/window.el 29 Nov 2009 23:34:09 -0000 1.190 > +++ lisp/window.el 29 Nov 2009 23:42:30 -0000 > @@ -1654,7 +1654,8 @@ > (arg (recenter arg)) ; Always respect ARG. > (t > (setq recenter-last-op > - (if (eq this-command last-command) > + (if (or (eq this-command last-command) > + (eq this-command 'query-replace)) > (car (or (cdr (member recenter-last-op recenter-positions)) > recenter-positions)) > (car recenter-positions))) > > Index: lisp/replace.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/replace.el,v > retrieving revision 1.287 > diff -u -r1.287 replace.el > --- lisp/replace.el 12 Nov 2009 06:55:43 -0000 1.287 > +++ lisp/replace.el 29 Nov 2009 23:43:28 -0000 > @@ -1785,7 +1788,9 @@ > ((eq def 'skip) > (setq done t)) > ((eq def 'recenter) > - (recenter nil)) > + (recenter-top-bottom)) > ((eq def 'edit) > (let ((opos (point-marker))) > (setq real-match-data (replace-match-data Thanks for fixing this. Are you sure that the new `recenter-positions' is needed? Given that there are 3 choices, it's easy to cycle through them, so adding yet another defcustom that would be use by a very small number of users does not seem justified (IMHO).