Hi, and thanks for making denote! I have a question about "silos".
I understand how to set up a silo by using a directory local variable
file in its root. However, I'm trying to figure out how to set a
"silo-specific" set of keywords for each silo of notes: for example,
suppose I want the keywords "food" and "vegetarian" but only for the
silo with my recipes in it?
Dot-notation confuses me a bit. 8/
I have tried this, but it doesn't seem to work:
> ((nil . ((denote-directory . default-directory)> (denote-konwn-keywords . '("food", "vegetarian"))> )))
Thanks!
--
Viktor Haag
> From: Viktor Haag <viktor.haag@gmail.com>> Date: Mon, 31 Oct 2022 11:51:44 -0400>> Hi, and thanks for making denote!
Hello Viktor and you are welcome!
> I have a question about "silos".>> I understand how to set up a silo by using a directory local variable> file in its root. However, I'm trying to figure out how to set a> "silo-specific" set of keywords for each silo of notes: for example,> suppose I want the keywords "food" and "vegetarian" but only for the> silo with my recipes in it?>> Dot-notation confuses me a bit. 8/>> I have tried this, but it doesn't seem to work:>>> ((nil . ((denote-directory . default-directory)>> (denote-konwn-keywords . '("food", "vegetarian"))>> )))>> Thanks!
Try this:
((nil . ((denote-directory . default-directory)
(denote-known-keywords . '("food" "vegetarian")))))
Please let me know if this works for you.
I have not marked the 'denote-known-keywords' as a "safe local variable"
so you will get an innocuous warning about it. Just mark it as safe. I
will update the code to make this one officially safe. Will do it with
other user options as well.
All the best,
Protesilaos (or simply "Prot")
--
Protesilaos Stavrou
https://protesilaos.com
On Mon, 31 Oct 2022 at 12:18, Protesilaos Stavrou <info@protesilaos.com> wrote:
> > I have tried this, but it doesn't seem to work:> >> >> ((nil . ((denote-directory . default-directory)> >> (denote-konwn-keywords . '("food", "vegetarian"))> >> )))> >> > Thanks!>> Try this:>> ((nil . ((denote-directory . default-directory)> (denote-known-keywords . '("food" "vegetarian")))))>> Please let me know if this works for you.
Yikes -- I apologize for not checking my spelling first... 8(
> I have not marked the 'denote-known-keywords' as a "safe local variable"> so you will get an innocuous warning about it. Just mark it as safe. I> will update the code to make this one officially safe. Will do it with> other user options as well.
Yes, I wondered whether that was something I was missing, or how that
worked. Thanks very much!
--
Viktor
On Mon, 31 Oct 2022 at 12:18, Protesilaos Stavrou <info@protesilaos.com> wrote:
> Try this:>> ((nil . ((denote-directory . default-directory)> (denote-known-keywords . '("food" "vegetarian")))))>> Please let me know if this works for you.
Yes, that works; however, it also does something interesting. When I
tell Emacs to remember that variable, it adds an entry for the safe
variable in my custom.el file:
> '(safe-local-variable-values> '((denote-known-keywords quote> ("food"> (\, "vegetarian")))> )
Then, when I make a new test topic in my silo directory, it lists
"quote" as an eligible file keyword! I'm really unsure what to do
about that, but there's no harm in just having it show up in my
keyword list; I can just ignore it.
--
Viktor
On Mon, 31 Oct 2022 at 14:49, Viktor Haag <viktor.haag@gmail.com> wrote:
> Yes, that works; however, it also does something interesting. When I> tell Emacs to remember that variable, it adds an entry for the safe> variable in my custom.el file:>> > '(safe-local-variable-values> > '((denote-known-keywords quote> > ("food"> > (\, "vegetarian")))> > )
Correctly removing the comma from the list as you did provide in your
original example, produces this in my custom.el:
> '(safe-local-variable-values> '((denote-known-keywords quote> ("food" "vegetarian"))> ))
But it still keeps "quote" as one of the keywords available. Interesting!
--
V
> From: Viktor Haag <viktor.haag@gmail.com>> Date: Mon, 31 Oct 2022 15:04:54 -0400> [... 15 lines elided]>> '(safe-local-variable-values>> '((denote-known-keywords quote>> ("food" "vegetarian"))>> ))>> But it still keeps "quote" as one of the keywords available. Interesting!
This means that we need to remove the quote from the list. It should
now be written like this:
((nil . ((denote-directory . default-directory)
(denote-known-keywords . ("food" "drink")))))
--
Protesilaos Stavrou
https://protesilaos.com
On Mon, 31 Oct 2022 at 22:58, Protesilaos Stavrou <info@protesilaos.com> wrote:
> This means that we need to remove the quote from the list. It should> now be written like this:>> ((nil . ((denote-directory . default-directory)> (denote-known-keywords . ("food" "drink")))))
Thanks! This turns into this in my custom.el:
> '(safe-local-variable-values> '((denote-known-keywords "food" "drink")))
which I assume is what we want -- it seems to work fine within the
context of denote not creating.
Thanks very much for the assistance!
--
Viktor
> From: Viktor Haag <viktor.haag@gmail.com>> Date: Tue, 1 Nov 2022 12:45:46 -0400>> On Mon, 31 Oct 2022 at 22:58, Protesilaos Stavrou <info@protesilaos.com> wrote:>> This means that we need to remove the quote from the list. It should>> now be written like this:>>>> ((nil . ((denote-directory . default-directory)>> (denote-known-keywords . ("food" "drink")))))>> Thanks! This turns into this in my custom.el:>> '(safe-local-variable-values>> '((denote-known-keywords "food" "drink")))>> which I assume is what we want -- it seems to work fine within the> context of denote not creating.
Yes, this looks correct.
> Thanks very much for the assistance!
You are welcome!
* * *
Note that I updated the manual earlier. It includes an example like the
one we covered here, plus a couple more cases:
<https://protesilaos.com/emacs/denote#h:15719799-a5ff-4e9a-9f10-4ca03ef8f6c5>.
I also wrote this:
Finally, it is possible to have a .dir-locals.el for subdirectories
of any denote-directory. Perhaps to specify a different set of
known keywords, while not making the subdirectory a silo in its own
right. We shall not expand on such an example, as we trust the user
to experiment with the best setup for their workflow.
I did not want to elaborate, as that probably results in a very specific
setup. I think merely mentioning the possibility is good enough at this
stage. Better wait to see if there is a need for more documentation on
this.
--
Protesilaos Stavrou
https://protesilaos.com