Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function named zetteldeft-upsert #95

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

maw
Copy link
Contributor

@maw maw commented Dec 2, 2020

ref #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 and zetteldeft-new-file-and-link. It might be worthwhile to rework them all.

@maw maw marked this pull request as draft December 2, 2020 02:30
- Create zetteldeft--upsert that prompts the user for a choice among several
- Create zetteldeft--list-upsert-choices that creates the list of possible choices.
@EFLS
Copy link
Owner

EFLS commented Mar 31, 2021

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?

We use first, second, and third because they're cleaner than the alternatives
in my opinion.
@maw
Copy link
Contributor Author

maw commented Oct 20, 2021

I finally had a look at this. It turns out that :preselect and :initial-input are ivy-readisms.

3486781 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.

@maw
Copy link
Contributor Author

maw commented Jul 25, 2022

@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 #95 (comment).

I think it'll be easier to clean this up over once #91 lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants