(feat): add vanilla org-mode-tag-source (#1093)

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
This commit is contained in:
Sophie Taylor
2020-09-13 04:45:45 +10:00
committed by GitHub
parent 70539c40d2
commit fc3a03977d
2 changed files with 9 additions and 1 deletions

View File

@ -10,6 +10,7 @@ In this release we support fuzzy links of the form `[[Title]]`, `[[*Headline]]`
### Features ### Features
- [#1093](https://github.com/org-roam/org-roam/pull/1093) Add `vanilla` org-roam-tag-source to extract buffer Org tags
- [#1079](https://github.com/org-roam/org-roam/pull/1079) Add `org-roam-tag-face` to customize appearance of tags in interactive commandsg - [#1079](https://github.com/org-roam/org-roam/pull/1079) Add `org-roam-tag-face` to customize appearance of tags in interactive commandsg
- [#1073](https://github.com/org-roam/org-roam/pull/1073) Rename file on title change, when `org-roam-rename-file-on-title-change` is non-nil. - [#1073](https://github.com/org-roam/org-roam/pull/1073) Rename file on title change, when `org-roam-rename-file-on-title-change` is non-nil.
- [#1071](https://github.com/org-roam/org-roam/pull/1071) Update link descriptions on title changes, and clean-up rename file advice - [#1071](https://github.com/org-roam/org-roam/pull/1071) Update link descriptions on title changes, and clean-up rename file advice

View File

@ -197,7 +197,9 @@ extraction methods:
Tags are space delimited. Tags are space delimited.
Tags may contain spaces if they are double-quoted. Tags may contain spaces if they are double-quoted.
e.g. #+roam_tags: TAG \"tag with spaces\" e.g. #+roam_tags: TAG \"tag with spaces\"
`vanilla'
Extract vanilla `org-mode' tags, including #+FILETAGS and
inherited tags.
`all-directories' `all-directories'
Extract sub-directories relative to `org-roam-directory'. Extract sub-directories relative to `org-roam-directory'.
That is, if a file is located at relative path foo/bar/file.org, That is, if a file is located at relative path foo/bar/file.org,
@ -726,6 +728,11 @@ tag."
(buffer-file-name))) (buffer-file-name)))
nil))))) nil)))))
(defun org-roam--extract-tags-vanilla (_file)
"Extract vanilla `org-mode' tags.
This includes all tags used in the buffer."
(-flatten (org-get-buffer-tags)))
(defun org-roam--extract-tags (&optional file) (defun org-roam--extract-tags (&optional file)
"Extract tags from the current buffer. "Extract tags from the current buffer.
If file-path FILE, use it to determine the directory tags. If file-path FILE, use it to determine the directory tags.