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

Adding new tags #35

Closed
thoreinstein opened this issue Jun 9, 2020 · 4 comments
Closed

Adding new tags #35

thoreinstein opened this issue Jun 9, 2020 · 4 comments

Comments

@thoreinstein
Copy link

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 and neuron-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 and insert to insert and existing tag, though that is not the case. 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.

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.

@felko
Copy link
Owner

felko commented Jun 9, 2020

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.

@thoreinstein
Copy link
Author

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.

@srid
Copy link
Contributor

srid commented Jun 9, 2020

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

@felko
Copy link
Owner

felko commented Jun 9, 2020

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

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

No branches or pull requests

3 participants