Questions tagged [byte-compilation]
is for the Emacs Lisp compiler in Emacs that compiles lisp code to byte-code for faster execution compared to uncompiled lisp code. Byte-compiled code is read by the byte-code interpreter.
9
questions
13
votes
3answers
403 views
Defun inside let with lexical binding gives byte-compile warning “the function is not known to be defined”
I want to get the effect of a static variable by using defun inside of let with lexical binding to create a closure. However, when byte-compiling the file, I get a warning. Am I doing something wrong, ...
15
votes
1answer
5k views
suppress warning: assignment to free variable (and others)
How can I suppress the "assignment to free variable" warning when byte compiling an emacs lisp file?
I'm actually mostly interested in suppressing it for a specific buffer when using flycheck, but I ...
29
votes
4answers
6k views
Can I avoid outdated byte-compiled elisp files?
Occasionally, when I start Emacs, I get a message like.
Source file `/home/USER/.emacs.d/elpa/....el' newer than byte-compiled file
Also, I sometimes edit a package I'm developing and forget to
...
4
votes
0answers
111 views
Which Lisp objects are byte-compiled?
A compiled program and a source code can be interpreted differently at runtime. The issue is that some Lisp objects should not be modified because of the byte-compilation.
Emacs Lisp manual: 2.7 ...
1
vote
1answer
1k views
How do you recompile an .el source file and make it active in my current session
I have been writing some elisp code, current i have to open the file edit quit and reload emacs seems there must be a better way ?
I know i can recompile the current file but that does not seem to ...
6
votes
1answer
223 views
package.el: How can I avoid byte-compilation
How can I tell package.el to not byte-compile?
It is generally OK to byte-compile installed packages but it makes difficult to test a new Emacs with byte compiler improvements (such as Emacs 26 from ...
3
votes
0answers
325 views
Byte-compiling a file loads macros with `(eval-and-compile)` but not `(eval-when-compile)`
I created a buffer, test1.el:
(eval-when-compile
(defmacro dummy-macro (_) nil)
(dummy-macro s))
Trying to compile this file, I get the following errors:
In toplevel form:
test1.el:3:16:Warning:...
2
votes
1answer
175 views
Make a variable visible to some functions only
Consider the following metacode:
;;; -*- lexical-binding: t -*-
(defvar var1 ...)
(defvar var2 ...)
(defun main ()
"Main entry point" ...)
(defun func1 ...)
(defun func2 ...)
...
(defun funcn ...)...
1
vote
2answers
434 views
Does `load` prefer .elc files over .el files?
Do .elc files take precedence over .el files when using load?
Say I have two files in my load path: foo.el and foo.elc. If I call (load "foo"), will the byte-compiled version (foo.elc) always be ...