English 中文(简体)
组织带有星形模式标签的笔记
原标题:Organizing notes with tags in org-mode

因此,我在日常TODD 要求中广泛使用兽形模式。 我在想我是否也可以有效地使用它来保存笔记。 我基本上想要的是用标签存储笔记,然后用标签搜索这些笔记。 例如,如果我有类似的话

* 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

然后我寻找标签1,我应该有类似的东西...

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

我希望能够在不将文件添加到议事日程上的情况下完成这项工作。 (我可能有一些笔记,我只想一次搜索当前文件。 )

难道有一条容易(或不那么容易)的方法可以实现这种兽形吗?

最佳回答

以下函数应提供您想要的结果 。

(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))
问题回答

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

http://orgmode.org/manual/Tag-searches.html" rel=“noreferrer>>http://orgmode.org/manual/Tag-searches.html

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





相关问题
suppress additional braces in emacs electric mode

I started using ruby-electric-mode. I like it except that I am used to closing open brackets myself (the other pairing are still useful to me). How can I make emacs suppress additional brackets when ...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything ...

Emacs Setting which-function-mode

I would like to have which-function-mode on by default when I open up Emacs. I ve added the following lines to my .emacs file. (setq which-func-mode t) (setq which-function-mode t) When I open ...

Enabling go mode for emacs

I don t seem to be able to enable a go mode for emacs. C mode doesn t work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn t require ...

Custom Emacs key bindings are not working

The key bindings I ve defined in my .emacs file aren t working. Here s the file: ;init modes (menu-bar-mode 0) (tool-bar-mode 0) (cua-mode) (column-number-mode) (fset perl-mode cperl-mode) (cperl-...

eval during emacs lisp macro expansion

How can I fix the simple macro foo in (elisp)Eval During Expansion? None of the followings work: (defmacro foo1 (a) `(setq (eval ,a) t)) (defmacro foo2 (a) `(setq ,(eval a) t)) (defmacro foo3 (...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签