Open maw opened 3 years ago
I've just tried the zetteldeft-upsert
function to better understand what it does, but get an error:
(wrong-type-argument stringp :preselect)
Any idea what I'm missing?
I finally had a look at this. It turns out that :preselect
and :initial-input
are ivy-read
isms.
348678197b48eeff5e7a013a3863d28875abd955 fixes it, sort of. But the end result is far worse.
I think it could be improved by filtering the result of deft-find-all-files-no-prefix
before passing them to the completing reader as options, although losing :preselect
would still be unfortunate.
I'm sorry for taking so long to respond.
@EFLS I've been using a personal branch for months which includes my completing read enhancements and this upsert functionality.
I can't remember for sure but I think what I did was create the upsert code in my personal branch which already included my completing read changes. Then I cherry-picked it back into a branch dedicated to upsert -- but I made mistakes, which you bumped into in https://github.com/EFLS/zetteldeft/pull/95#issuecomment-811356813.
I think it'll be easier to clean this up over once https://github.com/EFLS/zetteldeft/pull/91 lands.
ref https://github.com/EFLS/zetteldeft/issues/94
@EFLS I started using this today. I bound it to
C-c d u
.I wouldn't accept this as-is (if nothing else, the name doesn't fit with the general aesthetic you've laid out for zetteldeft commands) but I hope it can be the basis for something that is inclusionworthy.
For completeness' sake, I think there should be equivalent functions for
zetteldeft-new-file-and-backlink
andzetteldeft-new-file-and-link
. It might be worthwhile to rework them all.