branch: elpa/with-editor
commit b68e405dd87c12160db20d5fa9527bbdc627a58e
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    make: Add new EMACS_Q_ARG variable
    
    It defaults to "-Q" but users can instead use "-q", which is useful if
    "site-start.el" contains essential settings.  Also add `EMACS_BATCH'
    and `EMACS_ORG', and rework use of related variables.
---
 default.mk    | 19 +++++++++----------
 docs/Makefile |  3 +--
 lisp/Makefile |  7 +++----
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/default.mk b/default.mk
index 3b63e6f27b9..97fe4f1e306 100644
--- a/default.mk
+++ b/default.mk
@@ -10,19 +10,18 @@ ELCS  = $(ELS:.el=.elc)
 DEPS  = compat
 DEPS += vterm
 
+LOAD_PATH     ?= $(addprefix -L ../../,$(DEPS))
+LOAD_PATH     += -L .
+ORG_LOAD_PATH ?= -L ../../org/lisp
+
 VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut 
-c2-)
 REVDESC := $(shell test -e $(TOP).git && git describe --tags)
 
-EMACS      ?= emacs
-EMACS_ARGS ?=
-EMACS_ARGS += --eval '(setq with-editor-emacsclient-executable nil)'
-
-LOAD_PATH  ?= $(addprefix -L ../../,$(DEPS))
-LOAD_PATH  += -L .
-
-ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH  = -L ../../org/lisp
-endif
+EMACS       ?= emacs
+EMACS_ARGS  ?= --eval "(setq with-editor-emacsclient-executable nil)"
+EMACS_Q_ARG ?= -Q
+EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH)
+EMACS_ORG   ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(ORG_LOAD_PATH)
 
 INSTALL_INFO     ?= $(shell command -v ginstall-info || printf install-info)
 MAKEINFO         ?= makeinfo
diff --git a/docs/Makefile b/docs/Makefile
index 6adbfb77a78..458172cc79b 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -11,7 +11,6 @@ html:     $(PKG).html
 html-dir: $(PKG)/index.html
 pdf:      $(PKG).pdf
 
-ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH)
 ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
 ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
 ORG_EVAL += --eval "\
@@ -29,7 +28,7 @@ _    := $(shell test "$(REVDESC)" = "$$(cat .revdesc 2> 
/dev/null)" ||\
 
 %.texi: %.org .orgconfig .revdesc
        @printf "Generating $@\n"
-       @$(EMACS) $(ORG_ARGS) $< $(ORG_EVAL)
+       @$(EMACS_ORG) $< $(ORG_EVAL)
 
 %.info: %.texi
        @printf "Generating $@\n"
diff --git a/lisp/Makefile b/lisp/Makefile
index 77bd1bcd9e8..653e55bc574 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -7,12 +7,11 @@ autoloads: $(PKG)-autoloads.el
 
 %.elc: %.el
        @printf "Compiling $<\n"
-       @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
+       @$(EMACS_BATCH) --funcall batch-byte-compile $<
 
 check-declare:
        @printf " Checking function declarations\n"
-       @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
-       --eval "(check-declare-directory default-directory)"
+       @$(EMACS_BATCH) --eval "(check-declare-directory default-directory)"
 
 CLEAN = $(ELCS) $(PKG)-autoloads.el
 
@@ -22,7 +21,7 @@ clean:
 
 $(PKG)-autoloads.el: $(ELS)
        @printf " Creating $@\n"
-       @$(EMACS) -Q --batch -l autoload --eval "\
+       @$(EMACS_BATCH) --load autoload --eval "\
 (let* ((file (expand-file-name \"$@\"))\
        (generated-autoload-file file)\
        (coding-system-for-write 'utf-8-emacs-unix)\

Reply via email to