From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12253: Restore window start position Date: Sat, 25 Aug 2012 15:40:26 +0200 Message-ID: <5038D5CA.5000502@gmx.at> References: <878vd7vqji.fsf@mail.jurta.org> <50348568.5060401@gmx.at> <87haru8rxr.fsf@mail.jurta.org> <5035EE75.9090809@gmx.at> <877gsp9sl2.fsf@mail.jurta.org> <50374D30.7090401@gmx.at> <8762874wyk.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345902090 17164 80.91.229.3 (25 Aug 2012 13:41:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 13:41:30 +0000 (UTC) Cc: 12253@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 25 15:41:30 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1T5GcC-0002Tr-Vc for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Aug 2012 15:41:29 +0200 Original-Received: from localhost ([::1]:44008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5GcB-0003PB-8d for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Aug 2012 09:41:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5Gc8-0003Ov-0U for bug-gnu-emacs@gnu.org; Sat, 25 Aug 2012 09:41:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5Gc4-0006ZB-9w for bug-gnu-emacs@gnu.org; Sat, 25 Aug 2012 09:41:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5Gc4-0006Yv-6s for bug-gnu-emacs@gnu.org; Sat, 25 Aug 2012 09:41:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T5Gcj-0000X2-K7 for bug-gnu-emacs@gnu.org; Sat, 25 Aug 2012 09:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Aug 2012 13:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12253-submit@debbugs.gnu.org id=B12253.13459020731993 (code B ref 12253); Sat, 25 Aug 2012 13:42:01 +0000 Original-Received: (at 12253) by debbugs.gnu.org; 25 Aug 2012 13:41:13 +0000 Original-Received: from localhost ([127.0.0.1]:48201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5Gbw-0000W6-R2 for submit@debbugs.gnu.org; Sat, 25 Aug 2012 09:41:13 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:58740) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1T5Gbq-0000Vu-KR for 12253@debbugs.gnu.org; Sat, 25 Aug 2012 09:41:10 -0400 Original-Received: (qmail invoked by alias); 25 Aug 2012 13:40:24 -0000 Original-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 In-Reply-To: <8762874wyk.fsf@mail.jurta.org> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63477 Archived-At: > 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