Closed puzan closed 3 years ago
This looks very promising! I hope to find some time to check it out soon
Seems to work nicely. I've updated some notes on documentation.
The current function inserts the tag at point, but it would be nice to automatically add the tags at the correct spot. Not sure how to achieve this easily. Perhaps by finding a string that indicates which line tags belong to?
I've updated the function to find the correct spot, which is the line starting with zetteldeft-tag-line-prefix
. You'll have to customize it to make it work, but can you try it out and let me know whether it works?
@EFLS It works for me. Looks good! I have tested with the following config for markdown files:
(setq zetteldeft-tag-line-prefix "^Tags: ")
Great, thanks for the feedback. I should think further about a default setup (as there currently is no tag line configured), and then merge the PR
I think it will be good to have two options:
It seems it is better to use two separate functions. What do you think?
Excellent suggestion. Best to split into two functions indeed, which gives the most user freedom and doesn’t require configuring the tag line prefix string for people to insert tags interactively.
@EFLS Are you going to update the code yourself? Or do you expect this from me?
I think I can find time tomorrow to split functions.
I'm still thinking about the best approach. Perhaps we can have a single function, but depending on whether zetteldeft-tag-line-prefix
is set or nil, the tag is inserted at the line or at point. So actually very close to the current function (but without the message). This would make it easier for the user: only one function and one keybinding. Does this make sense? Or would you prefer two separate functions?
I changed my mind yet again and now include two functions:
zetteldeft-tag-insert
inserts a tag at the tag line, unless the tag line is not found or the zetteldeft-tag-line-prefix
is set to nilzetteldeft-tag-insert-at-point
also available, that does as it saysThis should provide the most user convenience, I think.
@EFLS Looks good! Could we merge this solution? Do you expect something from me for this PR? I'm ready to help.
Done!
Add zetteldeft-insert-tag function which helps to find existed tag and insert it in the current point.