当前缓冲区的议程视图 [英] Agenda view of the current buffer

查看:91
本文介绍了当前缓冲区的议程视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:解决方案很简单,但是对任何可以解释为什么我的方法不起作用的人来说都是加分点。

The solution was simple but "bonus points" for anyone that can explain why my method didn't work.

原点:$ b​​ $ b就像org-mode-custom-command一样,显示仅由当前缓冲区制成的议程。

ORIG: I would like an org-mode-custom-command to display an agenda which is only made from the current buffer.

以下代码段显示了我想要的视图。

The following snippet shows the kind of view that I want.

(setq org-agenda-custom-commands
      '(("b" "Buffer summary"
     ((todo "TODO" ((org-agenda-files '("~/.agenda/notes.org"))))))))

但是,我不想指定文件名,而是想使用当前缓冲区。

But, I don't want to specify a filename, rather I want to use the current buffer. Here is my stab at it.

(setq org-agenda-custom-commands
      '(("b" "Buffer summary"
     ((todo "TODO" ((org-agenda-files (buffer-file-name))))))))

当我打开组织缓冲区并运行此议程命令时,结果只是一个非常空白的议程视图。我想这是因为在我按议程视图时,缓冲文件名的评估要晚一点……?

When I open an org-buffer and run this agenda command the result is just a pretty much blank agenda view. I presume it's because buffer-file-name is being evaluated at point later than when I press the agenda view...?

我仍然开始学习elisp,所以不要犹豫指出显而易见的地方。谢谢。

I'm still beginning to learn elisp, so don't hesitate to point out the obvious. Thank-you.

编辑:

评论中有建议。

(setq org-agenda-custom-commands
      '(("b" "Buffer summary"
     ((todo "TODO" ((org-agenda-files (list (buffer-file-name)))))))))

我收到回溯。

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-directory-p(nil)
...etc...


推荐答案

对我来说,最明显的是不创建额外的议程视图,而仅在该缓冲区上调用任何现有视图(通过调用诸如<$将视图限制为当前缓冲区) c $ c> Cc a< a ,其中< 对当前缓冲区的限制)。

For me, the most obvious is NOT to create an extra agenda view, and simply call any existing view on that buffer only (limit the view to the current buffer with a call such as C-c a < a, where < limits on the current buffer).

如果您仍想为当前缓冲区创建一个额外的议程视图,则不确定所有命令是否都可以实现。当然,调用 occur-tree 将在当前缓冲区上工作。不确定待办事项之类。

If you still want to make an extra agenda view for the current buffer, I'm not sure whether that's possible with all commands. For sure, calling occur-tree will work on the current buffer. Not sure about todo and the like.

这篇关于当前缓冲区的议程视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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