在组织模式下使用标签组织笔记 [英] Organizing notes with tags in org-mode

查看:89
本文介绍了在组织模式下使用标签组织笔记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,对于我的日常TODO要求,我广泛使用org-mode。我想知道我是否还可以有效地将其用于记笔记。我基本上想要的是存储带有标签的注释,然后再通过标签搜索这些注释。例如。如果我有这样的东西

So, I use org-mode extensively for my daily TODO requirements. I am wondering if I can also use it effectively for note keeping. What I basically want is to store notes with tags, and then want to search these notes by the tags. E.g. If I have something like this

* 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

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

and then I search for tag1, I should have something like-

* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
* Heading 2
** Note 4 :tag1:
Note 4 details

我希望能够做到这一点而无需将文件添加到我的议程中。 (我可能有几个注释,我只想一次搜索当前文件。)

I would prefer being able to do this without adding the files to my agenda. (I may have several of these notes, and I would only want to search the current file at a time.)

有一种简单(或不太容易)的方法吗?完成此组织模式?

Is there an easy (or not so easy) way to accomplish this org-mode?

推荐答案

以下功能应提供所需的结果。

The following function should provide the result you want.

(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))

这篇关于在组织模式下使用标签组织笔记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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