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.
* Revert "(fix): `org-roam-descendant-of-p` bug on Windows (#2089)"
This reverts commit 97a342fd3f.
Reason:
It seems that the `file-in-directory-p` function proposed in #2089 is provided only for
*physical directories*, does not work as we would like with *symlinked directories*.
It dereferences all the symlinks in its path, and previously seemed related paths
cease to be such.
Because of this, such notes are ignored and not indexed, although they
were indexed earlier.
On Windows, `file-truename` and `directory-file-name` downcase driver
label: "C:/" => "c:/", while `expand-file-name` keep the case
unchanged. If `org-roam-directory` use upper case driver label, `org-roam-descendant-of-p` will alway return `nil`. Fix by only using `file-truename` in the function.
Let's assume we're evaluating the following region:
```elisp
(org-roam-capture-
:node (org-roam-node-create :title "Org Roam Homepage")
:info '(:ref "https://orgroam.com")
:props '(:immediate-finish nil))
```
Prior to this commit, if you did not require "org-roam-protocol" then
`org-roam-capture-` would ignore the `:info '(:ref
"https://orgroam.com")` parameter. Once you required
"org-roam-protocol" then the callback hooks that process `:info`'s
`:ref` will fire regardless of whether it comes from org-roam-protocol.
After this commit, you no longer need to require "org-roam-protocol" to
ensure that you capture an `:info`'s `:ref`.
Why is this useful? When I'm reading through my elfeed RSS feed, I want
to capture an article. I could use the org-roam-protocol to do this,
but that seems a bit unnecessary given that I'm already in Emacs.
Closesorg-roam/org-roam#2078
When dynamic binding `org-roam-directory` to the "dailies/"
subdirectory also bind `org-roam-dailies-directory` to "./" to prevent
invalid expansions in user-defined hook functions.
Fixes#2070
This is an extension of PR #2028 [1] by @astery, where the `keys`
argument was added to `org-roam-dailies--capture` `org-roam-dailies-capture-today`.
I extended this argument to also be available in other built-in dailies
functions, as I didn't see any reason why not and it results in my opinion in
more consistent behaviour.
The rationale is the same as in #2028: Allow users to add keybindings (or in my
case hydras) to calls of org-roam-dailies functions with specific template keys,
thus circumventing the selection screen.
So far it seems to work for me. I have only one pet-peeve about
the interface, if the user starts adding keys to all their goto-functions, they
might add
(org-roam-dailies-goto-date nil "<key>")
Then the key-string will be interpreted as the value for `prefer-future` and
since it's non-nil, there won't be an error.
[1] https://github.com/org-roam/org-roam/pull/2028
* (fix)org-roam-node-default-sort: Add choice nil
* (fix)Ensure that annotation functions are compiled
* (fix)org-roam-node-read: Preserve sorting if sort-fn is non-nil
If the nodes are sorted by org-roam we don't want the completion UI to change
the order. In order to disable org-roam sorting set org-roam-node-default-sort
to nil. Then the sorting of the completion UI is used.
* (fix)org-roam-graph--build: Use ephermeral buffer name
Ephemeral buffers are hidden by default in the completion lists,
which is usually desired for background processes.
* (fix)capfs: Do not use completion-table-dynamic
completion-table-dynamic serves a different purpose. it should only be used if
the candidates are dynamically generated based on the input. This is not the
case for org-roam where we the list of nodes is already available right at the
beginning of the completion. This change should improve performance.
This name will better reflect the current purpose of the property. At
the beginning of the v2 it would only trigger for the new nodes (hence
:if-new), but through the development it's no longer the case, though
the behavior various from each type of the target.
As for now, this will be soft deprecated and won't be strictly enforced
at the user.
This is now the default behavior for `org-roam-find-noselect` and
`org-roam-node-visit`, unless FORCE parameter set to non-nil.
Co-authored-by: Duncan Burke <duncankburke@gmail.com>
(condition-case nil
(test)
(t nil))
Is a construct that's only available starting from Emacs 27. Since
Org-roam supports Emacs 26, gotta use what's given.
Note: ignore-errors isn't exactly the same as the construct above from
Emacs 27. Compare to ignore-errors to would trap all possible signals,
while ignore-errors will only trap "error" signals. This, however,
shouldn't affect us in case of this refactoring.
Fixes#1777.
Detangle the codebase and change how dependencies are resolved to
allow the package to better modularize and load itself without
introducing circular dependencies, especially when autoloads involved.