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 06:05:42 -0400

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 via email to

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