如何在emacs的单个调用中打开新帧中的间接缓冲区?

时间:2017-11-16 10:20:45

标签: emacs

有一些函数可以在新帧(display-buffer-other-frameswitch-to-buffer-other-frame)中打开缓冲区,但是如何在新帧中创建间接缓冲区(在单个调用中,是)?

1 个答案:

答案 0 :(得分:1)

这是你在找什么?

  

clone-indirect-buffer-other-window 是一个交互式编译的Lisp   simple.el中的函数。

     

它绑定到 C-x 4 c

     

(clone-indirect-buffer-other-window NEWNAME DISPLAY-FLAG &optional NORECORD)

     

clone-indirect-buffer类似,但显示在另一个窗口中。

使用C-h f clone-indirect-buffer查看该命令的详细信息。

好的,您希望它在单独的框架中打开,而不仅仅是单独的Emacs 窗口。为此,您可以定义自己的clone-indirect-buffer-other-frame,但只需将pop-up-frames绑定到t围绕clone-indirect-buffer的调用,就像clone-indirect-buffer-other-window绑定pop-up-windows一样1}}。

(defun clone-indirect-buffer-other-frame (newname display-flag &optional norecord)
  "Like `clone-indirect-buffer' but display in another window."
  (interactive
   (progn
     (if (get major-mode 'no-clone-indirect)
     (error "Cannot indirectly clone a buffer in %s mode" mode-name))
     (list (if current-prefix-arg
           (read-buffer "Name of indirect buffer: " (current-buffer)))
       t)))
  ;; (let ((pop-up-windows t))
  (let ((pop-up-frames t)) ; <==========
    (clone-indirect-buffer newname display-flag norecord)))