MatthewZMD / .emacs.d

M-EMACS, a full-featured GNU Emacs configuration distribution
GNU General Public License v3.0
674 stars 77 forks source link

[Question] Byte compilation #39

Closed toyboot4e closed 3 years ago

toyboot4e commented 3 years ago

Hi, I'm trying to start using Emacs. Thank you for sharing your configuration!

I downloaded your .emacs.d at HOME, started emacs, and closed. Then I compiled .el files under elisp directory:

$ emacs -batch -f batch-byte-compile elisp/*.el

And started Emacs:

$ emacs -nw

But I got a lot of errors.

I guess I'm doing something wrong, or, is it too hard to use .elc files if we split our init.el to multiple files? (While I was editing my own init.el, I got errors when I used use-package in a file where use-package is not bootstrapped). Thank you :)

MatthewZMD commented 3 years ago

But I got a lot of errors.

Can you paste the error?

toyboot4e commented 3 years ago

*Warnings*:

Warning (initialization): An error occurred while loading ‘/Users/toy/.emacs’:

Symbol's value as variable is void: winner

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
Warnings during byte compilation ``` In toplevel form: elisp/init-ace-window.el:39:1:Error: Wrong type argument: listp, ace-window In toplevel form: elisp/init-avy.el:39:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-buffer.el:39:1:Error: Wrong type argument: listp, ibuffer In toplevel form: elisp/init-buildsystem.el:39:14:Warning: reference to free variable ‘docker’ elisp/init-buildsystem.el:44:14:Warning: reference to free variable ‘dockerfile-mode’ elisp/init-buildsystem.el:48:14:Warning: reference to free variable ‘groovy-mode’ In end of data: elisp/init-buildsystem.el:54:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-cc.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-comment.el:39:1:Error: Wrong type argument: listp, evilnc-comment-or-uncomment-lines In toplevel form: elisp/init-company.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-crux.el:39:1:Error: Wrong type argument: listp, crux-transpose-windows In toplevel form: elisp/init-dashboard.el:39:1:Error: Wrong type argument: listp, dashboard-previous-line In toplevel form: elisp/init-debbugs.el:40:14:Warning: reference to free variable ‘debbugs’ In end of data: elisp/init-debbugs.el:47:1:Warning: the following functions are not known to be defined: use-package, debbugs-gnu In toplevel form: elisp/init-dired.el:39:1:Error: Wrong type argument: listp, dired-jump-other-window In toplevel form: elisp/init-discover-my-major.el:39:1:Error: Wrong type argument: listp, discover-my-major In toplevel form: elisp/init-dumb-jump.el:39:1:Error: Wrong type argument: listp, dumb-jump-go In toplevel form: elisp/init-eaf.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-edit.el:38:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-ein.el:39:14:Warning: reference to free variable ‘ein’ In end of data: elisp/init-ein.el:47:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-epaint.el:39:14:Warning: reference to free variable ‘epaint’ In end of data: elisp/init-epaint.el:54:1:Warning: the following functions are not known to be defined: use-package, epaint In toplevel form: elisp/init-erc.el:39:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-ess.el:39:14:Warning: reference to free variable ‘ess’ elisp/init-ess.el:41:13:Warning: reference to free variable ‘R’ In end of data: elisp/init-ess.el:49:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-eww.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-flycheck.el:39:1:Error: Wrong type argument: listp, flycheck-mode In toplevel form: elisp/init-fonts.el:67:14:Warning: reference to free variable ‘all-the-icons’ In end of data: elisp/init-fonts.el:73:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-format.el:39:1:Error: Wrong type argument: listp, format-all-buffer In toplevel form: elisp/init-func.el:39:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-games.el:39:1:Error: Wrong type argument: listp, tetris-rotate-prev In toplevel form: elisp/init-global-config.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-haskell.el:39:14:Warning: reference to free variable ‘haskell-mode’ In end of data: elisp/init-haskell.el:46:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-header.el:39:1:Error: Wrong type argument: listp, auto-make-header In toplevel form: elisp/init-indent.el:39:14:Warning: reference to free variable ‘highlight-indent-guides’ In end of data: elisp/init-indent.el:75:1:Warning: the following functions are not known to be defined: use-package, highlight-indent-guides-mode, highlight-indent-guides-method, highlight-indent-guides-responsive, highlight-indent-guides-delay, highlight-indent-guides-auto-character-face-perc In toplevel form: elisp/init-input-method.el:39:1:Error: Wrong type argument: listp, pyim-convert-string-at-point In toplevel form: elisp/init-java.el:39:14:Warning: reference to free variable ‘lsp-java’ elisp/init-java.el:40:10:Warning: reference to free variable ‘lsp-mode’ elisp/init-java.el:43:16:Warning: reference to free variable ‘request’ In end of data: elisp/init-java.el:52:1:Warning: the following functions are not known to be defined: use-package, lsp-java-server-install-dir, lsp-java-workspace-dir In toplevel form: elisp/init-latex.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-leetcode.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-lsp.el:39:1:Error: Wrong type argument: listp, lsp-format-buffer In toplevel form: elisp/init-magit.el:39:1:Error: Wrong type argument: listp, magit-diff-visit-file-other-window In toplevel form: elisp/init-mu4e.el:39:1:Error: Wrong type argument: listp, mu4e-alert-enable-mode-line-display In toplevel form: elisp/init-org.el:39:1:Error: Wrong type argument: listp, org-store-link In toplevel form: elisp/init-package.el:42:7:Warning: assignment to free variable ‘package-user-dir’ elisp/init-package.el:43:7:Warning: assignment to free variable ‘package-archives’ elisp/init-package.el:76:13:Error: Cannot open load file: No such file or directory, use-package In toplevel form: elisp/init-parens.el:39:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-pdf.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-popup-kill-ring.el:39:1:Error: Wrong type argument: listp, popup-kill-ring In toplevel form: elisp/init-projectile.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-python.el:39:13:Error: Cannot open load file: No such file or directory, init-flycheck In toplevel form: elisp/init-quickrun.el:39:1:Error: Wrong type argument: listp, quickrun-shell In toplevel form: elisp/init-search.el:39:13:Error: Cannot open load file: No such file or directory, init-global-config In toplevel form: elisp/init-shell.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-theme.el:40:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-tramp.el:39:14:Warning: reference to free variable ‘tramp’ elisp/init-tramp.el:43:17:Warning: reference to free variable ‘tramp-remote-path’ elisp/init-tramp.el:43:17:Warning: assignment to free variable ‘tramp-remote-path’ elisp/init-tramp.el:45:17:Warning: reference to free variable ‘tramp-methods’ elisp/init-tramp.el:45:17:Warning: assignment to free variable ‘tramp-methods’ In end of data: elisp/init-tramp.el:61:1:Warning: the function ‘use-package’ is not known to be defined. In toplevel form: elisp/init-treemacs.el:39:1:Error: Wrong type argument: listp, treemacs-delete-other-windows In toplevel form: elisp/init-ui-config.el:39:13:Error: Cannot open load file: No such file or directory, init-const In toplevel form: elisp/init-undo-tree.el:39:14:Warning: reference to free variable ‘undo-tree’ elisp/init-undo-tree.el:41:13:Warning: reference to free variable ‘undo-tree-mode’ In end of data: elisp/init-undo-tree.el:51:1:Warning: the following functions are not known to be defined: use-package, global-undo-tree-mode, undo-tree-visualizer-diff, undo-tree-visualizer-timestamps In toplevel form: elisp/init-webdev.el:39:1:Warning: ‘(t (:inherit default :foreground "#66CCFF"))’ is a malformed function elisp/init-webdev.el:39:1:Warning: ‘(t (:foreground "#828282"))’ is a malformed function elisp/init-webdev.el:39:1:Warning: ‘"\\.phtml\\'"’ is a malformed function elisp/init-webdev.el:39:14:Warning: reference to free variable ‘web-mode’ elisp/init-webdev.el:49:14:Warning: reference to free variable ‘js2-mode’ elisp/init-webdev.el:55:14:Warning: reference to free variable ‘typescript-mode’ elisp/init-webdev.el:61:1:Error: Wrong type argument: listp, emmet-mode In toplevel form: elisp/init-which-key.el:39:14:Warning: reference to free variable ‘which-key’ In end of data: elisp/init-which-key.el:51:1:Warning: the following functions are not known to be defined: use-package, which-key-separator, which-key-prefix-prefix, which-key-mode In toplevel form: elisp/init-winner.el:39:14:Warning: reference to free variable ‘winner’ In end of data: elisp/init-winner.el:60:1:Warning: the following functions are not known to be defined: use-package, winner-boring-buffers In toplevel form: elisp/init-yasnippet.el:39:1:Error: Wrong type argument: listp, yas-minor-mode In toplevel form: elisp/init-zone.el:39:1:Warning: Unused lexical variable ‘zone-programs’ elisp/init-zone.el:39:14:Warning: reference to free variable ‘zone’ elisp/init-zone.el:50:29:Warning: reference to free variable ‘zone-programs’ In end of data: elisp/init-zone.el:58:1:Warning: the function ‘use-package’ is not known to be defined. ```

Also my Emacs version is:

GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
 of 2020-08-12

Please tell me know if I should do anything else. Thank you.

MatthewZMD commented 3 years ago

is it too hard to use .elc files if we split our init.el to multiple files?

It would be troublesome, so I decide not to support byte compilation. In fact, I don't see much a benefit in using byte compilation, a lot of optimization and lazy-loading have been applied to M-EMACS so the start-up speed is very fast. Thanks you for you suggestion anyways. :)

toyboot4e commented 3 years ago

Thank you for the clarification. You saved my next 12 hours! Yeah the only con pro I see is the output (warnings and errors) of byte compilation.