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: Should ending successful Isearch with C-g restore the relative window position? Date: Wed, 16 Jan 2013 14:16:41 -0800 Message-ID: References: <7E5B63603B074626914E5DAEB90E738B@us.oracle.com><83fw23qf57.fsf@gnu.org><1712F3B8AF3D49DD9AC9F829FF560543@us.oracle.com><834niiqubh.fsf@gnu.org><75F694ACD7DA4E0482195A15331657BA@us.oracle.com><83zk0ape2h.fsf@gnu.org><3F79EED6372147F5AAC4F6EC7A02A18E@us.oracle.com> <87hamgker0.fsf_-_@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358374620 21546 80.91.229.3 (16 Jan 2013 22:17:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 22:17:00 +0000 (UTC) Cc: 'Eli Zaretskii' , emacs-devel@gnu.org, dmoncayo@gmail.com To: "'Juri Linkov'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 16 23:17:18 2013 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 1TvbIG-00071P-J6 for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2013 23:17:12 +0100 Original-Received: from localhost ([::1]:33357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvbHz-0006Ey-Vo for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2013 17:16:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvbHx-0006Er-7k for emacs-devel@gnu.org; Wed, 16 Jan 2013 17:16:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvbHw-0005AG-88 for emacs-devel@gnu.org; Wed, 16 Jan 2013 17:16:53 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvbHu-00059i-JO; Wed, 16 Jan 2013 17:16:50 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r0GMGiOt032442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Jan 2013 22:16:45 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r0GMGhIa023322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jan 2013 22:16:44 GMT Original-Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r0GMGhxq009881; Wed, 16 Jan 2013 16:16:43 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 Jan 2013 14:16:43 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87hamgker0.fsf_-_@mail.jurta.org> Thread-Index: Ac30MMvk6uBAGKW+TO6UXjGDH2eQVQAA2aeQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] 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:156435 Archived-At: > > That patch did not fix the problem when searching across Info nodes. > > The attached patch does. AFAICT, it works generally. > > A more general approach would be to save the window start position > on the stack and restore it in `isearch-cancel' like the patch > below does. AFAICT, your slightly more complicated code has the same effect as mine. Yes, it adds `window-start' to the state struct, but I don't see any particular advantage. Is there some case it handles better? > `isearch-done' already does something like this by restoring > the original window configuration with `set-window-configuration' > from `isearch-window-configuration'. But it does this only > on slow terminals where baud-rate is less than 1200. That code was in fact my starting point, when looking at fixing this. I almost filed an bug report (enhancement request), wondering whether we might want the relative positions of point in each window to be saved as part of a window configuration. (Still wondering whether that might be a good idea.) > So perhaps this patch will also make `isearch-window-configuration' obsolete. I don't see how. How is it relevant to what that code does? That code does not save/restore `window-start' or the window-relative cursor position, and your patch (like mine) does not save/restore the window config. (But I wonder whether that code might be obsolete anyway, in the sense of not being used at all anymore.) > The remaining problem is how to take into account the case > when `isearch-allow-scroll' is non-nil and the user scrolled the > window-start to another position. I don't understand the problem. With either my patch or yours, non-nil `isearch-allow-scroll' seems to DTRT, AFAICT. You can scroll using `C-v', mouse wheel, etc. during Isearch, and if you hit `C-g' to cancel searching then you get back where you started, including cursor position relative to window. Works everywhere I've tested, including across nodes in Info. Can you give a recipe illustrating the problem you see? > We should find the right place to update the window-start of the > previous state on the search stack to be able to restore it later. See above. I don't understand what the problem is. Seems to work OK as is.