hasu / notdeft

NotDeft note manager for Emacs
https://tero.hasu.is/notdeft/
170 stars 14 forks source link

[Feature request] Include "#word" tag format #9

Open anthrolisp opened 5 years ago

anthrolisp commented 5 years ago

Is there an easy way to include "#keyword" format in notdeft buffer tag searches? Preferably, where "#keyword" can be located anywhere in the text. Many thanks in advance!

hasu commented 5 years ago

For that functionality it should be sufficient to change the C++ program to parse files differently, so that it can include such "#keywords" into the search index.

If you truly want the parsing to be indiscriminate, so that keywords can be located anywhere, then it should not be too hard to do, since no context information is then required to find the "#keywords".

However, that doesn't sound quite ideal, as for example in the case of Org files one might then find keywords within comments, URLs, and code blocks, which is perhaps not what you'd want. To avoid such spurious matches, I've chosen to only support #+KEYWORDS in file headers, at least for the time being.

publicimageltd commented 4 years ago

First of all, great package! I like it, it is powerful and effective!

I would also prefer this "open" style of defining keywords. I do not think there's any conflict with comments and the like, since there is usually either a space after the '#', or a plus:

#+TITLE: This is an org option, it will be ignored
# This is a regular comment and it will be ignored
#a-keyword    
hasu commented 4 years ago

I understand that keyword-oriented note management has its adherents, but I suspect there are also those (like me) who like not having to tag their notes with topic keywords at all, no matter how convenient the syntax.

So to avoid needless syntactic fragility I don't think I would go quite as far as making that "open" style of defining keywords part of the default syntax. However, I don't see a problem in for example having a compile-time option in "notdeft-xapian.cc" for configuring the indexer to also parse #keywords.

publicimageltd commented 4 years ago

Thanks for the answer. Adding a compile time option would be good solution. Not knowing how to add a keyword, I would be unable to add a PR on that, though.