unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: gnu-emacs-bug@gnu.org
Subject: Re: How to view two info files at the same time?
Date: Sun, 11 Apr 2004 01:34:06 +0300	[thread overview]
Message-ID: <87hdvre1cl.fsf@mail.jurta.org> (raw)
In-Reply-To: 16503.7260.313696.171759@ihs.com

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	other threads:[~2004-04-10 22:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hdvre1cl.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=gnu-emacs-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).