Closed thoreinstein closed 4 years ago
I can see the differences in both, however I am slightly confused as to their naming versus their intention.
Right that's a bit confusing. neuron-insert-tag
was my previous (poor) attempt at automating the addition of a tag to the current zettel, so I think the function can be completely deleted now, since neuron-add-tag
provides a way better way of doing this, unless someone can think of a use for inserting tags in the zettel body.
From the naming I would expect add to add a new tag and insert to insert and existing tag, though that is not the case.
There are two things to distinguish: adding a new tag to the current zettel (which is what neuron-add-tag
does) and adding a new tag to the zettelkasten.
BOTH only query the existing tag set and present them via an ivy-read call. add attempts to do the correct thing but doesn't add text for a new tag.
What exactly do you mean by "adding text for a new tag"? If you're talking about adding the tag in the zettel YAML metadata block then that's now possible thanks to #33 which was just merged.
More generally, I agree that the code needs to be refactored a little bit, since I have basically been learning elisp along with writing neuron-mode. In particular, I exclusively use (interactive)
to expose the functions to M-x
, without taking advantage of its possible arguments, which could reduce the size of the code I think.
Ah, I see, I must have missed #33 when was perusing earlier, or it was merged right before I looked. That is the exact issue I was looking at fixing myself. Fantastic work on this, and thanks for taking the time.
unless someone can think of a use for inserting tags in the zettel body.
Tangential note: support for tags in zettel body is in neuron's roadmap. https://github.com/srid/neuron/issues/189
unless someone can think of a use for inserting tags in the zettel body.
Tangential note: support for tags in zettel body is in neuron's roadmap. srid/neuron#189
Ah right, I forgot about that, so I suggest we leave neuron-insert-tag
for now and eventually change its functionality to do something like (insert "#%s" (neuron-select-tag))
.
A little spelunking has surfaced an issue or maybe non-issue that I think deserves discussion. There are currently two functions for "adding" tags to a zettel,
neuron-add-tag
andneuron-insert-tag
. I can see the differences in both, however I am slightly confused as to their naming versus their intention.From the naming I would expect
add
to add a new tag andinsert
to insert and existing tag, though that is not the case. BOTH only query the existing tag set and present them via anivy-read
call.add
attempts to do the correct thing but doesn't add text for a new tag.I think a bit of refactoring
neuron--select-tag-from-query
is needed to properly return the text if it is a new tag. I am open to working on that, but wanted to open a discussion about the intended functionality before slamming in a PR.