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 06:05:42 -0400	[thread overview]
Message-ID: <CAFyQvY33jBF6tvBwV3rxVAK-xGw1Sh-GwapBORxd9RxDv6mONA@mail.gmail.com> (raw)
In-Reply-To: <83a7mqfrll.fsf@gnu.org>

Hello Eli,

On Sat, Nov 3, 2018, 5:17 AM Eli Zaretskii <eliz@gnu.org wrote:

>
> You didn't show any actual command you are using for the batch-mode
> invocation, but my first guess would be that the file is visited
> before the --eval command-line option is executed.
>

I made sure that --eval happened before the file load. I even have a
specific note for that:

# Note: The Org file from $(ORG_FILE) is loaded *after* the --eval
# section gets evaluated i.e. --eval '(progn ..)' $(ORG_FILE) If the
# order is reversed i.e. i.e.$(ORG_FILE) --eval '(progn ..)', the act
# of loading the $(ORG_FILE) file first will load the older Org
# version that ships with Emacs and then run the stuff in --eval that
# loads the new Org version.. and thus we'll end up with mixed Org in
# the load-path.
emacs-batch:
@echo ""
@echo "$(ORG_FILE) ::"
@$(EMACS) --batch --eval "(progn\
(setenv \"OX_HUGO_ELPA\" \"$(OX_HUGO_ELPA)\")\
(setenv \"TEST_ENABLED\" \"$(TEST_ENABLED)\")\
(load-file (expand-file-name \"setup-ox-hugo.el\" \"$(OX_HUGO_TEST_DIR)\"))\
)" $(ORG_FILE) \
-f $(FUNC) \
--kill

The setup-ox-hugo.el contains the code to load the ox-hugo package and in
there I even manually load-file the package autoloads file that contains
the elisp forms that `put' `safe-local-variable' on the defcustoms.

The $(ORG_FILE) comes after the --eval in that emacs --batch command.

The $(FUNC) is just an Org export command.

I'll work on getting a minimal reproducible example when I get to a
computer.

>


  reply	other threads:[~2018-11-03 10:05 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 [this message]
2018-11-03 10:46     ` Eli Zaretskii
2018-11-03 11:18       ` Kaushal Modi
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=CAFyQvY33jBF6tvBwV3rxVAK-xGw1Sh-GwapBORxd9RxDv6mONA@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.