Node titles with special characters (single quotes, dollar signs, etc.)
break the ripgrep command because the regex pattern is passed through
the shell. This causes silent failures that show up as unlinked
references not being present for a given node.
This change writes the regex pattern to a temp file and uses ripgrep's
--file option instead of shell command line. `shell-quote-argument` is
replaced with `regexp-quote` since we're no longer passing through
shell. Wrapped in unwind-protect for cleanup.
Fix: #2407Close: #2408
Figuring out how to indent things and folding and clock updates, etc.
consumes a great deal of time especially considering that files
are (currently) processed for /every single backlink/ even if multiple
backlinks come from the same file.
This dramatically improves the load/refresh time for the org-roam
buffer.
Fix: #2399
The original code uses macros that when expanded use a lot memory
and are relatively slow. This removes some of that processing:
- Add a constructor to org-roam-node that does uses parameters
by position instead or by name
- Add the option of using a function to format nodes. The current
code uses a string template. But this template is processes
for every node. Using a function will further improve
performance significantly.
Simplified expected return value user's template function.
As suggested by akashpal-21, the return value of the user's template
function can be simpler.
I have refactored the code such that the function only returns
a string (potentially propertized) with the formatted node.
I have also modified the documentation of
org-roam-node-display-template with an example of the user defined
function.
Acknowledgement: akashpal-21 for the suggestion for improvement
Close: #2511
Not all links to a node come from another node. Persisting OLP data
allows us to build backlinks with information about these non-node
headings.
Revert: db4170a459.
As it happens, turning sexps into strings is one of the
computationally expensive steps in EmacSQL.
With an enormous number of links in the database, that's a lot
of (:outline nil) to stringify into "(:outline nil)".
Its only use was in org-roam-node-insert-section,
where the information is very cheap to reconstruct.
It's already in one of the other arguments!
This has passed unnoticed because org-roam-db-sync has other
performance tarpits, but it will probably be noticed eventually after
those get fixed.
Now that emacsql handles choosing an appropriate backend/connector, we
do not need to provide these instructions. If there are issues, emacsql
has good error messages that tell the user what they need to do to get
things working.
In general:
- If the user is on Emacs >= 29, emacsql will use the built-in sqlite
functionality that comes with Emacs.
- If the user is on Emacs < 29, emacsql will use a module-based
connector that requires the user to have certain libraries available
on their machine. emacsql will tell the user what is needed if they
do not have it already.
Ref: #2486Close: #2502Close: #2415
* In some rare case, the first expect of org-roam-file-p may return t
when running in some environment (e.g. during autopkgtest in Debian).
* Setting org-roam-directory to a non-existent path ensure that the
first check is always nil as expected.
To avoid having to create a wrapper function and silence the byte-
compiler for both when using a pre-rename and post-rename Org, keep
it simple and just depend on Org 9.6.
That function was added two years ago and the first release that
provided it was v4.0.0. It automatically picks the best available
back-end, `emacsql-sqlite-builtin' or `emacsql-sqlite-module'.
In v4.0.0 it could also fall back to the legacy `emacsql-sqlite'.
The inferior third-party back-ends are no longer supported.
Emacsql v4.1.0, which will be releases in early December, removes
the legacy `emacsql-sqlite' back-end (which used a custom binary).
(kill-whole-line) kills folded text if called from column 1
Make sure to unfold text before calling it --
Prevents data loss if user has decided to extract subtree on a folded org headline.
org mode timestamps do not support time zones, so returning the
machine's local time zone is misleading.
Also, org-format-time-string is an obsolete alias of format-time-string.
Ref: cc2490a706
Hard-coded paths cause the tests to fail when building under different
environments, e.g. under Debian sbuild it fails with the following
errors:
,----
| ========================================
| org-roam-id-find finds the correct file node
| FAILED: Expected `(car location)' to be `equal' to `"/home/runner/work/org-roam/org-roam/tests/roam-files/foo.org"', but instead it was `"/build/reproducible-path/org-roam-2.2.2+git20250105.cad3518/tests/roam-files/foo.org"' which does not match because: (arrays-of-different-length 84 60 "/build/reproducible-path/org-roam-2.2.2+git20250105.cad3518/tests/roam-files/foo.org" "/home/runner/work/org-roam/org-roam/tests/roam-files/foo.org" first-mismatch-at 1).
|
| ========================================
| org-roam-id-find finds the correct heading node
| FAILED: Expected `(car location)' to be `equal' to `"/home/runner/work/org-roam/org-roam/tests/roam-files/family.org"', but instead it was `"/build/reproducible-path/org-roam-2.2.2+git20250105.cad3518/tests/roam-files/family.org"' which does not match because: (arrays-of-different-length 87 63 "/build/reproducible-path/org-roam-2.2.2+git20250105.cad3518/tests/roam-files/family.org" "/home/runner/work/org-roam/org-roam/tests/roam-files/family.org" first-mismatch-at 1).
|
| Ran 41 specs, 2 failed, in 980.31ms.
| buttercup-run failed: ""
`----
There have been recent changes in org-mode to improve `org-id-open' to
be able to apply search strings in id: links. But, org-roam overrides
the `:follow` parameter for id: links to its own `org-roam-id-open'
function and therefore misses this.
The only change that `org-roam-id-open' makes is to try calling
`org-roam-id-find' before falling back on `org-id-find'. This commit
uses advice to do this directly, thereby integrating better with
`org-id-open'.
There was some discussion on the org-mode list about adding a custom
variable to avoid using advice, but this accomplishes the result
without requiring changes in org:
https://list.orgmode.org/87jzlxjiuf.fsf@localhost/
* (test): add "org-roam--list-files-search-globs"
* (feat): extract rg-command builder function from unlinked-references
Users can now advice this command to tweak the flag pased to ripgrep.
The current one have been expanded to long-form.
It's a follow up to the fix about shell quoting
* (docs): update CHANGELOG