Commit graph

29 commits

Author SHA1 Message Date
Protesilaos Stavrou 5c13cf4c1c
Rename internal id front matter rx for consistency 2022-06-26 06:57:35 +03:00
Protesilaos Stavrou d6543cfa0d Add support for org-id
For a discussion, read issue 8 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/8>.
2022-06-23 10:42:13 -04:00
Protesilaos Stavrou 25cc5a79e6
Require built-in xref to parse cross-references
Otherwise we run into errors such as the one reported by Frank Ehmsen on
the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C579a31b8-d1dd-5c02-aa2f-498526c5982e@eh-is.de%3E>.
2022-06-23 10:16:15 +03:00
Protesilaos Stavrou b25235e93e
Add header links to the mailing list 2022-06-23 08:35:41 +03:00
Protesilaos Stavrou 091990d030
Use 'declare-function' instead of 'autoload' 2022-06-22 18:46:21 +03:00
Protesilaos Stavrou 1b5634ba1c
Clarify that xrefs are returned as an alist 2022-06-22 18:46:07 +03:00
Protesilaos Stavrou 66bb8083ec
Tweak indentation of function 2022-06-22 18:44:37 +03:00
Protesilaos Stavrou 92f9cb8cb9
Use xref instead of relying on find+grep
With xref we delegate to a built-in facility instead of passing a
hard-coded list of arguments to 'process-lines'.

The old method is prone to errors, such as not working on builds of
Emacs for macOS, as reported by Colin McLear in issue 18 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/18>.

Users of Emacs 28 or higher can configure 'xref-search-program' to
change from the default 'grep' to 'ripgrep', 'ugrep', or a user-defined
alternative.

THIS CHANGE IS PROVISIONAL and subject to further edits.
2022-06-22 13:57:23 +03:00
Protesilaos Stavrou 8394280f95
Refine regexp for front-matter date extraction
This should solve the bug reported by Sven Seebeck where dates in the
org-timestamp style would lose their closing bracket after a rename
operation altered their front matter.

See issue 19 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/19>.
2022-06-22 07:27:30 +03:00
Protesilaos Stavrou edbd2f7f1b
Use our pred instead of generic in file filtering 2022-06-18 12:53:05 +03:00
Protesilaos Stavrou 341cd28b5a
Fix bug with 'default-directory' reset
This would override the default-directory when using something like 'M-x
denote-link-add-links' from a file whose directory had a local value for
'denote-directory'.

Thanks to Sven Seebeck for reporting the bug in issue 16 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/16>.
2022-06-18 10:10:02 +03:00
Protesilaos Stavrou 941258d8d4
Remove faulty MUSTMATCH from file prompt 2022-06-18 08:24:22 +03:00
Protesilaos Stavrou 5686e86cfc
Only show valid notes in file prompt
Builds on commit dcf8739.
2022-06-18 08:18:59 +03:00
Protesilaos Stavrou aab484d617
Sort grep output with string-lessp
This is a follow-up to commit 429763c.  Basically, we want the file
names to come in a predictable order, otherwise it can be hard to get a
sense of their time range.
2022-06-18 07:17:48 +03:00
Protesilaos Stavrou 85b5290e8b
Fix bug where Unicode chars are not encoded
This was revealed when Frank Ehmsen tried to create a link with German
umlauts.  Reported on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3Ccf3d35f8-acfa-5056-cfa4-63a57ea15ef9@eh-is.de%3E>.
2022-06-16 17:23:56 +03:00
Protesilaos Stavrou c8f3e707c2
Revise one-line descriptions, where needed 2022-06-16 12:44:03 +03:00
Protesilaos Stavrou 74962d17f2
Improve denote-retrieve error handling
Basically, we do not want to do anything in files that have no front
matter.
2022-06-16 09:58:39 +03:00
Protesilaos Stavrou 2327b5beb6
Add helper FNs to return title and date values 2022-06-16 08:50:55 +03:00
Protesilaos Stavrou b25704e041
Make denote-retrieve--value pass optional group
See commit 3654f90.
2022-06-16 08:50:22 +03:00
Protesilaos Stavrou 3654f902e6
Accept optional group in denote-retrieve--search 2022-06-16 08:49:58 +03:00
Protesilaos Stavrou f2cfcd26ea
Refine denote-retrieve regular expressions 2022-06-16 08:47:34 +03:00
Protesilaos Stavrou f8b2d44508
Depend on Emacs 27.2, not 27.1 2022-06-16 05:49:29 +03:00
Protesilaos Stavrou e37e429844
Add possible to-do for using xref 2022-06-15 16:54:28 +03:00
Protesilaos Stavrou ebd14ebbd6
Change placement of maxdepth argument for find 2022-06-15 05:27:18 +03:00
Protesilaos Stavrou 7fab21926d
Process 'find' output in denote-retrieve 2022-06-15 05:16:42 +03:00
Protesilaos Stavrou 02507c6f0d
Rename private variable 2022-06-14 17:29:10 +03:00
Protesilaos Stavrou 7674c6f854
Retrieve identifier from filename alone 2022-06-14 17:27:01 +03:00
Protesilaos Stavrou 25fa79e8d9
Refine denote-retrieve internals 2022-06-12 16:43:24 +03:00
Protesilaos Stavrou 0e83bee5b7
Add denote-retrieve for internal purposes
Basicallly we shall use it to extract data from a file.
2022-06-12 08:49:54 +03:00