jimeh / build-emacs-for-macos

Somewhat hacky script to automate building of Emac.app on macOS.
484 stars 50 forks source link

README eln-cache management suggestions #112

Open shipmints opened 1 month ago

shipmints commented 1 month ago

Thank you for maintaining these builds. I've switched from https://emacsformacosx.com/ which are not native and have a couple of issues which your builds address (not patch related).

For Emacs 29.1+ users, I think below is better for eln cache management vs. hacking native-comp-eln-load-path, and especially for people who share their .emacs.d tree across hardware platforms.

(when (native-comp-available-p)
  (require 'comp)
  (startup-redirect-eln-cache ; relative path name goes in user-emacs-directory
   (concat (file-name-as-directory "eln-cache")
           (car (split-string system-configuration "-")))) ; adds "x86_64" "aarch64"
  (native-compile-prune-cache)) ; keeps the cache clean after Emacs upgrades

I use no-littering and add user-emacs-directory/var, in sympathy, to avoid "polluting" .emacs.d:

  (startup-redirect-eln-cache
   (concat
    (file-name-as-directory "var")
    (file-name-as-directory "eln-cache")
    (car (split-string system-configuration "-"))))