Simplified Makefile byte compillation recipe by moving some logic from CLI to elisp.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 02 Jan 2021 01:28:36 +0200
changeset 1672 e2d0fc84c6f5
parent 1671 a6d55703383c
child 1673 bd16419905c0
Simplified Makefile byte compillation recipe by moving some logic from CLI to elisp.
.emacs-defs
Makefile
--- a/.emacs-defs	Sat Jan 02 01:26:59 2021 +0200
+++ b/.emacs-defs	Sat Jan 02 01:28:36 2021 +0200
@@ -28,7 +28,12 @@
 (setq bookmark-default-file (concat user-emacs-directory "bookmarks"))
 (setq ido-save-directory-list-file (concat user-emacs-directory ".ido.last"))
 
-(defun my-load.add-my-loadpaths ()
+(defun my-load--load-all ()
+  "Load everything to help during byte compilation to spot errors
+better. Not for regular use but for the Makefile."
+  (if (file-exists-p my-lisp-pre)
+      (load my-lisp-pre)
+    (load ".emacs-pre"))
   (when (file-directory-p my-usr-lisp-dir)
     (add-to-list 'load-path my-usr-lisp-dir)
     (let ((default-directory my-usr-lisp-dir))
--- a/Makefile	Sat Jan 02 01:26:59 2021 +0200
+++ b/Makefile	Sat Jan 02 01:28:36 2021 +0200
@@ -180,7 +180,7 @@
 
 .PHONY: check-byte-compile-dot-emacs
 check-byte-compile-dot-emacs:
-	$(EMACS) --batch --load "$(curdir)/.emacs-defs" -f 'my-load.add-my-loadpaths' --load "$(emacsdir)/.emacs-pre" --eval='(byte-compile-file ".emacs-my")'
+	$(EMACS) --batch --load "$(curdir)/.emacs-defs" -f 'my-load--load-all' --eval='(byte-compile-file ".emacs-my")'
 	rm -f .emacs-my.elc
 
 ################################################################