0

When I start Emacs it asks me if I want to allow "unsafe" variables which I agree and press '!' to save them for the future. Despite that, it still keeps asking me about it on every launch.

Here is the code that I like to run a per-directory basis:

     (defun jarfar/org-tasks-refile-targets-local ()
       "Set local 'org-refile-targets for specific org files with tasks."
       (setq-local org-refile-targets
         `(
            (,my/org-backlog-file-path :maxlevel . 1)
            (,my/org-inbox-file-path :maxlevel . 1)
            (,my/org-tasks-file-path :maxlevel . 1)
            (,my/org-taxes-file-path :maxlevel . 1)
            )))

     (dir-locals-set-class-variables 'jarfar/org-agenda-dir-class
       '((nil . (
          (eval . (progn (jarfar/org-tasks-refile-targets-local)))
          ))))

     (dir-locals-set-directory-class org-agenda-directory 'jarfar/org-agenda-dir-class)

I tried many ways of suppressing this confirmation window but it keeps popping up.

Any idea?

1 Answer 1

0

I managed to solve this with:

(setq enable-local-eval t)
(setq safe-local-eval-forms (list))
(add-to-list 'safe-local-eval-forms '(progn (jarfar/org-tasks-refile-targets-local)))

This post was helpful https://emacs.stackexchange.com/a/58332/18445.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.