mirror of
https://github.com/org-roam/org-roam
synced 2025-08-03 12:27:23 -05:00
(feat): allow ignoring files matching a regular expression (#1046)
Adds a new user option, `org-roam-file-exclude-regexp`, to exclude files from Org-roam.
This commit is contained in:
@ -10,6 +10,7 @@ In this release we support fuzzy links of the form `[[Title]]`, `[[*Headline]]`
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
- [#1046](https://github.com/org-roam/org-roam/pull/1046) New user option to exclude files from Org-roam
|
||||||
- [#1032](https://github.com/org-roam/org-roam/pull/1032) File changes are now propagated to the database on idle timer. This prevents large wait times during file saves.
|
- [#1032](https://github.com/org-roam/org-roam/pull/1032) File changes are now propagated to the database on idle timer. This prevents large wait times during file saves.
|
||||||
- [#974](https://github.com/org-roam/org-roam/pull/974) Protect region targeted by `org-roam-insert`
|
- [#974](https://github.com/org-roam/org-roam/pull/974) Protect region targeted by `org-roam-insert`
|
||||||
- [#994](https://github.com/org-roam/org-roam/pull/994) Simplify org-roam-store-link
|
- [#994](https://github.com/org-roam/org-roam/pull/994) Simplify org-roam-store-link
|
||||||
|
@ -513,6 +513,10 @@ This section concerns the placement and creation of files.
|
|||||||
It is the user’s responsibility to set this correctly, especially when used
|
It is the user’s responsibility to set this correctly, especially when used
|
||||||
with multiple Org-roam instances.
|
with multiple Org-roam instances.
|
||||||
|
|
||||||
|
- Variable: org-roam-file-exclude-regexp
|
||||||
|
|
||||||
|
Files matching this regular expression are excluded from the Org-roam.
|
||||||
|
|
||||||
** The Org-roam Buffer
|
** The Org-roam Buffer
|
||||||
|
|
||||||
The Org-roam buffer displays backlinks for the currently active Org-roam note.
|
The Org-roam buffer displays backlinks for the currently active Org-roam note.
|
||||||
|
@ -731,6 +731,11 @@ database is saved here.
|
|||||||
|
|
||||||
It is the user’s responsibility to set this correctly, especially when used
|
It is the user’s responsibility to set this correctly, especially when used
|
||||||
with multiple Org-roam instances.
|
with multiple Org-roam instances.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Variable: org-roam-file-exclude-regexp
|
||||||
|
|
||||||
|
Files matching this regular expression are excluded from the Org-roam.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@node The Org-roam Buffer
|
@node The Org-roam Buffer
|
||||||
|
@ -100,6 +100,13 @@ ensure that."
|
|||||||
:type '(repeat string)
|
:type '(repeat string)
|
||||||
:group 'org-roam)
|
:group 'org-roam)
|
||||||
|
|
||||||
|
(defcustom org-roam-file-exclude-regexp nil
|
||||||
|
"Files matching this regular expression are excluded from the Org-roam."
|
||||||
|
:type '(choice
|
||||||
|
(string :tag "Regular expression matching files to ignore")
|
||||||
|
(const :tag "Include everything" nil))
|
||||||
|
:group 'org-roam)
|
||||||
|
|
||||||
(defcustom org-roam-find-file-function nil
|
(defcustom org-roam-find-file-function nil
|
||||||
"Function called when visiting files in Org-roam commands.
|
"Function called when visiting files in Org-roam commands.
|
||||||
If nil, `find-file' is used."
|
If nil, `find-file' is used."
|
||||||
@ -342,6 +349,8 @@ If FILE is not specified, use the current buffer's file-path."
|
|||||||
(save-match-data
|
(save-match-data
|
||||||
(and
|
(and
|
||||||
(org-roam--org-file-p path)
|
(org-roam--org-file-p path)
|
||||||
|
(not (and org-roam-file-exclude-regexp
|
||||||
|
(string-match-p org-roam-file-exclude-regexp path)))
|
||||||
(f-descendant-of-p (file-truename path)
|
(f-descendant-of-p (file-truename path)
|
||||||
(file-truename org-roam-directory))))))
|
(file-truename org-roam-directory))))))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user