From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: enable-local-variables and emacs --batch Date: Sat, 03 Nov 2018 12:46:42 +0200 Message-ID: <8336sifnfx.fsf@gnu.org> References: <83a7mqfrll.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541241932 29435 195.159.176.226 (3 Nov 2018 10:45:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Nov 2018 10:45:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 03 11:45:28 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gItQl-0007Wx-Ck for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Nov 2018 11:45:27 +0100 Original-Received: from localhost ([::1]:55074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gItSr-0000rd-HA for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Nov 2018 06:47:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gItSB-0000rY-Dp for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 06:46:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gItS7-0003rt-QT for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 06:46:55 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gItS7-0003rD-E8 for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 06:46:51 -0400 Original-Received: from [176.228.60.248] (port=1837 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gItS6-0004J5-VQ for help-gnu-emacs@gnu.org; Sat, 03 Nov 2018 06:46:51 -0400 In-reply-to: (message from Kaushal Modi on Sat, 3 Nov 2018 06:05:42 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118575 Archived-At: > From: Kaushal Modi > Date: Sat, 3 Nov 2018 06:05:42 -0400 > Cc: Help Gnu Emacs mailing list > > 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. 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?