Commit Graph

1092 Commits

Author SHA1 Message Date
7ce95a286b release 2.3.1 v2.3.1 2025-06-26 11:55:56 -07:00
c172951345 nit: fix indentation 2025-06-09 01:20:49 -07:00
0786f73669 fix: write unlinked references regex to a temp file
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: #2407
Close: #2408
2025-06-09 00:39:50 -07:00
df4e903208 perf: suppress extra org features in the temp buffer
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
2025-06-07 19:58:20 -07:00
d099204129 build: tidy up old issues
To keep us from having to triage a ton of old issues/PRs that may not be
relevant anymore; this should give us a fresh(ish) start.
2025-06-07 10:27:45 -07:00
031ee63bee (fix): Use correct type specifications to suppress warnings 2025-05-27 08:58:53 -07:00
fed577f805 refactor: improve speed of retrieving and formatting nodes
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
2025-05-25 00:15:21 -07:00
2ff616fbd8 release 2.3.0 v2.3.0 2025-05-24 23:06:32 -07:00
046822b512 Bump DB version to avoid error 2025-03-24 14:40:44 -07:00
cce9591c1c keep OLP data in node properties
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.
2025-03-23 17:20:13 -07:00
db4170a459 (perf): Deprecate link :outline properties
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.
2025-03-12 18:34:24 -07:00
0037daaf3e docs: update caching docs
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: #2486
Close: #2502
Close: #2415
2025-02-18 09:22:30 -08:00
888b5d1a67 Set org-roam-directory to a non-existent path to ensure robust test
* 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.
2025-02-18 08:58:24 -08:00
ed272eaf56 Address compiler warnings
Depend on Org 9.6 for `org-fold-show-context'.
2025-02-18 08:56:35 -08:00
551ff3b17e Use org-fold-show-context instead of obsolete function alias
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.
2025-02-18 08:56:35 -08:00
719594dfc7 org-roam-db: Don't unnecessarily enable foreign keys support
Starting with EmacSQL v4.1.0, `emacsql-sqlite-open' takes care of that.
2025-02-18 08:56:35 -08:00
b4b8d8c0ee (fix): fix error message 2025-02-18 08:56:35 -08:00
0d51698839 Rely on emacsql-sqlite-open to pick the best available back-end
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).
2025-02-18 08:56:35 -08:00
7dc76b708b fix(db): Org-roam does not store Org-ID w/ search option
add `:search-option` property to the `link` table when present.

Fix: #2495
Close: #2496
2025-02-17 13:51:29 -08:00
f3db974bcc fix #2425
(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.
2025-02-17 13:36:45 -08:00
bb08be4740 refactor!: do not include time zone in org iso8601
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
2025-02-17 12:48:43 -08:00
2490afe110 refactor: remove emacsql-sqlite backend option
This option is no longer supported in emacsql 4.0 and was throwing
linter errors in CI.

Ref: 7a79c2be3d
2025-02-17 12:48:43 -08:00
40b6c10d8a nit: formatting update
My editor reformatted some of the identation.  Also corrected a
docstring for org-roam-refile.
2025-02-17 12:48:43 -08:00
425d53d56d Use regexp match to replace hard-coded path equal test (#2497)
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: ""
`----
2025-01-11 10:55:35 -05:00
64e302c126 Depend on emacsql 4.0.0 (#2466)
See https://github.com/magit/emacsql/issues/113.  Emacsql 4.0.0 has
been released and should now be used in the package-requires header.
2025-01-10 21:52:11 -05:00
cad3518788 (fix): advise org-id-find rather than overwriting id link (#2432)
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/
2025-01-04 20:43:23 -08:00
2a630476b3 Take node as argument to #'org-roam-refile (#2388) 2024-10-07 19:04:46 +02:00
9fd7c87b5b Update org-roam.org (#2475)
Fix formatting for 2 code objects.
2024-09-17 19:40:37 +02:00
0b9fcbc97b (test): add org-roam-db-get-{scheduled|deadline}-time (#2465) 2024-07-16 22:35:22 +02:00
e415610b05 (test): add org-roam-db--file-hash (#2464) 2024-07-16 21:57:42 +02:00
3e186a8552 (fix): remove dead-code about org-roam-shield feature (#2462)
As described in https://github.com/org-roam/org-roam/issues/2348,
the `org-roam-shield-region` function is not called anymore.

The reverse function and associated face can also be removed.

Fix: #2348
2024-07-15 19:50:52 +02:00
0b2218706d (test): add org-roam-buffer-p (#2461) 2024-07-15 19:20:18 +02:00
84334b7e16 (test): add org-roam-file-p (#2460) 2024-07-15 18:37:15 +02:00
3c52d581ae (test): add org-roam-demote-entire-buffer (#2459) 2024-07-14 15:52:49 +02:00
fdd834d9bf (docs): explain org-roam-file-exclude-regexp (#2458) 2024-07-14 10:15:41 +02:00
8e6938a39d (docs): add missing versions dates and obsolete notice (#2456) 2024-07-08 20:50:41 +02:00
a753ec097d (test): add org-roam-alias-{add|remove} (#2455) 2024-07-08 19:29:24 +02:00
43a5362ada (test): add org-roam-node-from-{id|title-or-alias} (#2454) 2024-07-08 18:59:53 +02:00
a432539121 (test): add org-roam--get-titles (#2453) 2024-07-07 17:18:20 +02:00
1ce760ccc7 (test): add org-roam--buffer-promoteable-p (#2452) 2024-07-07 16:54:41 +02:00
76df9d1f3c (test): add org-roam-id-at-point (#2451) 2024-07-07 15:41:00 +02:00
74d714f789 (test): add org-roam-id-find (#2450) 2024-07-03 23:18:18 +02:00
6644cb27a9 (feat): allow a custom heading for a backlinks section (#2333)
Allow the user to set a custom heading for a backlinks section in the org-roam buffer
2024-07-03 20:56:42 +02:00
94b826d759 (feat): extract rg-command builder function from unlinked-references (#2449)
* (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
2024-07-03 19:26:03 +02:00
edccf9be84 (fix): org-roam-directory having spaces and Unlinked References not working (#2411)
Co-authored-by: Vikram Mandyam <vicky08@gmail>
2024-07-03 18:38:15 +02:00
aa64cc9596 (chore): fix indent blocking ci lint execution (#2448)
This mix of tabs and spaces was introduced recently in:
2e94f55cc5
2024-07-02 17:56:56 +02:00
e93c77f6a5 (docs): add details about org-roam-protocol with Homebrew (#2441)
Add additional information for setting up org-roam-protocol on Mac OS when using emacs installed from Homebrew (see also https://org-roam.discourse.group/t/problem-with-org-roam-protocol/3473)
2024-07-01 19:50:40 +02:00
2d1c5d78e8 Link Martin Edström's knowledge base (#2394) 2024-07-01 19:46:07 +02:00
f8b40a3109 (docs): fix name of my-org-roam-show-backlink-p (#2447)
Fix: #2392
2024-07-01 18:33:56 +02:00
7fdc7150cc Fix some typos (#2430) 2024-07-01 08:39:57 +02:00