diff --git a/Makefile b/Makefile index 0b3f717c9..677a525e0 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,15 @@ install: autoloads _install bootstrap.elc update: autoloads _update bootstrap.elc autoloads: - @$(EMACS) --script scripts/generate-autoloads.el 2>&1 + @$(EMACS) --batch \ + -l bootstrap.el \ + -l core/core-defuns.el \ + --eval '(narf-reload-autoloads)' 2>&1 compile: autoloads bootstrap.elc - @$(EMACS) --batch -f batch-byte-compile 2>&1 {core,modules,modules/contrib,private}/*.el {core,modules}/defuns/*.el + @$(EMACS) --batch -f batch-byte-compile 2>&1 \ + {core,modules,modules/contrib,private}/*.el \ + {core,modules}/defuns/*.el snippets: @[ -d private/snippets ] || git clone $(REPO_URL)/emacs-snippets private/snippets diff --git a/core/core-defuns.el b/core/core-defuns.el index 6fe40e715..00c8d1dcd 100644 --- a/core/core-defuns.el +++ b/core/core-defuns.el @@ -233,5 +233,17 @@ to abort the minibuffer." (f-directories (expand-file-name "../bootstrap" narf-packages-dir)) narf--load-path))) +(defun narf-reload-autoloads () + "Regenerate autoloads for NARF emacs." + (interactive) + (let ((generated-autoload-file (concat narf-core-dir "/autoloads.el"))) + (when (file-exists-p generated-autoload-file) + (delete-file generated-autoload-file)) + (mapc (lambda (dir) + (update-directory-autoloads (concat dir "/defuns")) + (message "Scanned: %s" dir)) + (list narf-core-dir narf-modules-dir)) + (message "Done!"))) + (provide 'core-defuns) ;;; core-defuns.el ends here diff --git a/scripts/byte-compile.el b/scripts/byte-compile.el deleted file mode 100755 index c4915ab72..000000000 --- a/scripts/byte-compile.el +++ /dev/null @@ -1,15 +0,0 @@ -#!emacs --script - -(load (concat user-emacs-directory "bootstrap.el")) - -(require 'bytecomp) -(byte-recompile-file (expand-file-name "bootstrap.el" narf-emacs-dir) nil 0) -(byte-recompile-file (expand-file-name "init.el" narf-emacs-dir) nil 0) -(byte-recompile-file (expand-file-name "core.el" narf-core-dir) t 0) -(byte-recompile-file (expand-file-name "core-vars.el" narf-core-dir) t 0) -(byte-recompile-file (expand-file-name "core-defuns.el" narf-core-dir) t 0) -(dolist (dir (list narf-core-dir narf-modules-dir narf-core-dir)) - (byte-recompile-directory dir 0 nil)) - -(byte-recompile-file (expand-file-name "my-bindings.el" narf-core-dir) t 0) -(byte-recompile-file (expand-file-name "my-commands.el" narf-core-dir) t 0) diff --git a/scripts/generate-autoloads.el b/scripts/generate-autoloads.el deleted file mode 100755 index 1ae8774a4..000000000 --- a/scripts/generate-autoloads.el +++ /dev/null @@ -1,12 +0,0 @@ -#!emacs --script -(load (concat user-emacs-directory "bootstrap.el")) - -(let ((generated-autoload-file (concat narf-core-dir "/autoloads.el"))) - (when (file-exists-p generated-autoload-file) - (delete-file generated-autoload-file)) - (mapc (lambda (dir) - (update-directory-autoloads (concat dir "/defuns")) - (message "Scanned: %s" dir)) - (list narf-core-dir narf-modules-dir)) - (message "Done!")) -