This mostly goes over docstrings, updating them in places where it was
outdated and adding them to places where they didn't exist or were
existed as placeholders.
This brings them more in line with how other Org keywords, such as
\#+PROPERTY, are declared.
Previously
#+roam_alias: abc def
#+roam_alias: ghi
would result in only the last one ("ghi") being extracted. Now ("abc"
"def" "ghi") are all extracted (in that order).
* org-roam.el (org-roam--extract-tags-prop, org-roam--extract-titles-alias): Accept and return all values in a list, not just from one line.
(org-roam--extract-prop-as-list): New function. List prop extraction refactored from `org-roam--extract-tags-prop` and `org-roam--extract-titles-alias`
* tests/test-org-roam.el: Add tests for defining tags and aliases in multiple lines
* Normalize slug using ucs-normalize-NFC-string after remove Unicode spacing mark
* Add org-roam-slug--preserve-chars-from-normalization for Unicode Normalization
* Add org-roam-slug-trim-chars instead of org-roam-slug--preserve-chars-from-normalization
Instead of storing preview content in the database, now provide a
function to fetch these on the fly. This paves the way for future
improvements (e.g. showing more lines)
We need to split the ref into its type/file before querying the db for a
match. Throw a warning when `org-roam--capture-new-file` tries to
recreate an existing file.
* (feat): Support file-property drawers
Add support for file-property drawers in property extraction. This means
the following is now supported:
:PROPERTIES:
:ROAM_ALIAS: alias
:ROAM_TAGS: tag1 tag2
:END:
When `org-roam-directory` doesn't end with trailing slash and
`org-roam-index-file` contains relative filename, absolute path
to org-roam index file returned by `org-roam--get-index-path` is
malformed and invalid.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
The rename file advice is passed relative file names: e.g. "foo.org" ->
"bar.org". This was not accounted for, and paths in the Org-roam
database are supposed to be absolute paths. This caused the storing of
relative paths in the Org-roam database, which were then never purged.
Fixes#1304
Every file has a title when saved into the database, so this function is
redundant in most cases (e.g. in org-roam-buffer, where backlinks are
fetched from the database).
* (feat): add `org-roam-db-update-method`
Add `org-roam-db-update-method`, which can be one of two choices:
1. `immediate`: the cache is updated upon file changes
2. `idle-timer`: Marks the org-roam database as dirty. If Emacs idles
for some seconds, the Org-roam cache is updated. This is the default,
and current behaviour.
The idle method makes for a smoother editing experience, but some
inconsistencies can be faced.
* org-roam-update-db-idle-seconds -> org-roam-db-update-idle-seconds
org-roam-id-get-file no longer falls back onto the current buffer: It queries the org-roam database, and optionally org-id-locations, and declares that it does not exist if it isn't in either.
Instead of maintaining a file queue to process for updating the Org-roam
database, we instead simply call `org-roam-db-build-cache` to rebuild
the db. `org-roam-db-build-cache` feels Fast Enough(TM), and basically
runs instantly if no files are modified. This greatly simplifies the
code, basically allowing to maintaining a single code path for db
operations.
This PR should also address the slowness wrt to ID links. Org-roam now
builds the headline information first, so there is no need to read the
file to check if the headline is there. The downside to this is that
this only works for IDs in Org-roam files.
* (fix): use org-roam-link-title-format in link replacement
Makes `org-roam-format-link` respect `org-roam-link-title-format`.
Also removes lowercasing via prefix argument in `org-roam-insert`, not
sure how many people use it.
* update changelog
* (fix): fall back to org-id search ID face computation
Fixes the scenario where the face is reported as invalid although it is
part of Org's ID files (e.g. in the agenda).
Fixes#1191.
This can however slow face computation a lot (when there are many org
id/agenda files). Here, we choose to focus on correctness.
* Document faces, default to only applying to Org-roam notes
Otherwise it breaks `org-roam-db-build-cache` as it relies on temporary buffer.
Without keeping the buffer, `org-roam--extract-links` kills it and any further
functionality of file processing breaks.
Prevent error when trying to move file to same name
Prevent string matching in org from messing with the current re-search-forward
position which has caused infinite broken search