protesilaos / denote

Simple notes for Emacs with an efficient file-naming scheme

Home Page:https://protesilaos.com/emacs/denote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

silos not working (freebsd)

zostj opened this issue · comments

denote-silo-extra-create-note
denote-silo-open-or-create
denote-select-silo-then-command

My denote-directory is ~/Documents/culinary/
My denote-silo-extras-directories is ~/Documents/recipes/

Problem:

  1. 'denote-silo-extra-create-note' and 'denote-silo-open-or-create' require C-u prefix and then M-x in order for the prompt to actually display and ask me to choose from my list of silos. 'denote-select-silo-then-command' works.

  2. for me, these 3 commands don't seem to work if i'm triggering them while in any other directories. the denote-known-keywords for the silos are not being shown - instead, i'm still being prompted with the list of denote-known-keywords from my default denote-directory ~/Documents/culinary/ the local variables are not being picked up.

  3. the commands only work for me if I manually go inside my silo folder and then trigger those commands, then they will show the correct keywords.

  4. whenever i try to physically enter the silo directory i get this:

The local variables list in /home/rue/Documents/recipes/
or .dir-locals.el contains values that may not be safe (*).

Do you want to apply it?  You can type
y  -- to apply the local variables list.
n  -- to ignore the local variables list.
!  -- to apply the local variables list, and permanently mark these
      values (*) as safe (in the future, they will be set automatically.)
i  -- to ignore the local variables list, and permanently mark these
      values (*) as ignored

  * denote-directory : "~/Documents/recipes/"
  * denote-known-keywords : ("french" "italian" "american" chinese" "japanese" "korean" "thai")
  * denote-infer-keywords : nil

once i clicked 'y' or '!', it takes me to the dired silo directory
with a line at the bottom indicating:
'ls does not support --dired; see 'dired-use-ls-dired' for more details'

here is my .dir-local.el

;;; Directory Local Variables            -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((nil . ((denote-directory . "~/Documents/recipes/")
         (denote-known-keywords . ("french" "italian" "american" 
                                   "chinese" "japanese" "korean" "thai"))
         (denote-infer-keywords . nil))))

all in all, the directory local variables somehow are not working for me :(

'ls does not support --dired; see 'dired-use-ls-dired' for more details' <-- i looked at dired-use-ls-dired, ls-lisp-emulation, 'cuz i noticed that freebsd's ls does not have the same -D option as linux (on linux -D --dired generate output designed for Emacs' dired mode) does my problem have anything to do with this? i tried changing those options around to using the built in ls-lisp, and changing ls-lisp-emulation from UNIX to GNU, etc. (don't really know what i'm doing though lol).

otherwise denote works fine on freebsd, it's just the silos that are giving me troubles and the isolated local variables are not being implemented :(

could use some guidance

From: zostj @.***> Date: Tue, 5 Mar 2024 07:06:38 -0800 [... 49 lines elided] 'ls does not support --dired; see 'dired-use-ls-dired' for more details' <-- i looked at dired-use-ls-dired, ls-lisp-emulation, 'cuz i noticed that freebsd's ls does not have the same -D option as linux (on linux -D --dired generate output designed for Emacs' dired mode) does my problem have anything to do with this? i tried changing those options around to using the built in ls-lisp, and changing ls-lisp-emulation from UNIX to GNU, etc. (don't really know what i'm doing though lol).
This must be causing issues. Can you never get dired to work? Mayebe fixing this will also address the issue with the dir-local variables.

-- Protesilaos Stavrou https://protesilaos.com

i reinstalled my emacs and started a new config
looked up 'dired-use-ls-dired' and added
(setq ls-lisp-use-insert-directory-program nil) (require 'ls-lisp)
Having done this, my emacs no longer gives me the line about 'ls does not support --dired' and i can also dired into my silos without the message prompting me to perform the action in regards to local variables.

However, when i try to use any of the three denote-silos-extras commands i'm still unable to get the localized denote-known-keywords from the silos. it's still just showing the global keywords for my main notes folder... same as before :( only work if i am actually inside the silo.

I cannot reproduce this, but maybe things will work if we make those variables safe (which I think is fine in general).

Can you please evaluate these two defcustom? Do it by placing the cursor inside each one and typing M-x eval-defun:

;;;###autoload (put 'denote-known-keywords 'safe-local-variable (lambda (val) (or (listp val) (null val))))
(defcustom denote-known-keywords
  '("emacs" "philosophy" "politics" "economics")
  "List of strings with predefined keywords for `denote'.
Also see user options: `denote-infer-keywords',
`denote-sort-keywords', `denote-file-name-slug-functions'."
  :group 'denote
  :safe (lambda (val) (or (listp val) (null val)))
  :package-version '(denote . "0.1.0")
  :type '(repeat string))

;;;###autoload (put 'denote-known-keywords 'safe-local-variable (lambda (val) (or val (null val))))
(defcustom denote-infer-keywords t
  "Whether to infer keywords from existing notes' file names.

When non-nil, search the file names of existing notes in the
variable `denote-directory' for their keyword field and extract
the entries as \"inferred keywords\".  These are combined with
`denote-known-keywords' and are presented as completion
candidates while using `denote' and related commands
interactively.

If nil, refrain from inferring keywords.  The aforementioned
completion prompt only shows the `denote-known-keywords'.  Use
this if you want to enforce a restricted vocabulary.

The user option `denote-excluded-keywords-regexp' can be used to
exclude keywords that match a regular expression.

Inferred keywords are specific to the value of the variable
`denote-directory'.  If a silo with a local value is used, as
explained in that variable's doc string, the inferred keywords
are specific to the given silo.

For advanced Lisp usage, the function `denote-keywords' returns
the appropriate list of strings."
  :group 'denote
  :safe (lambda (val) (or val (null val)))
  :package-version '(denote . "0.1.0")
  :type 'boolean)

Just to note that I made the changes.