Skip to content

Commit

Permalink
local-projects; right way to byte-compile local-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
semenInRussia committed Jun 18, 2024
1 parent e758961 commit 92210cc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@
;; generate autoloads
(loaddefs-generate (locate-user-emacs-file "lisp/local-projects")
(locate-user-emacs-file "lisp/local-projects/my-autoload.el"))
;; byte-compile every file from the "local-projects" dir (including autoloads
;; file)
(dolist (file (directory-files (locate-user-emacs-file "lisp/local-projects/")
'full
".*\\.el$"))
(byte-compile-file file)))
;; also I byte-compile them after load `my-modules'
)

;;; Local Projects
;; It is my own small "packages" which aren't so big to create real packages
Expand Down Expand Up @@ -167,6 +163,16 @@ Byte-compile every file of local-projects and generate autoloads file"
(auto-mode-case-fold nil))
(require 'my-modules))


;; Handle --local-projects flag. Part 2: byte-compile all
(when (member "--local-projects" command-line-args)
;; byte-compile every file from the "local-projects" dir (including autoloads
;; file)
(dolist (file (directory-files (locate-user-emacs-file "lisp/local-projects/")
'full
".*\\.el$"))
(byte-compile-file file)))

(put 'narrow-to-region 'disabled nil)

(provide 'init)
Expand Down

0 comments on commit 92210cc

Please sign in to comment.