Skip to content

Commit

Permalink
docs(readme): update custom eln cache location instructions
Browse files Browse the repository at this point in the history
Recent builds seem to pre-allocate empty `*.eln.tmp` files rather than
empty `*.eln` files. So the issue of empty `*.eln` files preventing
Emacs from starting should no longer be an issue.

I'm leaving #3 open for now, in case anyone is using older git SHAs from
the list of known good commits in #6.
  • Loading branch information
jimeh committed Sep 22, 2020
1 parent 036d2a8 commit d21ccad
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions README.md
Expand Up @@ -160,26 +160,13 @@ By default natively compiled `*.eln` files will be cached in
the first element of the `comp-eln-load-path` variable. The path string must end
with a `/`.

Also it seems somewhat common that some `*.eln` files are left behind with a
zero-byte file size if Emacs is quit while async native compilation is in
progress. Such empty files causes errors on startup, and needs to be deleted.

Below is an example which stores all compiled `*.eln` files in `cache/eln-cache`
within your Emacs configuration directory, and also deletes any `*.eln` files in
said directory which have a file size of zero bytes:
within your Emacs configuration directory:

```elisp
(when (boundp 'comp-eln-load-path)
(let ((eln-cache-dir (expand-file-name "cache/eln-cache/"
user-emacs-directory))
(find-exec (executable-find "find")))
(setcar comp-eln-load-path eln-cache-dir)
;; Quitting emacs while native compilation in progress can leave zero byte
;; sized *.eln files behind. Hence delete such files during startup.
(when find-exec
(call-process find-exec nil nil nil eln-cache-dir
"-name" "*.eln" "-size" "0" "-delete" "-or"
"-name" "*.eln.tmp" "-size" "0" "-delete"))))
(setcar comp-eln-load-path
(expand-file-name "cache/eln-cache/" user-emacs-directory)))
```

### Issues
Expand Down

0 comments on commit d21ccad

Please sign in to comment.