Emacs ports: Tweak cache cleanup and native compilation #7

Open
jrm wants to merge 1 commit from jrm/emacs-overhaul into main AGit
Member
  • Only clean up old cache directories that match the current Emacs
    version. Users could switch from editors/emacs to editors/emacs-devel
    or vice versa.
  • As for byte compilation, do not native compile startup configuration
    or subdirs.el.

Sponsored by: The FreeBSD Foundation

- Only clean up old cache directories that match the current Emacs version. Users could switch from editors/emacs to editors/emacs-devel or vice versa. - As for byte compilation, do not native compile startup configuration or subdirs.el. Sponsored by: The FreeBSD Foundation
- Only clean up old cache directories that match the current Emacs
  version.  Users could switch from editors/emacs to editors/emacs-devel
  or vice versa.
- As for byte compilation, do not native compile startup configuration
  or subdirs.el.

Sponsored by:	The FreeBSD Foundation
jrm requested review from ashish 2026-04-16 02:22:33 +00:00
ashish approved these changes 2026-04-17 13:38:34 +00:00
ashish left a comment
Member

You can ignore my comment, as it's subjective, though your changes look fine to me.

You can ignore my comment, as it's subjective, though your changes look fine to me.
@ -141,0 +146,4 @@
This function removes subdirectories whose names start with the current
Emacs version string but do not match `comp-native-version-dir', leaving
cache directories from other installed Emacs versions untouched."
(let ((cache-dir (expand-file-name "eln-cache" user-emacs-directory)))
Member

Instead of hardcoding "eln-cache", how about we use native-comp-eln-load-path:

native-comp-eln-load-path is a variable defined in ‘C source code’.

Its value is
("/home/abbe/.config/emacs/eln-cache/"
  "/usr/local/lib/emacs/31.0.50/native-lisp/")

Not a big deal, just that I didn't like hardcoding stuff where possible.

Instead of hardcoding `"eln-cache"`, how about we use `native-comp-eln-load-path`: ``` native-comp-eln-load-path is a variable defined in ‘C source code’. Its value is ("/home/abbe/.config/emacs/eln-cache/" "/usr/local/lib/emacs/31.0.50/native-lisp/") ``` Not a big deal, just that I didn't like hardcoding stuff where possible.
jrm force-pushed jrm/emacs-overhaul from 95dc0e487f to 580b73eb1e 2026-04-17 17:17:32 +00:00 Compare
Author
Member

I'm still figuring out how git pr works. The last force push was to incorporate your suggestion, which I think makes sense.

If I'm interpreting the docstring correctly, (car native-comp-eln-load-path) should be better than hardcoding eln-cache. However, it's slightly unclear to me since it says "The last directory of this list is assumed to be the one holding the system *.eln files, which are the files produced when building Emacs." I'd feel better if the convention were a little tighter by also saying something like "The first directory in the list is assumed to hold the user cache."

I'm still figuring out how `git pr` works. The last force push was to incorporate your suggestion, which I think makes sense. If I'm interpreting the docstring correctly, `(car native-comp-eln-load-path)` should be better than hardcoding `eln-cache`. However, it's slightly unclear to me since it says "The last directory of this list is assumed to be the one holding the system *.eln files, which are the files produced when building Emacs." I'd feel better if the convention were a little tighter by also saying something like "The first directory in the list is assumed to hold the user cache."
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/7/head:jrm/emacs-overhaul
git switch jrm/emacs-overhaul
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FreeBSD/ports!7
No description provided.