From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: Re: How to view two info files at the same time? Date: Sun, 11 Apr 2004 01:34:06 +0300 Organization: JURTA Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87hdvre1cl.fsf@mail.jurta.org> References: <16503.7260.313696.171759@ihs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1081651837 29550 80.91.224.253 (11 Apr 2004 02:50:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2004 02:50:37 +0000 (UTC) Cc: gnu-emacs-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 04:50:29 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BCV3F-0003SQ-00 for ; Sun, 11 Apr 2004 04:50:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCUvu-0002gP-KO for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2004 22:42:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BCUqN-0008Lz-7j for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2004 22:37:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BCUp6-0007k2-5m for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2004 22:36:23 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCUp5-0007jb-H9 for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2004 22:35:51 -0400 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.24) id 1BCUp5-0006zd-6u for gnu-emacs-bug@gnu.org; Sat, 10 Apr 2004 22:35:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BCUnG-0006WR-Ld for gnu-emacs-bug@gnu.org; Sat, 10 Apr 2004 22:34:29 -0400 Original-Received: from [66.33.219.4] (helo=spork.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCUnG-0006W8-8X for gnu-emacs-bug@gnu.org; Sat, 10 Apr 2004 22:33:58 -0400 Original-Received: from mail.jurta.org (80-235-32-66-dsl.mus.estpak.ee [80.235.32.66]) by spork.dreamhost.com (Postfix) with ESMTP id E7F0811DC0C; Sat, 10 Apr 2004 19:33:55 -0700 (PDT) Original-To: Kevin Rodgers User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:7569 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:7569 Kevin Rodgers writes: > [Followup-To: gnu.emacs.bug] > Jesper Harder wrote: > > Press `M-n' (clone-buffer) in the Info buffer -- then you can browse > > two Info files at the same time. > > `C-h i M-n' gives me a frame split into 2 windows, with the top window > displaying the *info* buffer and the bottom selected window displaying > the *info*<2> buffer. Then I type `C-u C-h i /foo/bar.info RET' > expecting to replace the contents of *info*<2> with /foo/bar.info, but > instead both windows now display the *info* buffer, which now contains > /foo/bar.info (the contents of *info*<2> are unchanged and it's not > displayed). > > I think (pop-to-buffer "*info*") when FILE is specified for `M-x info' > should be (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")), just > like it is in Info-find-node. I think you are right. The related problem for the same command is discussed currently on emacs-pretest-bug@gnu.org with the conclusion that calling M-x info on a buffer in Info-mode but with the name other than *info* should make a new *info* buffer. Even though these two behaviors seems contradicting to each other, I think it's correct: M-x info should always pop to the *info* buffer, but C-u M-x info should pop to the *info* buffer only when called from a buffer not in Info-mode. The reason is that usually the user expects to open a new Info file in the same Info buffer where C-u M-x Info is called, but with calling M-x info the user expects an *info* buffer. diff -u -r1.381 info.el --- emacs/lisp/info.el 8 Apr 2004 03:42:59 -0000 1.381 +++ emacs/lisp/info.el 10 Apr 2004 19:55:17 -0000 @@ -472,7 +472,7 @@ (list (read-file-name "Info file name: " nil nil t)))) (if file (progn - (pop-to-buffer "*info*") + (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) ;; If argument already contains parentheses, don't add another set ;; since the argument will then be parsed improperly. This also ;; has the added benefit of allowing node names to be included @@ -480,9 +480,8 @@ (if (and (stringp file) (string-match "(.*)" file)) (Info-goto-node file) (Info-goto-node (concat "(" file ")")))) - (if (get-buffer "*info*") - (pop-to-buffer "*info*") - (Info-directory)))) + (pop-to-buffer "*info*") + (or (eq major-mode 'Info-mode) (Info-directory)))) -- Juri Linkov http://www.jurta.org/emacs/