all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: enable-local-variables and emacs --batch
Date: Sat, 3 Nov 2018 07:18:23 -0400	[thread overview]
Message-ID: <CAFyQvY0K_Ci73gteQgjUeziFiMxphsHNCFEjVUAF4a6x9vCjXA@mail.gmail.com> (raw)
In-Reply-To: <8336sifnfx.fsf@gnu.org>

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	other threads:[~2018-11-03 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 14:54 enable-local-variables and emacs --batch Kaushal Modi
2018-11-03  9:16 ` Eli Zaretskii
2018-11-03 10:05   ` Kaushal Modi
2018-11-03 10:46     ` Eli Zaretskii
2018-11-03 11:18       ` Kaushal Modi [this message]
2018-11-03 11:21         ` Kaushal Modi
2018-11-03 12:49           ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY0K_Ci73gteQgjUeziFiMxphsHNCFEjVUAF4a6x9vCjXA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.