在特定窗口中打开组织捕获缓冲区? [英] Open Org Capture buffer in specific window?

查看:77
本文介绍了在特定窗口中打开组织捕获缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成为Emacs用户约一年了。我通常每个会话都设置一个相同的窗口(四个窗口)。

I've been an Emacs user for about a year or so. I routinely have the same window set up each session (four windows).

我已经设置了捕获模板,可以捕获所需的内容,但是:而不是捕获模式暂时将我从窗口设置中拉出,我希望所选的捕获模板在新的(第五个)窗口中打开,并保留我现有的布局。我通常希望捕获模板打开一段时间,这样会造成破坏。

I've set up capture templates and can capture what I want, but: instead of capture mode temporarily jerking me out of my window setup, I'd like the chosen capture template to open in a new (fifth) window, preserving my existing layout. I typically want the capture template open for a while, so it's disruptive.

这个似乎似乎是一个显而易见的选择,但是我可以不知道。预先感谢所有Emacs的帮助。

This seems like it would be an obvious option, but I can't figure it out. Thanks in advance to all the Emacs heads out there.

推荐答案

我想出了一个易于使用的 Dan对所链接问题的回答:

I came up with a easier-to-use version of Dan's answer to the linked question:

(defun my-org-capture-place-template-dont-delete-windows (oldfun args)
  (cl-letf (((symbol-function 'delete-other-windows) 'ignore))
    (apply oldfun args)))

(with-eval-after-load "org-capture"
  (advice-add 'org-capture-place-template :around 'my-org-capture-place-template-dont-delete-windows))

不得不修改组织模式代码并删除对 delete-other-windows 的调用,这段代码临时重新定义了 delete-other-windows 忽略 ,而调用 org-capture-place-template

That is, instead of having to modify Org-mode code and remove the call to delete-other-windows, this piece of code temporarily redefines delete-other-windows to ignore while org-capture-place-template is being called.

它并没有完全满足您的要求:它会选择一个现有的窗口并放入捕获窗口缓冲在那里。至少比删除所有以前的窗口的默认行为要好。

It doesn't do quite what you want: it picks one of the existing windows and puts the capture buffer there. At least it's better than the default behaviour of removing all previous windows but one.

也许可以通过自定义变量来完成所需的操作display-buffer-alist ,但我不知道...

There's probably a way to do what you want by customising the variable display-buffer-alist, but I couldn't figure it out...

这篇关于在特定窗口中打开组织捕获缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