GNU bug report logs - #12253
Restore window start position

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Juri Linkov <juri@HIDDEN>; dated Tue, 21 Aug 2012 22:23:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 29 Mar 2013 16:59:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 29 12:59:42 2013
Received: from localhost ([127.0.0.1]:51168 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ULceT-0002DM-Tn
	for submit <at> debbugs.gnu.org; Fri, 29 Mar 2013 12:59:42 -0400
Received: from aserp1040.oracle.com ([141.146.126.69]:50105)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1ULceR-0002DD-8Q
	for 12253 <at> debbugs.gnu.org; Fri, 29 Mar 2013 12:59:40 -0400
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with
	ESMTP id r2TGv0dM024916
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 29 Mar 2013 16:57:01 GMT
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
	r2TGuxwf006771
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 29 Mar 2013 16:56:59 GMT
Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r2TGuwfq004349; Fri, 29 Mar 2013 11:56:58 -0500
Received: from dradamslap1 (/10.159.148.114)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 29 Mar 2013 09:56:58 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Juri Linkov'" <juri@HIDDEN>
References: <878vd7vqji.fsf@HIDDEN><50348568.5060401@HIDDEN><87haru8rxr.fsf@HIDDEN><5035EE75.9090809@HIDDEN><877gsp9sl2.fsf@HIDDEN><50374D30.7090401@HIDDEN><8762874wyk.fsf@HIDDEN><5038D5CA.5000502@HIDDEN><87r4qun7u1.fsf@HIDDEN><FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN><F004277948C24BF09C55749DFDBE40FF@HIDDEN><87ehhh5vi2.fsf@HIDDEN>
	<62C3A8ED121246BE8FE62D0D90CF949D@HIDDEN>
Subject: RE: bug#12253: Restore window start position
Date: Fri, 29 Mar 2013 09:56:53 -0700
Message-ID: <C3F5ABE225984B47BFBDFF3509DCEAEF@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <62C3A8ED121246BE8FE62D0D90CF949D@HIDDEN>
Thread-Index: Ac32LkIC6OyquIwKS0iubJFisv04VQAJ51bgDZFXVmA=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.1 (----)

ping.

Any special reason why the patch provided or some other fix has not yet been
applied to fix this bug?  (Or has it been fixed and should thus be closed?)

> Sent: Saturday, January 19, 2013 7:04 AM
> > > +         isearch-win-pt-line (- (line-number-at-pos)
> > > +                                (line-number-at-pos 
> > (window-start)))
> > > ...
> > > !     (when isearch-win-pt-line (recenter isearch-win-pt-line)))
> > 
> > Why do you use `line-number-at-pos' and `recenter' instead of
> > `window-start' and `set-window-start'?
> 
> No special reason.  It's probably just what occurred to me.
> 
> Aren't they equivalent in effect, though not necessarily in 
> performance?  Feel free to use whichever approach you feel is better.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 19 Jan 2013 15:04:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 19 10:04:49 2013
Received: from localhost ([127.0.0.1]:40432 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TwZyS-0008AZ-9F
	for submit <at> debbugs.gnu.org; Sat, 19 Jan 2013 10:04:49 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:27415)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TwZyQ-0008AR-7m
	for 12253 <at> debbugs.gnu.org; Sat, 19 Jan 2013 10:04:47 -0500
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id r0JF3ora006385
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 19 Jan 2013 15:03:50 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r0JF3l0j028215
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 19 Jan 2013 15:03:50 GMT
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
	r0JF3kxa008676; Sat, 19 Jan 2013 09:03:46 -0600
Received: from dradamslap1 (/71.202.147.44)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sat, 19 Jan 2013 07:03:46 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Juri Linkov'" <juri@HIDDEN>
References: <878vd7vqji.fsf@HIDDEN>
	<50348568.5060401@HIDDEN><87haru8rxr.fsf@HIDDEN>
	<5035EE75.9090809@HIDDEN><877gsp9sl2.fsf@HIDDEN>
	<50374D30.7090401@HIDDEN><8762874wyk.fsf@HIDDEN>
	<5038D5CA.5000502@HIDDEN><87r4qun7u1.fsf@HIDDEN><FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN><F004277948C24BF09C55749DFDBE40FF@HIDDEN>
	<87ehhh5vi2.fsf@HIDDEN>
Subject: RE: bug#12253: Restore window start position
Date: Sat, 19 Jan 2013 07:03:40 -0800
Message-ID: <62C3A8ED121246BE8FE62D0D90CF949D@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <87ehhh5vi2.fsf@HIDDEN>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Thread-Index: Ac32LkIC6OyquIwKS0iubJFisv04VQAJ51bg
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 12253
Cc: 'martin rudalics' <rudalics@HIDDEN>, 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.3 (--)

> > +         isearch-win-pt-line (- (line-number-at-pos)
> > +                                (line-number-at-pos 
> (window-start)))
> > ...
> > !     (when isearch-win-pt-line (recenter isearch-win-pt-line)))
> 
> Why do you use `line-number-at-pos' and `recenter' instead of
> `window-start' and `set-window-start'?

No special reason.  It's probably just what occurred to me.

