unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Re: How to view two info files at the same time?
       [not found] ` <m3eks3vahj.fsf@defun.localdomain>
@ 2004-04-09 21:57   ` Kevin Rodgers
  2004-04-10 22:34     ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Rodgers @ 2004-04-09 21:57 UTC (permalink / raw)


[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.  And I don't know why the same change
could not be made to Info-goto-emacs-command-node, which contains this:

	  ;; FIXME It would be cool if this could use a buffer other
	  ;; than *info*.
	  (pop-to-buffer "*info*")

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to view two info files at the same time?
  2004-04-09 21:57   ` How to view two info files at the same time? Kevin Rodgers
@ 2004-04-10 22:34     ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2004-04-10 22:34 UTC (permalink / raw)
  Cc: gnu-emacs-bug

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-10 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <c2hl7v$125a$1@mail.cn99.com>
     [not found] ` <m3eks3vahj.fsf@defun.localdomain>
2004-04-09 21:57   ` How to view two info files at the same time? Kevin Rodgers
2004-04-10 22:34     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).