`=' 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.
* 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>
Without specifying `t`, it is only pushing the PROPERTIES drawer up to
the file level, missing any other "planning information, clocking lines and
any kind of drawer." We want to promote all of this to the file level.
org-roam-node-at-point returned the wrong value if point-min is a
level-1 heading node. We make sure that everytime we go up one
heading, the outline-level changes (reduces by 1) to prevent this error.
* Fix undefined incf.
Calling org-roam-extract-subtree failes with "Symbol’s function definition is void: incf"
org-roam.el includes cl-lib. org-roam--h1-count uses a bare incf call, which is undefined. Fix this by using cl-incf.
* Save buffer before promoting it.
After fixing incf in 8ec2e59e67, org-roam-extract-subtree still fails.
The error is now: org-roam-db--file-hash: Opening input file: No such file or directory,...
The buffer with the newly created content is still unsaved at this time, so save it before calling (org-roam-promote-entire-buffer)
Caveat is we now save the buffer two times, before and after promoting it.
Previously we only updated the database on file save, but we need to
update the file's atime on file access, so we hook into `find-file-hook`
to do so. We only update the file atime if the file exists in the file table.
Special care is taken not to move the point if the original point is no
longer the same (i.e. the user moves the cursor after calling the
capture, but before finalizing it). Fixes#2108.
Previously, the file-path of the new node in `org-roam-extract-subtree'
was incorrect in many circumstances. Expanding w.r.t. the initial
prompt directory (ie, `org-roam-directory') fixes that
Revert to a simplified `org-roam-node-display-template`, because on
non-vertical completion frameworks it looks and behaves strangely. To
restore the original default behaviour, set
`org-roam-node-display-template` in your Emacs configuration as such:
(setq org-roam-node-display-template
(concat "${title:*} "
(propertize "${tags:10}" 'face 'org-tag)))
Emacs commit 3f096eb3405b2fce7c35366eb2dcf025dda55783 introduced
`string-glyph-compose` and `string-glyph-decompose`, autoloading these instead
of the (still existing) `ucs-normalize-NFC-region` and
`ucs-normalize-NFD-region`.
There are three cases:
- Emacs where these transitions have not happened yet (e.g. 27.1):
`ucs-normalize-NFC-region` and `ucs-normalize-NFD-region` are still
autoloaded, aliasing the new names to them will keep them usable
and the code still works.
- Emacs where the new functions are defined (not yet released): the new names
are autoloaded, no aliases are installed and the code still works.
- A (hypothetical?) Emacs where `string-glyph-compose` and
`string-glyph-decompose` are renamed. If `ucs-normalize-NFC-region` and
`ucs-normalize-NFD-region` do not get their autoloaded status back, the
aliasing will happen but the functions not autoloaded and the code will
break in the same way as in #1981
* (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)))