Load more files for byte compilation check. Switched to my-lisp-* prefix.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 02 Jan 2021 18:57:24 +0200
changeset 1675 08f7fd3c4d5b
parent 1674 68a521583d8e
child 1676 2952c3c11261
Load more files for byte compilation check. Switched to my-lisp-* prefix.
.emacs-defs
.emacs-obsolete
Makefile
init.el
--- a/.emacs-defs	Sat Jan 02 18:36:39 2021 +0200
+++ b/.emacs-defs	Sat Jan 02 18:57:24 2021 +0200
@@ -1,8 +1,8 @@
 ;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78; no-byte-compile: t; -*-
 
-(defvar my-usr-lisp-dir
+(defvar my-lisp-usr-home-dir
   (expand-file-name "~/usr/share/emacs/site-lisp")
-  "Here live additional lisp packages.")
+  "There is a place for additional lisp packages installed via 'DIST=~/usr make install'.")
 
 (defvar my-lisp-dir
   (expand-file-name (concat user-emacs-directory "mylisp/"))
@@ -28,16 +28,24 @@
 (setq bookmark-default-file (concat user-emacs-directory "bookmarks"))
 (setq ido-save-directory-list-file (concat user-emacs-directory ".ido.last"))
 
-(defun my-load--load-all ()
+(defun my-lisp--load-pre ()
+  (mapc (lambda (f)
+          (when (file-exists-p f)
+            (load f nil nil t)))
+        (list custom-file my-lisp-autogen my-lisp-auth my-lisp-pre my-lisp-autoload)))
+
+(defun my-lisp--load-usr-home ()
+  "Add hierarchy `my-lisp-usr-home-dir' to `load-path'."
+  (when (file-directory-p my-lisp-usr-home-dir)
+    (add-to-list 'load-path my-lisp-usr-home-dir)
+    (let ((default-directory my-lisp-usr-home-dir))
+      (normal-top-level-add-subdirs-to-load-path))))
+
+(defun my-lisp--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))
-      (normal-top-level-add-subdirs-to-load-path))))
+  (my-lisp--load-usr-home)
+  (my-lisp--load-pre))
 
 (defmacro my--eval-after-load (feature &rest forms)
   (declare (indent defun))
--- a/.emacs-obsolete	Sat Jan 02 18:36:39 2021 +0200
+++ b/.emacs-obsolete	Sat Jan 02 18:57:24 2021 +0200
@@ -57,7 +57,7 @@
      )
    (my-find-subdirs dir)) )
 
-(my-add-subdirs-to-load-path my-usr-lisp-dir)
+(my-add-subdirs-to-load-path my-lisp-usr-home-dir)
 (my-add-subdirs-to-load-path my-lisp-dir)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- a/Makefile	Sat Jan 02 18:36:39 2021 +0200
+++ b/Makefile	Sat Jan 02 18:57:24 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--load-all' --eval='(byte-compile-file ".emacs-my")'
+	$(EMACS) --batch --load "$(curdir)/.emacs-defs" -f 'my-lisp--load-all' --eval='(byte-compile-file ".emacs-my")'
 	rm -f .emacs-my.elc
 
 ################################################################
--- a/init.el	Sat Jan 02 18:36:39 2021 +0200
+++ b/init.el	Sat Jan 02 18:57:24 2021 +0200
@@ -10,7 +10,7 @@
 ;; Load path.
 
 (load "~/.emacs.d/.emacs-defs")
-(my-load.add-my-loadpaths)
+(my-lisp--load-usr-home)
 
 (mapc
  (lambda (fname) (if (>= emacs-major-version 23)