help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enable-local-variables and emacs --batch


From: Kaushal Modi
Subject: Re: enable-local-variables and emacs --batch
Date: Sat, 3 Nov 2018 07:18:23 -0400

On Sat, Nov 3, 2018 at 6:47 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> If you are going to have a small reproducer (and don't find the
> problem while working on that), then why not step through the relevant
> code in Edebug and see why it doesn't work?

How can I Edebug in emacs --batch (also what to edebug?). I see that
enable-local-variables is `t' (default value), and still the
.dir-locals.el is ineffective in --batch. Otherwise, in regular emacs
sessions, the put safe-local-variable + .dir-locals.el combo works
well.

Here's a minimal example.

1. Create a temp dir
2. Create the below setup-foo.el file in there.
3. touch foo.org
4. emacs --batch --eval '(load-file "setup-foo.el")' foo.org -f echo-foo

===== setup-foo.el =====
(defconst foo nil)
(put 'foo 'safe-local-variable 'stringp)

;; Uncomment below to make the .dir-locals.el set value to apply.
;; (setq enable-local-variables :all)

(defun echo-foo ()
  (message "enable-local-variables = %S" enable-local-variables)
  (if (boundp 'foo)
      (progn
        (message "foo = %S" foo)
        (if foo
            (message "The value of `foo' from .dir-locals.el was applied.")
          (message "The value of `foo' from .dir-locals.el was *not*
applied.")))
    (message "`foo' is not defined")))
=====



reply via email to

[Prev in Thread] Current Thread [Next in Thread]