Instead check if the (autoloaded) function `org-cite-insert' is bound.
This prevents a lot of unnecessary filesystem I/O when generating the
org roam database.
* (fix)org-roam-unlinked-references-section: Use truncate-string-ellipsis
The variable can be set to a unicode ellipsis.
* (fix)org-roam-node-read--format-entry: Fix highlighting for truncation
Fix#1801. The truncated part of the string is made invisible. Matching
on the whole string remains possible.
* (fix)org-roam-format-template: Preserve string properties like format
If the variable value carries properties itself, these properties
take precedence. Display templates can be properties with this change.
(setq org-roam-node-display-template
(concat (propertize "${title:*}" 'face 'font-lock-keyword-face)
" "
(propertize "${tags:10}" 'face 'font-lock-constant-face)))
* (fix) Use read-from-minibuffer instead of completing-read where appropriate
* (feat) Add separate node and ref completion histories
Using separate histories has the advantage that the history only contains node
names and no other strings from other unrelated minibuffer completions.
* Allow capfs to run after org-roam-complete-everywhere. This is
necessary since org-roam-complete-everywhere gets triggered on every
word, even if no match has been found.
* Simpler hook setup. org-roam-complete-at-point is unnecessary, better
add the capfs directly.
* (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 commit simplifies the code in org-roam-node-read--format-entry,
saving the entire processing of display properties when no
field-length is specified and thus no truncation needs to happen.
Since in this case, we don't truncate, the bug fixed in #1759 won't
reappear.
This has the beneficial side-effect that existing display properties
in the field-value, e.g., display properties that replace text by
images/icon, are not overridden by us when no field-length is
specified. Note that images anyway don't need truncation of the text
they replace.
This commit also fixes a wrong word in the comment.
The current implementation doesn't cover the scenario where
org-roam-directory doesn't have a trailing slash. Because of this,
users are enforced to make org-roam-directory end with a trailing
slash.
Currently, roam allows file template *nominally*, but, if one tries to set
up, it causes trouble.
`goto` functions, like `org-roam-dailies-goto-*`, tries to expand file
template with `org-roam-format-template`, which assumes template is
string. Hence, complains about it.
This commit suppress such malfunctions by do nothing for non-string template.
The current implementation uses org-element-map to iterate through all
links in the current buffer. This function doesn't consider links
within properties drawer. This implementation does consider such
links.
This function ignored the `force' optional argument because it always
quoted it, resulting in a non-nil value every time.
This makes the suggested code snippet in
https://github.com/org-roam/org-roam/issues/597#issuecomment-907743125
work as expected (not resetting point to the beginning of the "Index"
buffer on every invocation).
Support caching the new Org 9.5 citations.
Because citations now has first-class support, and are treated
differently from links, they are now cached in their own table.
Org-ref citations, instead of being stored in the links table, are now
stored in the citations table instead.
To use a citation as a ROAM_REF, use the `@citeKey` syntax
48a5d01726 was wrong, and the closure wasn't the cause. The source of
the issue stems from a missing compile-time dependency on subr-x.
Emacs 28 doesn't seem to require it for the needed functions anymore,
while older Emacsen still do. What even worse, the byte compiler doesn't
seem to complain about such thing on older Emacsen and the error message
produced at the run-time isn't helpful to identify the cause.
Fixes#1814.
It looks like Emacs' byte compiler is very naive and cannot properly
sometimes compile closures, which causes error like in #1814, at least
on Emacsen <28. One of the possible solutions is to write the code using
less abstractions in between, so the byte compiler would do the right
thing when arranging instructions.
Possibly addresses #1814.
Previously when ROAM_REFS is non-empty, but the refs are invalid, this
will cause an empty SQL expression and crash the db caching. This fixes
that scenario.
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.
Previously, if org-roam-capture- would be triggered for an existing node
it would just move the point to the beginning of the node, ignoring the
target from the :if-new part of the template.
This patch will now also run the :if-new part of the template for
existing nodes, just like it does right now in case of daily
templates (which happened to be never recognized as existing nodes
during the capture process).
unwind-protect will still propagate the initial error, which isn't
desirable and can confuse both, the end-user and us when resolving
issues.
To keep the backtrace clean (in case of other errors), just
automatically detatch the advice once it ran in the error handling
branch. If the user change the file at the runtime, org-id shouldn't
fail with the error as long as it was handled at least once, and it
still will be handled by us during the next session. At the end of the
day it's a very niche edge case, which most of the users shouldn't ever
see.
Fixes#1805.
If org-roam-utils.el is byte-compiled when org-macs is not loaded (`org-with-point-at` macro missing), error can appear about missing `org-with-point-at`.
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>
Output the commit hash when it's available (e.g. when using straight to
install packages). This comes in handy during debugging during error
reporting.
This allows the empty field-width to be used, but using an empty
field-width will result in misalignment. This is useful for people who
use completion frameworks like Ido.
Previously when the preview and buffer would be opened, it would just
display the buffer at the last visited position without performing any
repositiong.
To enforce the correct behavior, the point should be always moved after
the buffer is visited, and not before.