branch: elpa/magit
commit b572104164929b592cd980fad5afa9d216321ec1
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 rename `BATCH'
    to `EMACS_BATCH', add `EMACS_ORG' and `EMACS_INTR', and rework use
    of related variables.
---
 Makefile      |  2 +-
 default.mk    | 17 +++++++++--------
 docs/Makefile |  5 ++---
 lisp/Makefile |  6 +++---
 test/Makefile |  6 +++---
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index ae166fb27bb..2ae7c027e28 100644
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@ test-interactive:
 
 emacs-Q: clean-lisp
        @$(MAKE) -C lisp autoloads
-       @$(EMACS) -Q $(LOAD_PATH) --debug-init --eval "(progn\
+       @$(EMACS_INTR) --debug-init --eval "(progn\
        (setq debug-on-error t)\
        (require 'magit-autoloads)\
        (global-set-key \"\\C-xg\" 'magit-status))"
diff --git a/default.mk b/default.mk
index 31c833ec794..0385218f3ef 100644
--- a/default.mk
+++ b/default.mk
@@ -30,9 +30,12 @@ RMDIR    ?= rm -rf
 TAR      ?= tar
 SED      ?= sed
 
-EMACS      ?= emacs
-EMACS_ARGS ?=
-BATCH       = $(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH)
+EMACS       ?= emacs
+EMACS_ARGS  ?=
+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)
+EMACS_INTR  ?= $(EMACS) $(EMACS_Q_ARG) $(EMACS_ARGS) $(LOAD_PATH)
 
 LISP_EXTRA_TARGETS ?= check-declare
 
@@ -116,9 +119,9 @@ REVDESC := $(shell test -e $(TOP).git && git describe 
--tags)
 
 EMACS_VERSION = 28.1
 
-EMACSOLD := $(shell $(BATCH) --eval \
+EMACS_OLD := $(shell $(EMACS_BATCH) --eval \
   "(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))")
-ifeq "$(EMACSOLD)" "true"
+ifeq "$(EMACS_OLD)" "true"
   $(error At least version $(EMACS_VERSION) of Emacs is required)
 endif
 
@@ -223,9 +226,7 @@ endif
 
 endif # ifndef LOAD_PATH
 
-ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH = -L ../../org/lisp
-endif
+ORG_LOAD_PATH ?= -L ../../org/lisp
 
 ## Dependencies ######################################################
 
diff --git a/docs/Makefile b/docs/Makefile
index 351bc2739bc..5b606de3484 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -14,8 +14,7 @@ html-dir: $(HTMLTOPS)
 pdf:      $(PDFFILES)
 epub:     $(EPUBFILES)
 
-ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH) -l ol-man
-ORG_EVAL += --eval "(progn $$ORG_MAN_EXPORT)"
+ORG_EVAL += --load ol-man --eval "(progn $$ORG_MAN_EXPORT)"
 ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
 ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
 ORG_EVAL += --eval "\
@@ -33,7 +32,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 f3ca6f40b97..a83a1a93879 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -68,7 +68,7 @@ versionlib: $(PKG)-version.el
 
 %.elc: %.el
        @printf "Compiling $<\n"
-       @$(BATCH) --eval "(progn\
+       @$(EMACS_BATCH) --eval "(progn\
        (when (file-exists-p \"$@\")\
          (delete-file \"$@\"))\
        (setq with-editor-emacsclient-executable nil)\
@@ -78,7 +78,7 @@ versionlib: $(PKG)-version.el
 
 $(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)\
@@ -95,7 +95,7 @@ $(PKG)-version.el:
 
 check-declare:
        @printf "Checking function declarations\n"
-       @$(BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \
+       @$(EMACS_BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \
        --eval "(check-declare-directory default-directory)"
 
 ## Install ###########################################################
diff --git a/test/Makefile b/test/Makefile
index c7ab8b82ec7..11eec3a8dc3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -3,13 +3,13 @@ include ../default.mk
 
 test: lisp
        @printf "Testing...\n"
-       @$(BATCH) --eval "(progn\
+       @$(EMACS_BATCH) --eval "(progn\
        $$suppress_warnings\
        (load-file \"$(TOP)test/magit-tests.el\")\
        (ert-run-tests-batch-and-exit))"
 
 test-interactive:
-       @$(EMACS) -Q $(LOAD_PATH) --eval "(progn\
+       @$(EMACS_INTR) --eval "(progn\
        (load-file \"$(TOP)test/magit-tests.el\")\
        (ert t))"
 
@@ -17,7 +17,7 @@ lisp: magit-tests.elc
 
 %.elc: %.el
        @printf "Compiling $<\n"
-       @$(BATCH) --eval "(progn\
+       @$(EMACS_BATCH) --eval "(progn\
        (when (file-exists-p \"$@\")\
          (delete-file \"$@\"))\
        (setq with-editor-emacsclient-executable nil)\

Reply via email to