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 therelative window position? Date: Wed, 16 Jan 2013 08:55:10 -0800 Message-ID: <3F79EED6372147F5AAC4F6EC7A02A18E@us.oracle.com> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001A_01CDF3C7.310F7330" X-Trace: ger.gmane.org 1358363213 9285 80.91.229.3 (16 Jan 2013 19:06:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 19:06:53 +0000 (UTC) Cc: dmoncayo@gmail.com, emacs-devel@gnu.org To: "'Eli Zaretskii'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 16 20:07:11 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 1TvYKM-0001ZP-Ai for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2013 20:07:10 +0100 Original-Received: from localhost ([::1]:56492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWHg-0005Lf-3p for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2013 11:56:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWGw-0004GH-7c for emacs-devel@gnu.org; Wed, 16 Jan 2013 11:55:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWGo-00072X-2L for emacs-devel@gnu.org; Wed, 16 Jan 2013 11:55:29 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:17009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWGg-00070A-SH; Wed, 16 Jan 2013 11:55:15 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r0GGtCig027121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Jan 2013 16:55:13 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r0GGtB2I017957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jan 2013 16:55:12 GMT Original-Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r0GGtBGU011303; Wed, 16 Jan 2013 10:55:11 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 Jan 2013 08:55:11 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac3zQyoz5X0Ot2UbROm4rhUX31flTQAJWaTwAChYdyA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:156428 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_001A_01CDF3C7.310F7330 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > All I did was this: > > 1. Save the relative window line number of point, before searching, in > `isearch-mode'. > > 2. Restore that, in `isearch-cancel'. That patch did not fix the problem when searching across Info nodes. The attached patch does. AFAICT, it works generally. ------=_NextPart_000_001A_01CDF3C7.310F7330 Content-Type: application/octet-stream; name="isearch-2013-01-16.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="isearch-2013-01-16.patch" diff -c isearch.el isearch-patched-2013-01-16.el=0A= *** isearch.el Wed Jan 16 08:49:58 2013=0A= --- isearch-patched-2013-01-16.el Wed Jan 16 08:51:10 2013=0A= ***************=0A= *** 605,610 ****=0A= --- 605,612 ----=0A= (defvar isearch-opoint 0)=0A= ;; The window configuration active at the beginning of the search.=0A= (defvar isearch-window-configuration nil)=0A= + ;; The line number of point before searching, relative to the line = number of `window-start'.=0A= + (defvar isearch-win-pt-line nil)=0A= =0A= ;; Flag to indicate a yank occurred, so don't move the cursor.=0A= (defvar isearch-yank-flag nil)=0A= ***************=0A= *** 827,832 ****=0A= --- 829,836 ----=0A= isearch-start-hscroll (window-hscroll)=0A= =0A= isearch-opoint (point)=0A= + isearch-win-pt-line (- (line-number-at-pos)=0A= + (line-number-at-pos (window-start)))=0A= search-ring-yank-pointer nil=0A= isearch-opened-overlays nil=0A= isearch-input-method-function input-method-function=0A= ***************=0A= *** 1307,1314 ****=0A= ;; For defined push-state function, restore the first state.=0A= ;; This calls pop-state function and restores original point.=0A= (let ((isearch-cmds (last isearch-cmds)))=0A= ! (isearch--set-state (car isearch-cmds)))=0A= ! (goto-char isearch-opoint))=0A= (isearch-done t) ; Exit isearch..=0A= (isearch-clean-overlays)=0A= (signal 'quit nil)) ; ..and pass on quit signal.=0A= --- 1311,1320 ----=0A= ;; For defined push-state function, restore the first state.=0A= ;; This calls pop-state function and restores original point.=0A= (let ((isearch-cmds (last isearch-cmds)))=0A= ! (isearch--set-state (car isearch-cmds))=0A= ! (when isearch-win-pt-line (recenter isearch-win-pt-line)))=0A= ! (goto-char isearch-opoint)=0A= ! (when isearch-win-pt-line (recenter isearch-win-pt-line)))=0A= (isearch-done t) ; Exit isearch..=0A= (isearch-clean-overlays)=0A= (signal 'quit nil)) ; ..and pass on quit signal.=0A= =0A= Diff finished. Wed Jan 16 15:52:01 2013=0A= ------=_NextPart_000_001A_01CDF3C7.310F7330--