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
394 stars 42 forks source link

Add function zetteldeft-find-notes-tagged-with #93

Closed maw closed 3 years ago

maw commented 3 years ago

This is similar to zetteldeft-find-file but works by tag.

maw commented 3 years ago

Two points:

EFLS commented 3 years ago

I've moved the defun, made some minor changes and renamed the function, since it is essentially a search function. Not sure yet about the keybinding it should get. As you suggest, I prefer not breaking existing bindings.

I'm not sure how the speed of this function holds up on large Deft directories, as the tag list is generated each new search. But the function seems to work well.

Thanks for introducing me to seq functions -- seems like I should have known about those earlier 😄

EFLS commented 3 years ago

Seems like something went wrong with the individual commits. Anyway, the final result should work.

EFLS commented 3 years ago

Perhaps C-c d / is a suitable keybinding?

Also, I'm wondering how useful the (optional) argument is, since it does the same as zetteldeft--search-global when an argument is provided. Perhaps we can drop it for sake of simplicity?

maw commented 3 years ago

That's a good choice.

My main argument against would be that it might be interesting to save it for a hypothetical "search everything" function. But since that function doesn't yet exist...

maw commented 3 years ago

As to the optional argument: what is the convention in emacs lisp? I thought that anything that comes after package-name-- should be considered private to the package, but I might be mistaken here.

I added the option arg thinking that maybe somebody would find that function and use it in private pieces of code but all in all I think you're right and that the optional argument can go.

EFLS commented 3 years ago

I interpreted the -- as indicating that it is not a function that the user should call interactively, but not sure about the convention.

I added the option arg thinking that maybe somebody would find that function and use it in private pieces of code

Yeah, that's already there, you could use (zetteldeft--search-global "string") for that.

save it for a hypothetical "search everything" function

True, but the "search everything" is simply searching with Deft, or to use C-c d D (zetteldeft-deft-new-search) for convenience.

Is there another binding for tags? Perhaps something from Org-mode? I use evil style bindings so not sure about the defaults.

EFLS commented 3 years ago

I've further simplified the function and renamed it.

Thanks again for your contribution!