Aren't they equivalent in effect, though not necessarily in performance?  Feel
free to use whichever approach you feel is better.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 19 Jan 2013 10:18:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 19 05:18:53 2013
Received: from localhost ([127.0.0.1]:39564 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TwVVk-0000HY-R9
	for submit <at> debbugs.gnu.org; Sat, 19 Jan 2013 05:18:53 -0500
Received: from ps18281.dreamhost.com ([69.163.218.105]:43968
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1TwVVi-0000HR-U3
	for 12253 <at> debbugs.gnu.org; Sat, 19 Jan 2013 05:18:51 -0500
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 178B62116A800A;
	Sat, 19 Jan 2013 02:17:57 -0800 (PST)
From: Juri Linkov <juri@HIDDEN>
To: "Drew Adams" <drew.adams@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN> <5035EE75.9090809@HIDDEN>
	<877gsp9sl2.fsf@HIDDEN> <50374D30.7090401@HIDDEN>
	<8762874wyk.fsf@HIDDEN> <5038D5CA.5000502@HIDDEN>
	<87r4qun7u1.fsf@HIDDEN>
	<FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN>
	<F004277948C24BF09C55749DFDBE40FF@HIDDEN>
Date: Sat, 19 Jan 2013 12:17:30 +0200
In-Reply-To: <F004277948C24BF09C55749DFDBE40FF@HIDDEN> (Drew Adams's
	message of "Fri, 18 Jan 2013 14:42:22 -0800")
Message-ID: <87ehhh5vi2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 12253
Cc: 'martin rudalics' <rudalics@HIDDEN>, 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.0 (/)

> +         isearch-win-pt-line (- (line-number-at-pos)
> +                                (line-number-at-pos (window-start)))
> ...
> !     (when isearch-win-pt-line (recenter isearch-win-pt-line)))

Why do you use `line-number-at-pos' and `recenter' instead of
`window-start' and `set-window-start'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 18 Jan 2013 22:43:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 18 17:43:21 2013
Received: from localhost ([127.0.0.1]:39206 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TwKee-0000UI-R0
	for submit <at> debbugs.gnu.org; Fri, 18 Jan 2013 17:43:21 -0500
Received: from userp1040.oracle.com ([156.151.31.81]:17594)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TwKec-0000UB-FU
	for 12253 <at> debbugs.gnu.org; Fri, 18 Jan 2013 17:43:19 -0500
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id r0IMgRPg001533
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 18 Jan 2013 22:42:28 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r0IMgRAA019987
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 18 Jan 2013 22:42:27 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r0IMgQI0028832; Fri, 18 Jan 2013 16:42:26 -0600
Received: from dradamslap1 (/10.159.184.17)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 18 Jan 2013 14:42:26 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Juri Linkov'" <juri@HIDDEN>, "'martin rudalics'" <rudalics@HIDDEN>
References: <878vd7vqji.fsf@HIDDEN><50348568.5060401@HIDDEN><87haru8rxr.fsf@HIDDEN><5035EE75.9090809@HIDDEN><877gsp9sl2.fsf@HIDDEN><50374D30.7090401@HIDDEN><8762874wyk.fsf@HIDDEN><5038D5CA.5000502@HIDDEN>
	<87r4qun7u1.fsf@HIDDEN>
	<FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN>
Subject: RE: bug#12253: Restore window start position
Date: Fri, 18 Jan 2013 14:42:22 -0800
Message-ID: <F004277948C24BF09C55749DFDBE40FF@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_00C1_01CDF58A.071E7160"
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN>
Thread-Index: Ac2C+0nK9NpFW8R+Ts2vfezQ83sDyRxDxSgwAHCRyOA=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.5 (-)

This is a multi-part message in MIME format.

------=_NextPart_000_00C1_01CDF58A.071E7160
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

> The attached patch seems to fix the Isearch problem 
> generally, restoring the
> original position of point within the window.

Oops.  I sent the wrong patch somehow, as should have been obvious if anyone
looked at it.  Here is the correct patch, which fixes this Isearch problem.

------=_NextPart_000_00C1_01CDF58A.071E7160
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_00C1_01CDF58A.071E7160--





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 16 Jan 2013 16:58:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 16 11:58:00 2013
Received: from localhost ([127.0.0.1]:35503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TvWJL-0006kK-Us
	for submit <at> debbugs.gnu.org; Wed, 16 Jan 2013 11:58:00 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:30941)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TvWJK-0006kB-21
	for 12253 <at> debbugs.gnu.org; Wed, 16 Jan 2013 11:57:59 -0500
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id r0GGvKDM007390
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 16 Jan 2013 16:57:20 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r0GGvJYK021626
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 16 Jan 2013 16:57:19 GMT
Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r0GGvJAR013111; Wed, 16 Jan 2013 10:57:19 -0600
Received: from dradamslap1 (/130.35.178.8)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 16 Jan 2013 08:57:18 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Juri Linkov'" <juri@HIDDEN>, "'martin rudalics'" <rudalics@HIDDEN>
References: <878vd7vqji.fsf@HIDDEN>
	<50348568.5060401@HIDDEN><87haru8rxr.fsf@HIDDEN>
	<5035EE75.9090809@HIDDEN><877gsp9sl2.fsf@HIDDEN>
	<50374D30.7090401@HIDDEN><8762874wyk.fsf@HIDDEN>
	<5038D5CA.5000502@HIDDEN> <87r4qun7u1.fsf@HIDDEN>
Subject: RE: bug#12253: Restore window start position
Date: Wed, 16 Jan 2013 08:57:18 -0800
Message-ID: <FAD5C9CE56B7466884A68C3BF3DAC5C0@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_001D_01CDF3C7.7D4A1160"
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <87r4qun7u1.fsf@HIDDEN>
Thread-Index: Ac2C+0nK9NpFW8R+Ts2vfezQ83sDyRxDxSgw
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.3 (--)

This is a multi-part message in MIME format.

------=_NextPart_000_001D_01CDF3C7.7D4A1160
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

The attached patch seems to fix the Isearch problem generally, restoring the
original position of point within the window.

------=_NextPart_000_001D_01CDF3C7.7D4A1160
Content-Type: application/octet-stream;
	name="isearch-2011-05-16.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="isearch-2011-05-16.patch"

diff -cw isearch.el isearch-patched-2011-05-16.el=0A=
*** isearch.el	Mon May 16 11:38:22 2011=0A=
--- isearch-patched-2011-05-16.el	Mon May 16 14:21:04 2011=0A=
***************=0A=
*** 1060,1065 ****=0A=
--- 1060,1080 ----=0A=
  =0A=
  (defvar minibuffer-history-symbol) ;; from external package gmhist.el=0A=
  =0A=
+ (defun isearch-fail-pos ()=0A=
+   "Position of first mismatch in search string, or its length if none."=0A=
+   (let ((cmds  isearch-cmds)=0A=
+         succ-msg)=0A=
+     (if (and isearch-success (not isearch-error))=0A=
+         (length isearch-message)=0A=
+       (while (or (not (isearch-success-state (car cmds)))=0A=
+                  (isearch-error-state (car cmds)))=0A=
+         (pop cmds))=0A=
+       (setq succ-msg  (and cmds (isearch-message-state (car cmds))))=0A=
+       (if (and (stringp succ-msg)  (< (length succ-msg) (length =
isearch-message))=0A=
+                (equal succ-msg (substring isearch-message 0 (length =
succ-msg))))=0A=
+           (length succ-msg)=0A=
+         0))))=0A=
+ =0A=
  (defun isearch-edit-string ()=0A=
    "Edit the search string in the minibuffer.=0A=
  The following additional command keys are active while editing.=0A=
***************=0A=
*** 1139,1145 ****=0A=
  		(setq isearch-new-string=0A=
                        (read-from-minibuffer=0A=
                         (isearch-message-prefix nil nil =
isearch-nonincremental)=0A=
!                        isearch-string=0A=
                         minibuffer-local-isearch-map nil=0A=
                         (if isearch-regexp=0A=
  			   (cons 'regexp-search-ring=0A=
--- 1154,1160 ----=0A=
                   (setq isearch-new-string=0A=
                         (read-from-minibuffer=0A=
                          (isearch-message-prefix nil nil =
isearch-nonincremental)=0A=
!                         (cons isearch-string (1+ (isearch-fail-pos)))=0A=
                          minibuffer-local-isearch-map nil=0A=
                          (if isearch-regexp=0A=
                              (cons 'regexp-search-ring=0A=
=0A=
Diff finished.  Mon May 16 14:23:06 2011=0A=

------=_NextPart_000_001D_01CDF3C7.7D4A1160--





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 28 Aug 2012 09:05:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 28 05:05:25 2012
Received: from localhost ([127.0.0.1]:53702 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T6Hjg-0001dP-Pk
	for submit <at> debbugs.gnu.org; Tue, 28 Aug 2012 05:05:25 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:51368
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T6Hjf-0001dJ-CA
	for 12253 <at> debbugs.gnu.org; Tue, 28 Aug 2012 05:05:23 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 12625451CC28;
	Tue, 28 Aug 2012 02:04:23 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN> <5035EE75.9090809@HIDDEN>
	<877gsp9sl2.fsf@HIDDEN> <50374D30.7090401@HIDDEN>
	<8762874wyk.fsf@HIDDEN> <5038D5CA.5000502@HIDDEN>
	<87r4qun7u1.fsf@HIDDEN>
Date: Tue, 28 Aug 2012 11:53:42 +0300
In-Reply-To: <87r4qun7u1.fsf@HIDDEN> (Juri Linkov's message of "Sat,
	25 Aug 2012 22:29:42 +0300")
Message-ID: <87a9xfs8gz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> But for the normal case, I think the following patch should be enough:

Actually this has no effect in Info when isearch returns to the previous node
with DEL ("isearch-delete-char").  So isearch could remember the original
window start position in `isearch-state' and restore it as well.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 25 Aug 2012 19:53:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 25 15:53:35 2012
Received: from localhost ([127.0.0.1]:48763 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T5MQJ-0000Nj-AC
	for submit <at> debbugs.gnu.org; Sat, 25 Aug 2012 15:53:35 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:40990
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T5MQG-0000NV-6L
	for 12253 <at> debbugs.gnu.org; Sat, 25 Aug 2012 15:53:33 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 64849451CB63;
	Sat, 25 Aug 2012 12:52:47 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN> <5035EE75.9090809@HIDDEN>
	<877gsp9sl2.fsf@HIDDEN> <50374D30.7090401@HIDDEN>
	<8762874wyk.fsf@HIDDEN> <5038D5CA.5000502@HIDDEN>
Date: Sat, 25 Aug 2012 22:29:42 +0300
In-Reply-To: <5038D5CA.5000502@HIDDEN> (martin rudalics's message of "Sat, 25
	Aug 2012 15:40:26 +0200")
Message-ID: <87r4qun7u1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> I agree.  How do you handle the case where *info* is not in the selected
> window but some other one?

We don't need to care about this case.  When used programmatically,
the caller should handle also the case when *info* is in another window,
e.g.:

  (with-current-buffer "*info*"
    ...
    (Info-history-back)
    (set-window-start (window-in-direction 'below) opoint)
    ...)

or some more specific logic when necessary.

But for the normal case, I think the following patch should be enough:

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-08-21 00:12:42 +0000
+++ lisp/info.el	2012-08-25 19:29:04 +0000
@@ -40,11 +40,11 @@ (defgroup info nil
 
 (defvar Info-history nil
   "Stack of Info nodes user has visited.
-Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
+Each element of the stack is a list (FILENAME NODENAME BUFFERPOS WINDOWPOS).")
 
 (defvar Info-history-forward nil
   "Stack of Info nodes user has visited with `Info-history-back' command.
-Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
+Each element of the stack is a list (FILENAME NODENAME BUFFERPOS WINDOWPOS).")
 
 (defvar Info-history-list nil
   "List of all Info nodes user has visited.
@@ -922,7 +925,9 @@ (defun Info-find-node (filename nodename
   ;; Record the node we are leaving, if we were in one.
   (and (not no-going-back)
        Info-current-file
-       (push (list Info-current-file Info-current-node (point))
+       (push (list Info-current-file Info-current-node (point)
+		   (and (eq (window-buffer) (current-buffer))
+			(window-start)))
              Info-history))
   (Info-find-node-2 filename nodename no-going-back))
 
@@ -956,7 +961,9 @@ (defun Info-revert-find-node (filename n
 	(pline        (count-lines (point-min) (line-beginning-position)))
 	(wline        (count-lines (point-min) (window-start)))
 	(new-history  (and Info-current-file
-			   (list Info-current-file Info-current-node (point)))))
+			   (list Info-current-file Info-current-node (point)
+				 (and (eq (window-buffer) (current-buffer))
+				      (window-start))))))
     ;; When `Info-current-file' is nil, `Info-find-node-2' rereads the file.
     (setq Info-current-file nil)
     (Info-find-node filename nodename)
@@ -1226,6 +1233,8 @@ (defun Info-find-node-2 (filename nodena
         (let ((hist (car Info-history)))
           (setq Info-history (cdr Info-history))
           (Info-find-node (nth 0 hist) (nth 1 hist) t)
+          (when (and (nth 3 hist) (eq (window-buffer) (current-buffer)))
+	    (set-window-start (selected-window) (nth 3 hist) t))
           (goto-char (nth 2 hist))))))
 
 ;; Cache the contents of the (virtual) dir file, once we have merged
@@ -2002,7 +2013,7 @@ (defun Info-search (regexp &optional bou
 	       (equal ofile Info-current-file))
           (and isearch-mode isearch-wrapped
 	       (eq opoint (if isearch-forward opoint-min opoint-max)))
-	  (setq Info-history (cons (list ofile onode opoint)
+	  (setq Info-history (cons (list ofile onode opoint ostart)
 				   Info-history))))))
 
 (defun Info-search-case-sensitively ()
@@ -2208,16 +2219,21 @@ (defun Info-history-back ()
   (or Info-history
       (user-error "This is the first Info node you looked at"))
   (let ((history-forward
-	 (cons (list Info-current-file Info-current-node (point))
+	 (cons (list Info-current-file Info-current-node (point)
+		     (and (eq (window-buffer) (current-buffer))
+			  (window-start)))
 	       Info-history-forward))
-	filename nodename opoint)
+	filename nodename opoint ostart)
     (setq filename (car (car Info-history)))
     (setq nodename (car (cdr (car Info-history))))
     (setq opoint (car (cdr (cdr (car Info-history)))))
+    (setq ostart (car (cdr (cdr (cdr (car Info-history))))))
     (setq Info-history (cdr Info-history))
     (Info-find-node filename nodename)
     (setq Info-history (cdr Info-history))
     (setq Info-history-forward history-forward)
+    (when (and ostart (eq (window-buffer) (current-buffer)))
+      (set-window-start (selected-window) ostart t))
     (goto-char opoint)))
 
 (defalias 'Info-last 'Info-history-back)
@@ -2228,12 +2244,15 @@ (defun Info-history-forward ()
   (or Info-history-forward
       (user-error "This is the last Info node you looked at"))
   (let ((history-forward (cdr Info-history-forward))
-	filename nodename opoint)
+	filename nodename opoint ostart)
     (setq filename (car (car Info-history-forward)))
     (setq nodename (car (cdr (car Info-history-forward))))
     (setq opoint (car (cdr (cdr (car Info-history-forward)))))
+    (setq ostart (car (cdr (cdr (cdr (car Info-history-forward))))))
     (Info-find-node filename nodename)
     (setq Info-history-forward history-forward)
+    (when (and ostart (eq (window-buffer) (current-buffer)))
+      (set-window-start (selected-window) ostart t))
     (goto-char opoint)))
 
 (add-to-list 'Info-virtual-files
@@ -4307,7 +4326,7 @@ (defun Info-find-emacs-command-nodes (co
 	      (setq where
 		    (cons (list Info-current-file
 				(match-string-no-properties 2)
-				0)
+				0 0)
 			  where))
 	      (setq line-number (and (match-beginning 3)
 				     (string-to-number (match-string 3)))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 25 Aug 2012 13:41:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 25 09:41:13 2012
Received: from localhost ([127.0.0.1]:48201 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T5Gbw-0000W6-R2
	for submit <at> debbugs.gnu.org; Sat, 25 Aug 2012 09:41:13 -0400
Received: from mailout-de.gmx.net ([213.165.64.22]:58740)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rudalics@HIDDEN>) id 1T5Gbq-0000Vu-KR
	for 12253 <at> debbugs.gnu.org; Sat, 25 Aug 2012 09:41:10 -0400
Received: (qmail invoked by alias); 25 Aug 2012 13:40:24 -0000
Received: from 62-47-58-37.adsl.highway.telekom.at (EHLO [62.47.58.37])
	[62.47.58.37]
	by mail.gmx.net (mp016) with SMTP; 25 Aug 2012 15:40:24 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX1/aWmEgRy7aflLNrqXrkrSWbNbe+SSCGIENr/Svou
	jLC1B+uGORbCV0
Message-ID: <5038D5CA.5000502@HIDDEN>
Date: Sat, 25 Aug 2012 15:40:26 +0200
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12253: Restore window start position
References: <878vd7vqji.fsf@HIDDEN>
	<50348568.5060401@HIDDEN>	<87haru8rxr.fsf@HIDDEN>
	<5035EE75.9090809@HIDDEN>	<877gsp9sl2.fsf@HIDDEN>
	<50374D30.7090401@HIDDEN> <8762874wyk.fsf@HIDDEN>
In-Reply-To: <8762874wyk.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

 > These functions might be used non-interactively,
 > where the *info* buffer is not displayed in any window,
 > e.g.:
 >
 >   (with-current-buffer "*info*"
 >     (Info-history-back))

Aha

 > so in this case `goto-char' should be used instead of `set-window-point'
 > in `Info-history-back' and other similar functions.
 >
 > It is true that in the latest patch, `set-window-start'
 > is not guarded against this use case.

This must have been the inconsistency that troubled my subconsciousness.

 > To guarantee that the
 > function operates on the window that displays the current buffer,
 > we could add the following condition (this patch is based on the
 > previous patch that adds `set-window-start'):
 >
 > === modified file 'lisp/info.el'
 > --- lisp/info.el	2012-08-22 23:45:47 +0000
 > +++ lisp/info.el	2012-08-25 00:28:00 +0000
 > @@ -2225,7 +2225,8 @@ (defun Info-history-back ()
 >      (Info-find-node filename nodename)
 >      (setq Info-history (cdr Info-history))
 >      (setq Info-history-forward history-forward)
 > -    (set-window-start (selected-window) ostart t)
 > +    (when (eq (window-buffer) (current-buffer))
 > +      (set-window-start (selected-window) ostart t))
 >      (goto-char opoint)))
 >
 > If you agree that this is the right thing to do
 > then other places could be changed accordingly as well.

I agree.  How do you handle the case where *info* is not in the selected
window but some other one?

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 25 Aug 2012 00:53:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 24 20:53:04 2012
Received: from localhost ([127.0.0.1]:47544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T54cZ-0007se-Sk
	for submit <at> debbugs.gnu.org; Fri, 24 Aug 2012 20:53:04 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:35476
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T54cW-0007sE-4V
	for 12253 <at> debbugs.gnu.org; Fri, 24 Aug 2012 20:53:01 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id E4446451CB1D;
	Fri, 24 Aug 2012 17:52:19 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN> <5035EE75.9090809@HIDDEN>
	<877gsp9sl2.fsf@HIDDEN> <50374D30.7090401@HIDDEN>
Date: Sat, 25 Aug 2012 03:29:39 +0300
In-Reply-To: <50374D30.7090401@HIDDEN> (martin rudalics's message of "Fri, 24
	Aug 2012 11:45:20 +0200")
Message-ID: <8762874wyk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> (set-window-point (window-in-direction 'below) (point-max))
>
> with the upper window selected, the lower window shows the (narrowed)
> end of *info* and
>
> (with-selected-window (window-in-direction 'below)
>   (goto-char (point-max)))
>
> does the same.  So I still miss you.

These functions might be used non-interactively,
where the *info* buffer is not displayed in any window,
e.g.:

  (with-current-buffer "*info*"
    (Info-history-back))

so in this case `goto-char' should be used instead of `set-window-point'
in `Info-history-back' and other similar functions.

It is true that in the latest patch, `set-window-start'
is not guarded against this use case.  To guarantee that the
function operates on the window that displays the current buffer,
we could add the following condition (this patch is based on the
previous patch that adds `set-window-start'):

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-08-22 23:45:47 +0000
+++ lisp/info.el	2012-08-25 00:28:00 +0000
@@ -2225,7 +2225,8 @@ (defun Info-history-back ()
     (Info-find-node filename nodename)
     (setq Info-history (cdr Info-history))
     (setq Info-history-forward history-forward)
-    (set-window-start (selected-window) ostart t)
+    (when (eq (window-buffer) (current-buffer))
+      (set-window-start (selected-window) ostart t))
     (goto-char opoint)))
 
If you agree that this is the right thing to do
then other places could be changed accordingly as well.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 24 Aug 2012 09:46:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 24 05:46:04 2012
Received: from localhost ([127.0.0.1]:46336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T4qSq-0003Sd-Cf
	for submit <at> debbugs.gnu.org; Fri, 24 Aug 2012 05:46:04 -0400
Received: from mailout-de.gmx.net ([213.165.64.23]:35430)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rudalics@HIDDEN>) id 1T4qSo-0003SH-7t
	for 12253 <at> debbugs.gnu.org; Fri, 24 Aug 2012 05:46:02 -0400
Received: (qmail invoked by alias); 24 Aug 2012 09:45:26 -0000
Received: from 62-47-46-0.adsl.highway.telekom.at (EHLO [62.47.46.0])
	[62.47.46.0]
	by mail.gmx.net (mp069) with SMTP; 24 Aug 2012 11:45:26 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX18vpmxtDWcvrmlraFLwg4pTciHcsg9w1CPqr9vHVq
	KjcVS0ibm3+T9z
Message-ID: <50374D30.7090401@HIDDEN>
Date: Fri, 24 Aug 2012 11:45:20 +0200
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12253: Restore window start position
References: <878vd7vqji.fsf@HIDDEN>
	<50348568.5060401@HIDDEN>	<87haru8rxr.fsf@HIDDEN>
	<5035EE75.9090809@HIDDEN> <877gsp9sl2.fsf@HIDDEN>
In-Reply-To: <877gsp9sl2.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

 > Usually Info widens the Info buffer, moves point using `goto-char' and
 > finally narrows the buffer to the current node.  There is no way to use
 > `set-window-point' in this workflow.  Other places (that move point
 > after narrowing) could use the same function `goto-char' for consistency.

Conceptually, `goto-char' and `set-window-point' are idempotent with the
current buffer in the selected window.  Now *info* synchronizes
navigation in all windows showing *info*.  But if I split an *info*
window showing the (narrowed) beginning of *info* and do

(set-window-point (window-in-direction 'below) (point-max))

with the upper window selected, the lower window shows the (narrowed)
end of *info* and

(with-selected-window (window-in-direction 'below)
   (goto-char (point-max)))

does the same.  So I still miss you.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 23 Aug 2012 22:02:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 23 18:02:52 2012
Received: from localhost ([127.0.0.1]:45603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T4fUJ-0004WR-Vb
	for submit <at> debbugs.gnu.org; Thu, 23 Aug 2012 18:02:52 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:49437
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T4fUH-0004WK-Kk
	for 12253 <at> debbugs.gnu.org; Thu, 23 Aug 2012 18:02:50 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 67C01451CB63;
	Thu, 23 Aug 2012 15:02:15 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN> <5035EE75.9090809@HIDDEN>
Date: Fri, 24 Aug 2012 01:00:41 +0300
In-Reply-To: <5035EE75.9090809@HIDDEN> (martin rudalics's message of "Thu, 23
	Aug 2012 10:48:53 +0200")
Message-ID: <877gsp9sl2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> (I guess using `set-window-point' instead of `goto-char'
>> is not applicable to Info):
>
> Why not?

Usually Info widens the Info buffer, moves point using `goto-char' and
finally narrows the buffer to the current node.  There is no way to use
`set-window-point' in this workflow.  Other places (that move point
after narrowing) could use the same function `goto-char' for consistency.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 23 Aug 2012 08:49:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 23 04:49:14 2012
Received: from localhost ([127.0.0.1]:44470 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T4T6I-0001km-Ei
	for submit <at> debbugs.gnu.org; Thu, 23 Aug 2012 04:49:14 -0400
Received: from mailout-de.gmx.net ([213.165.64.23]:54546)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rudalics@HIDDEN>) id 1T4T6G-0001kZ-Md
	for 12253 <at> debbugs.gnu.org; Thu, 23 Aug 2012 04:49:13 -0400
Received: (qmail invoked by alias); 23 Aug 2012 08:48:42 -0000
Received: from 62-47-45-20.adsl.highway.telekom.at (EHLO [62.47.45.20])
	[62.47.45.20]
	by mail.gmx.net (mp041) with SMTP; 23 Aug 2012 10:48:42 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX1/96WlZ0ZD9YdM5h6dzlaZ20G0X267eqPkBoTZAon
	XnEA3p2MkfVjkL
Message-ID: <5035EE75.9090809@HIDDEN>
Date: Thu, 23 Aug 2012 10:48:53 +0200
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12253: Restore window start position
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
	<87haru8rxr.fsf@HIDDEN>
In-Reply-To: <87haru8rxr.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

 > (I guess using `set-window-point' instead of `goto-char'
 > is not applicable to Info):

Why not?

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 22 Aug 2012 23:45:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 22 19:45:43 2012
Received: from localhost ([127.0.0.1]:43982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T4KcH-0006JK-3c
	for submit <at> debbugs.gnu.org; Wed, 22 Aug 2012 19:45:43 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:36920
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T4Kc7-0006J0-6q
	for 12253 <at> debbugs.gnu.org; Wed, 22 Aug 2012 19:45:32 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id CDA35451CC35;
	Wed, 22 Aug 2012 16:45:02 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#12253: Restore window start position
Organization: JURTA
References: <878vd7vqji.fsf@HIDDEN> <50348568.5060401@HIDDEN>
Date: Thu, 23 Aug 2012 02:38:44 +0300
In-Reply-To: <50348568.5060401@HIDDEN> (martin rudalics's message of "Wed, 22
	Aug 2012 09:08:24 +0200")
Message-ID: <87haru8rxr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> I fully agree with you.  But I was curious whether setting the window
> start position should be allowed to override any (goto-char opoint)
> following or preceding it (just in case a window got resized during
> navigation).

I see what you mean - the problem handled by
`set-window-buffer-start-and-point'.  Of course,
this function can't be used in Info, but its precautions
of not forcing window-start (the argument NOFORCE
of `set-window-start') and the order of calling
`set-window-start' and `goto-char' afterward
can be applied to Info like in the following patch
(I guess using `set-window-point' instead of `goto-char'
is not applicable to Info):

=== modified file 'lisp/info.el'
--- lisp/info.el	2012-08-21 00:12:42 +0000
+++ lisp/info.el	2012-08-22 23:35:48 +0000
@@ -40,11 +40,11 @@ (defgroup info nil
 
 (defvar Info-history nil
   "Stack of Info nodes user has visited.
-Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
+Each element of the stack is a list (FILENAME NODENAME BUFFERPOS WINDOWPOS).")
 
 (defvar Info-history-forward nil
   "Stack of Info nodes user has visited with `Info-history-back' command.
-Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
+Each element of the stack is a list (FILENAME NODENAME BUFFERPOS WINDOWPOS).")
 
 (defvar Info-history-list nil
   "List of all Info nodes user has visited.
@@ -922,7 +925,7 @@ (defun Info-find-node (filename nodename
   ;; Record the node we are leaving, if we were in one.
   (and (not no-going-back)
        Info-current-file
-       (push (list Info-current-file Info-current-node (point))
+       (push (list Info-current-file Info-current-node (point) (window-start))
              Info-history))
   (Info-find-node-2 filename nodename no-going-back))
 
@@ -956,7 +959,7 @@ (defun Info-revert-find-node (filename n
 	(pline        (count-lines (point-min) (line-beginning-position)))
 	(wline        (count-lines (point-min) (window-start)))
 	(new-history  (and Info-current-file
-			   (list Info-current-file Info-current-node (point)))))
+			   (list Info-current-file Info-current-node (point) (window-start)))))
     ;; When `Info-current-file' is nil, `Info-find-node-2' rereads the file.
     (setq Info-current-file nil)
     (Info-find-node filename nodename)
@@ -1226,7 +1229,8 @@ (defun Info-find-node-2 (filename nodena
         (let ((hist (car Info-history)))
           (setq Info-history (cdr Info-history))
           (Info-find-node (nth 0 hist) (nth 1 hist) t)
-          (goto-char (nth 2 hist))))))
+          (set-window-start (selected-window) (nth 3 hist) t)
+          (goto-char (nth 2 hist))))))
 
 ;; Cache the contents of the (virtual) dir file, once we have merged
 ;; it for the first time, so we can save time subsequently.
@@ -2002,7 +2008,7 @@ (defun Info-search (regexp &optional bou
 	       (equal ofile Info-current-file))
           (and isearch-mode isearch-wrapped
 	       (eq opoint (if isearch-forward opoint-min opoint-max)))
-	  (setq Info-history (cons (list ofile onode opoint)
+	  (setq Info-history (cons (list ofile onode opoint ostart)
 				   Info-history))))))
 
 (defun Info-search-case-sensitively ()
@@ -2208,16 +2214,18 @@ (defun Info-history-back ()
   (or Info-history
       (user-error "This is the first Info node you looked at"))
   (let ((history-forward
-	 (cons (list Info-current-file Info-current-node (point))
+	 (cons (list Info-current-file Info-current-node (point) (window-start))
 	       Info-history-forward))
-	filename nodename opoint)
+	filename nodename opoint ostart)
     (setq filename (car (car Info-history)))
     (setq nodename (car (cdr (car Info-history))))
     (setq opoint (car (cdr (cdr (car Info-history)))))
+    (setq ostart (car (cdr (cdr (cdr (car Info-history))))))
     (setq Info-history (cdr Info-history))
     (Info-find-node filename nodename)
     (setq Info-history (cdr Info-history))
     (setq Info-history-forward history-forward)
+    (set-window-start (selected-window) ostart t)
     (goto-char opoint)))
 
 (defalias 'Info-last 'Info-history-back)
@@ -2228,12 +2236,14 @@ (defun Info-history-forward ()
   (or Info-history-forward
       (user-error "This is the last Info node you looked at"))
   (let ((history-forward (cdr Info-history-forward))
-	filename nodename opoint)
+	filename nodename opoint ostart)
     (setq filename (car (car Info-history-forward)))
     (setq nodename (car (cdr (car Info-history-forward))))
     (setq opoint (car (cdr (cdr (car Info-history-forward)))))
+    (setq ostart (car (cdr (cdr (cdr (car Info-history-forward))))))
     (Info-find-node filename nodename)
     (setq Info-history-forward history-forward)
+    (set-window-start (selected-window) ostart t)
     (goto-char opoint)))
 
 (add-to-list 'Info-virtual-files
@@ -4307,7 +4317,7 @@ (defun Info-find-emacs-command-nodes (co
 	      (setq where
 		    (cons (list Info-current-file
 				(match-string-no-properties 2)
-				0)
+				0 0)
 			  where))
 	      (setq line-number (and (match-beginning 3)
 				     (string-to-number (match-string 3)))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at 12253 <at> debbugs.gnu.org:


Received: (at 12253) by debbugs.gnu.org; 22 Aug 2012 07:08:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 22 03:08:53 2012
Received: from localhost ([127.0.0.1]:42552 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T453d-0006ar-2H
	for submit <at> debbugs.gnu.org; Wed, 22 Aug 2012 03:08:53 -0400
Received: from mailout-de.gmx.net ([213.165.64.23]:41440)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rudalics@HIDDEN>) id 1T453a-0006ak-Ux
	for 12253 <at> debbugs.gnu.org; Wed, 22 Aug 2012 03:08:51 -0400
Received: (qmail invoked by alias); 22 Aug 2012 07:08:26 -0000
Received: from 62-47-50-77.adsl.highway.telekom.at (EHLO [62.47.50.77])
	[62.47.50.77]
	by mail.gmx.net (mp033) with SMTP; 22 Aug 2012 09:08:26 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX1/i8voP0VPiEgX2Ndb0XK7CF0Dbkss5IqI3lvLoGw
	xh/za18E/dbnas
Message-ID: <50348568.5060401@HIDDEN>
Date: Wed, 22 Aug 2012 09:08:24 +0200
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12253: Restore window start position
References: <878vd7vqji.fsf@HIDDEN>
In-Reply-To: <878vd7vqji.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12253
Cc: 12253 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

 > Martin writes in bug#12230:
 >
 >>> +	  (set-window-start (selected-window) (nth 3 hist))))))
 >> [...]
 >>> +    (set-window-start (selected-window) ostart)))
 >> [...]
 >>> +    (set-window-start (selected-window) ostart)))
 >> Are you sure you want to force start positions here?
[...]
 > The second change in `Info-history-back' and in `Info-history-forward'
 > is to keep the original window positions while navigating through
 > the Info history backward and forward.  I think this has the same importance
 > as keeping the original window positions while navigating buffers
 > with `next-buffer' and `previous-buffer'.

I fully agree with you.  But I was curious whether setting the window
start position should be allowed to override any (goto-char opoint)
following or preceding it (just in case a window got resized during
navigation).

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Aug 2012 22:22:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 21 18:22:36 2012
Received: from localhost ([127.0.0.1]:42088 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T3wqK-0008Um-IA
	for submit <at> debbugs.gnu.org; Tue, 21 Aug 2012 18:22:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47183)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1T3wqH-0008Ud-RZ
	for submit <at> debbugs.gnu.org; Tue, 21 Aug 2012 18:22:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1T3wpv-00036n-Sz
	for submit <at> debbugs.gnu.org; Tue, 21 Aug 2012 18:22:12 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:48447)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1T3wpv-00036i-Pi
	for submit <at> debbugs.gnu.org; Tue, 21 Aug 2012 18:22:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38566)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1T3wpu-0005l7-MX
	for bug-gnu-emacs@HIDDEN; Tue, 21 Aug 2012 18:22:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1T3wpt-00036B-R4
	for bug-gnu-emacs@HIDDEN; Tue, 21 Aug 2012 18:22:10 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:35875
	helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1T3wpt-000360-LJ
	for bug-gnu-emacs@HIDDEN; Tue, 21 Aug 2012 18:22:09 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id C7A20451CBF8
	for <bug-gnu-emacs@HIDDEN>; Tue, 21 Aug 2012 15:22:07 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Restore window start position
Organization: JURTA
Date: Wed, 22 Aug 2012 01:17:05 +0300
Message-ID: <878vd7vqji.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

This is a request for improvement initiated in bug#12230 and
continued here in a new report.  The request is to restore the original
window start position when returning back to the previous node.

Martin writes in bug#12230:

>> +	  (set-window-start (selected-window) (nth 3 hist))))))
> [...]
>> +    (set-window-start (selected-window) ostart)))
> [...]
>> +    (set-window-start (selected-window) ostart)))
>
> Are you sure you want to force start positions here?

The first change in `Info-find-node-2' is needed to avoid recentering
when the target Info node does not exist and the reader stays in the
same node when the error message is reported in the echo area as
"No such node or anchor".  (What is interesting here is that this
change is needed only when the link leads to another Info file.
But when the link leads to another node of the same Info manual,
this change is not needed, because the window position stays the same.)

The second change in `Info-history-back' and in `Info-history-forward'
is to keep the original window positions while navigating through
the Info history backward and forward.  I think this has the same importance
as keeping the original window positions while navigating buffers
with `next-buffer' and `previous-buffer'.




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12253; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.