EFLS / zetteldeft

A Zettelkasten system! Or rather, some functions on top of the emacs deft package.
https://efls.github.io/zetteldeft
GNU General Public License v3.0
393 stars 42 forks source link

Make it possible to customize the completing-read function #91

Open maw opened 3 years ago

maw commented 3 years ago

Add a customizable variable, zetteldeft-completing-read which defaults to 'completing-read but which can be replaced with compatible functions such as ivy-read.

A caveat: if you say (fset 'zetteldeft-completing-read 'ivy-read) somewhere then this works exactly as I'd hoped. I can't figure out how to make it work via customize. This PR therefore isn't acceptable as-is, but I hope it's a useful start.

ref #90

EFLS commented 3 years ago

Looks like a useful addition, thanks!

I'm not familiar with completing engines, but maybe I should add to the documentation something like this: "If you change completion globally in your setup, e.g. by enabling ivy-mode, you don't need to adjust this variable."

Would that be correct?

EFLS commented 3 years ago

A caveat: if you say (fset 'zetteldeft-completing-read 'ivy-read) somewhere then this works exactly as I'd hoped. I can't figure out how to make it work via customize. This PR therefore isn't acceptable as-is, but I hope it's a useful start.

I haven't tested your PR, but does this mean that currently it doesn't via customize? Because that's definitely something to address. Unfortunately, this isn't really my area of expertise.

maw commented 3 years ago

something like this: "If you change completion globally in your setup, e.g. by enabling ivy-mode, you don't need to adjust this variable."

Yes, I think that's a good way to phrase it.

maw commented 3 years ago

currently it doesn't via customize?

Right. It isn't usable as-is. I spent a little while on this but I wasn't able to figure it out. It's what I was trying to do in here, https://github.com/EFLS/zetteldeft/commit/c6597ff91afaa456bcb0274e4ecb7e7909a6e2c3#diff-2b2d30963fb9d37edc1f2ac4e23abbdab9090ef054ffdd9860fc887cf50a66efR235. From the customize interface I tried setting ivy-read, 'ivy-read, and '#ivy-read as values but I don't think any of them worked.

maw commented 2 years ago

@EFLS I finally tracked down and fixed the problem with customize.

I rebased my branch against current master.

I think this is ready to be tested now.

I wanted to include your proposed doc change but I wasn't sure where it was supposed to go.

EFLS commented 2 years ago

Thanks, I'll take a look at this in a short while!