We need to split the ref into its type/file before querying the db for a
match. Throw a warning when `org-roam--capture-new-file` tries to
recreate an existing file.
updates org-roam-with-file to accept nil FILE arg, to operate on current
buffer. Fixes org-roam-link--get-headlines to kill buffer if not
obtaining markers.
If the user creates a new daily via `org-roam-dailies-find-today`, they
will get a new buffer that hasn't yet been saved to disk. If they then try
to navigate to the previous daily via
`org-roam-dailies-find-previous-note`, they will get the error:
`Wrong type argument: number-or-marker-p, nil`
This is because the value of the local variable `position` is set only if
the current buffer exists as a file in the dailies directory. It doesn't
until the user explicitly saves it.
That's not a big problem, but the solution is not obvious from the error
message. I added a check that will provide the user with a more informative
error message, so they know how to fix the issue:
"Can't find current note file - have you saved it yet?"
* (feat): Support file-property drawers
Add support for file-property drawers in property extraction. This means
the following is now supported:
:PROPERTIES:
:ROAM_ALIAS: alias
:ROAM_TAGS: tag1 tag2
:END:
Follow on to #1345.
The discussion in the Slack thread further clarified what was exactly
confusing for a beginner reader of this Getting Started. When a user is using
the built-in completion (no ivy, no ido), then `org-roam-find-file` does not
immediately show any files -- instead, the user has to press TAB. This is not
explicitly mentioned.
Previously we had set `org-capture-link-is-already-stored` to `t` in
org-roam captures, because org-roam-protocol stores links. This
prevented regular captures from utilizing the %a element in the
templates.
Instead, only set `org-capture-link-is-already-stored` in the
org-roam-protocol capture command.
Fixes#1341.
When `org-roam-directory` doesn't end with trailing slash and
`org-roam-index-file` contains relative filename, absolute path
to org-roam index file returned by `org-roam--get-index-path` is
malformed and invalid.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
The rename file advice is passed relative file names: e.g. "foo.org" ->
"bar.org". This was not accounted for, and paths in the Org-roam
database are supposed to be absolute paths. This caused the storing of
relative paths in the Org-roam database, which were then never purged.
Fixes#1304
Finding an Org-roam file that does not exist yet triggers the find-file
hook, resulting in an Org-roam buffer update, attempting to show the
file. However, if the file does not yet exist, attempts to show the file
will not work, since the database does not contain the relevant
information yet.
This bug has always been present, but was only recently made visible by
the code cleanups in #1284.
Now, we ensure that the file has been processed by the database before
attempting to re-display the buffer.
Fixes#1297
Every file has a title when saved into the database, so this function is
redundant in most cases (e.g. in org-roam-buffer, where backlinks are
fetched from the database).