bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to view two info files at the same time?


From: Juri Linkov
Subject: Re: How to view two info files at the same time?
Date: Sun, 11 Apr 2004 01:34:06 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Kevin Rodgers <ihs_4664@yahoo.com> 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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]