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?"
This PR enables the long-awaited nested-captures.
1. Adds a hook to org-capture-prepare-finalize-hook, which installs org-roam-capture--finalize into org-capture-after-finalize-hook if the capture is an Org-roam capture. This function contains key functionality for Org-roam to Do The Right Thing after specific interactive functions, such as finding the file, or inserting a link.
2. A patch for org-capture-finalize. Specifically, we make org-capture-plist valid during org-capture-finalize.
3. Many hacks that were originally in place are now replaced with nicer alternatives.
Co-authored-by: Leo Vivier <zaephon@gmail.com>
* (internal): Summarize features
Replace generic package description in features' first line summary.
Co-authored-by: Leo Vivier <leo.vivier+dev@gmail.com>
Beyond just an extraction, this is also a simplification. It removes two
variables: `org-roam-date-filename-format` and
`org-roam-date-title-format`, in favour of directly specifying them in
the `org-roam-dailies-capture-templates`.
`org-roam--file-for-time` is also vastly simplified to use org-capture's
default time expansion utilities, by setting the capture template's
`:default-time` appropriately.