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.

Useful link:

106 questions
35
votes
5 answers

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 recompile it. When I try to load the new file, it…
Malabarba
  • 23,148
  • 6
  • 79
  • 164
12
votes
2 answers

byte compiled version of elisp files

I have both .el and the byte compiled version (.elc) of an elisp file. Accidentally I delete the .el file. Can I retrieve the .el file from its .elc version? Is an .elc file without its .el file functional?
Name
  • 7,849
  • 4
  • 41
  • 87
4
votes
0 answers

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 Equality Predicates The Emacs Lisp byte compiler may…
user19761
4
votes
1 answer

Which functions cannot be redefined after byte compilation?

Given a function that calls not: (defun my-not (x) (not x)) M-x disassemble gives: byte code for my-not: doc: ... args: (arg1) 0 dup 1 not 2 return I was surprised that this didn't do: constant…
Wilfred Hughes
  • 6,920
  • 2
  • 31
  • 60
3
votes
2 answers

Can one inhibit eval-when-compile?

There is an eval-when-compile macro but, AFAICT, no eval-when-not-compiling or load-time-only, that would be very convenient for me now. Do you know any generic workaround? Why do I need this: I have a package with (eval-when-compile (load…
phs
  • 1,227
  • 7
  • 13
3
votes
2 answers

Where and when should emacs lisp files be byte-compiled?

Do you have examples of packages that benefit substantially from byte-compilation? I would prefer to avoid byte-compiling files when it is not necessary, in particular when installing hundreds of packages, since it takes significantly longer to…
aculich
  • 336
  • 1
  • 8
2
votes
1 answer

Function might not be defined at runtim

To use directory-files-recursively in Emacs 24.x, I'm adding the following to a file cider-compat.el: (eval-and-compile (unless (fboundp 'directory-files-recursively) (defun directory-files-recursively (dir regexp &optional…
Tianxiang Xiong
  • 3,878
  • 18
  • 28
1
vote
1 answer

Can you detect if a byte-compiled elisp file was not compiled by the current emacs?

Is there a way to tell if the current *.elc files were not compiled with the current Emacs? I am trying to detect an error where emacs is updated, but old .elc files are left in the user elpa directory and they are not compatible.
John Kitchin
  • 11,891
  • 1
  • 20
  • 42
1
vote
1 answer

Can we force emacs to not load byte compiled files?

I would like Emacs to not use byte-compiled files because the stack-trace is really messy. So for my own elisp files, I can add ;; -*-no-byte-compile: t; -*- to disallow byte-compilation. But how can I enforce this for the packages like evil…
Nishant
  • 239
  • 1
  • 9
1
vote
1 answer

w32-short-file-name: multi-OS user-configuration -- silence byte-compiler

I have a multi-OS user-configuration. On OSX, when I byte-compile, the function w32-short-file-name is not defined (which is okay). What is the proper way to silence the byte-compiler for this message which will not affect the ability to use this…
lawlist
  • 19,106
  • 5
  • 38
  • 120
1
vote
2 answers

byte compile warning: `unintern` called with 1 argument, but requires 2

Q:  How to fix elmo-unintern to use 2 arguments instead of 1, or silence the byte-compiler on this issue. Here is the macro definition: (defmacro elmo-unintern (string) "Delete the symbol named NAME, if any, from OBARRAY. The value is t if a symbol…
lawlist
  • 19,106
  • 5
  • 38
  • 120
0
votes
1 answer

Byte compile setup

What byte compile setup can I use when writing my init files? Have been doing M-x byte-compile-file directly. Would like to do a function that calls byte-compile-file on the current buffer.
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Source file ‘c:/Users/.../AppData/Local/emacs-26.1-x86_64/share/emacs/26.1/lisp/progmodes/python.el’ newer than byte-compiled file

this message shows up on Emacs startup. what does it mean and how to get rid of it? Source file ‘c:/Users/jcao/AppData/Local/emacs-26.1-x86_64/share/emacs/26.1/lisp/progmodes/python.el’ newer than byte-compiled file btw, my setting folder is…
YiC
  • 115
  • 1
  • 8
0
votes
1 answer

eval-when-compile statements not running in files required by compiled file

I've got one file including (eval-when-compile (require 'cl)) Some other files require this file, and also need to have cl required when they are byte-compiled. This is not happening - this first file does not appear to know it is getting byte…
jcarpenter2
  • 227
  • 1
  • 6
0
votes
1 answer

Ignore byte-compiled files without source file

I recently refactored my Emacs config, part of which involved deleting some old files which had been byte-compiled. My new configuration (ab)uses the load-dir package to load all my customisation files in a specific directory. The issue arises when…
ivanm
  • 107
  • 5
1
2