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
`=' assumes that both objects being compared are numbers. In some
buffers `outline-level' can return nil, so `=' returns an error. `eq'
does not assume this, but does return t when comparing two numbers.
* (node): new custom `org-roam-ref-prompt-function'
Function for prompting when adding a ref.
* (node): use `org-roam-ref-prompt' in `org-roam-ref-add'
Prompt properly for ref.
This has an effect on find-file-hook for totally unrelated files,
through the callchain of `org-roam-db-autosync--setup-file-h ->
org-roam-file-p -> org-roam-descendant-of-p'.
From an org file, inside a project-el project, (find-file
"some/other/file") will intermittently reproduce this error:
org-roam-descendant-of-p: Wrong type argument: arrayp, nil
If this fix seems inappropriate -- it could amount to surppressing a
valid error in routine calls -- then I would advise throwing an
explicit signal here, or finding a safer way to get the `path` inside
`org-roam-file-p'; the current means:
(or file (buffer-file-name (buffer-base-buffer)))
.. can result in nil, which then bleeds errors into use elsewhere.
for posterity, here is the full calling context I'm referring to, from
`org-roam-file-p'.
(let* ((path (or file (buffer-file-name (buffer-base-buffer))))
(ext (when path (org-roam--file-name-extension path)))
(ext (if (string= ext "gpg")
(org-roam--file-name-extension (file-name-sans-extension path))
ext))
(org-roam-dir-p (org-roam-descendant-of-p path
org-roam-directory))
...
* don't complete org-roam nodes in source blocks
This fixes the following situation where
`org-roam-completion-everywhere = t` and you are working with org-babel
blocks in one of your org-roam nodes.
```
```
Before my nodes would be suggested, but after this change only valid
babel headers are suggested as desired.
Previously completions from org-roam nodes would be suggested
* fix lints
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
`org-roam-unlinked-references-section` would get nil org-roam-node-title
when create a headline node, which caused the issue #1625. This commit
add a check to make `org-roam-unlinked-references-section` work
correctly.