Skip to content

Commit

Permalink
Make Spacemacs byte-compilation optional
Browse files Browse the repository at this point in the history
  • Loading branch information
JAremko committed Jan 31, 2021
1 parent 8898036 commit 1607317
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ prettifying Org files.")
"If non-nil, `kill-buffer' on *scratch* buffer
will bury it instead of killing.")

(defvar dotspacemacs-byte-compile nil
"If non-nil, byte-compile some of Spacemacs files.")

(defun dotspacemacs//prettify-spacemacs-docs ()
"Run `spacemacs/prettify-org-buffer' if `buffer-file-name'
looks like Spacemacs documentation."
Expand Down
5 changes: 3 additions & 2 deletions core/core-spacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ Note: the hooked function is not executed when in dumped mode."
(unless (version< emacs-version "27")
(setq read-process-output-max dotspacemacs-read-process-output-max))))

;; Ensure that `spacemacs--compiled-files' are byte-compiled.
(let ((default-directory spacemacs-start-directory))
(spacemacs//ensure-byte-compilation spacemacs--compiled-files))
(if dotspacemacs-byte-compile
(spacemacs//ensure-byte-compilation spacemacs--compiled-files)
(spacemacs//remove-byte-compiled-files spacemacs--compiled-files)))
;; Check if revision has changed.
(spacemacs//revision-check))

Expand Down
5 changes: 4 additions & 1 deletion core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ It should only modify the values of Spacemacs settings."

;; If nil the home buffer shows the full path of agenda items
;; and todos. If non nil only the file name is shown.
dotspacemacs-home-shorten-agenda-source nil))
dotspacemacs-home-shorten-agenda-source nil

;; If non-nil then byte-compile some of Spacemacs files.
dotspacemacs-byte-compile nil))

(defun dotspacemacs/user-env ()
"Environment variables setup.
Expand Down

0 comments on commit 1607317

Please sign in to comment.