5

To read Emacs Lisp Intro, I type C-hi and choose the book.
Then I type C-x3 and try to see another section in the right window.
But once I choose another section in the right window, the left window changes too!

I know that a new session with Emacs is helpful.
Is there any other way?

shynur
  • 4,065
  • 1
  • 3
  • 23

2 Answers2

3

The trick is to change the buffer name.

  • C-h i and don't choose anything yet.
  • C-x 3 to split the frame into 2 windows.
  • Focus on the window where you want the second info instance to be. Either is fine.
  • C-x x r to rename the buffer to anything other than *info*.
  • C-h i again, and now you have two independent info buffers in their own windows.

This technique also works for when you want multiple instances of a shell or terminal inside emacs. Change the buffer name, and when you ask emacs to create a new instance, the new instance will use the default buffer name and leave the renamed buffer alone. Try it with eshell or vterm.

g-gundam
  • 1,096
  • 1
  • 3
  • 13
3

You can use the clone-buffer (M-n) command. It lets you navigate through each buffer independently.

<menu-bar> <Info> <Clone Info buffer> runs the command clone-buffer
(found in Info-mode-map), which is an interactive compiled Lisp
function in ‘simple.el’.

It is bound to M-n, <menu-bar> <Info> <Clone Info buffer>.

(clone-buffer &optional NEWNAME DISPLAY-FLAG)

  Probably introduced at or before Emacs version 21.1.

Create and return a twin copy of the current buffer.
Unlike an indirect buffer, the new buffer can be edited
independently of the old one (if it is not read-only).
NEWNAME is the name of the new buffer.  It may be modified by
adding or incrementing <N> at the end as necessary to create a
unique buffer name.  If nil, it defaults to the name of the
current buffer, with the proper suffix.  If DISPLAY-FLAG is
non-nil, the new buffer is shown with ‘pop-to-buffer’.  Trying to
clone a file-visiting buffer, or a buffer whose major mode symbol
has a non-nil ‘no-clone’ property, results in an error.

Interactively, DISPLAY-FLAG is t and NEWNAME is the name of the
current buffer with appropriate suffix.  However, if a prefix
argument is given, then the command prompts for NEWNAME in the
minibuffer.

This runs the normal hook ‘clone-buffer-hook’ in the new buffer
after it has been set up properly in other respects.
gigiair
  • 2,124
  • 1
  • 8
  • 14