在组织模式下使用标签组织笔记

Shi*_*nth 13 emacs org-mode

因此,我广泛使用org-mode来满足我的日常TODO要求.我想知道我是否也可以有效地使用它来记笔记.我基本上想要的是存储带有标签的笔记,然后想要通过标签搜索这些笔记.例如,如果我有这样的事情

* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
** Note 2 :tag3:
Note 2 details
* Heading 2
** Note 3
** Note 4 :tag1:
Note 4 details
Run Code Online (Sandbox Code Playgroud)

然后我搜索tag1,我应该有类似的东西 -

* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
* Heading 2
** Note 4 :tag1:
Note 4 details
Run Code Online (Sandbox Code Playgroud)

我希望能够在不将文件添加到我的议程的情况下执行此操作.(我可能有几个这样的笔记,我只想一次搜索当前文件.)

是否有一种简单(或不那么容易)的方式来完成这种组织模式?

Jon*_*pin 9

以下函数应提供所需的结果.

(defun zin/org-tag-match-context (&optional todo-only match)
  "Identical search to `org-match-sparse-tree', but shows the content of the matches."
  (interactive "P")
  (org-prepare-agenda-buffers (list (current-buffer)))
  (org-overview) 
  (org-remove-occur-highlights) 
  (org-scan-tags '(progn (org-show-entry) 
                         (org-show-context)) 
                 (cdr (org-make-tags-matcher match)) todo-only))
Run Code Online (Sandbox Code Playgroud)


Jua*_*cho 8

您可以使用标签搜索(C-c / m tag1 <ret>).文档在这里:

http://orgmode.org/manual/Tag-searches.html

这将创建一个稀疏树,仅显示包含的标题:tag1:,但不会像您的示例中那样自动显示该标题的内容.