From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#12253: Restore window start position Date: Sat, 25 Aug 2012 03:29:39 +0300 Organization: JURTA Message-ID: <8762874wyk.fsf@mail.jurta.org> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345856012 11121 80.91.229.3 (25 Aug 2012 00:53:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 00:53:32 +0000 (UTC) Cc: 12253@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 25 02:53:32 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 1T54d0-0005YF-E1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Aug 2012 02:53:30 +0200 Original-Received: from localhost ([::1]:57273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T54cy-0001ze-LU for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Aug 2012 20:53:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T54cw-0001zV-7e for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 20:53:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T54cu-000247-4I for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 20:53:26 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T54cu-000243-19 for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 20:53:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T54dV-0007tq-UC for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 20:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Aug 2012 00:54: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.134585598430299 (code B ref 12253); Sat, 25 Aug 2012 00:54:01 +0000 Original-Received: (at 12253) by debbugs.gnu.org; 25 Aug 2012 00:53:04 +0000 Original-Received: from localhost ([127.0.0.1]:47544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T54cZ-0007se-Sk for submit@debbugs.gnu.org; Fri, 24 Aug 2012 20:53:04 -0400 Original-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 ) id 1T54cW-0007sE-4V for 12253@debbugs.gnu.org; Fri, 24 Aug 2012 20:53:01 -0400 Original-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) In-Reply-To: <50374D30.7090401@gmx.at> (martin rudalics's message of "Fri, 24 Aug 2012 11:45:20 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) 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:63470 Archived-At: > (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.