emacs: keep the default first writable native-comp-eln-load-path dir

Fixes https://github.com/NixOS/nixpkgs/issues/247804.

authored by

Lin Jian and committed by
Anderson Torres
7d4ea94d 2d324ed8

+8 -2
+8 -2
pkgs/applications/editors/emacs/site-start.el
··· 42 42 ;;; Set up native-comp load path. 43 43 (when (featurep 'native-compile) 44 44 ;; Append native-comp subdirectories from `NIX_PROFILES'. 45 + ;; Emacs writes asynchronous native-compilation files to the first writable directory[1]. 46 + ;; At this time, (car native-comp-eln-load-path) is a writable one in `user-emacs-directory'[2]. 47 + ;; So we keep that one unchanged. 48 + ;; [1]: info "(elisp) Native-Compilation Variables" 49 + ;; [2]: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el?id=3685387e609753293c4518be75e77c659c3b2d8d#n601 45 50 (setq native-comp-eln-load-path 46 - (append (mapcar (lambda (profile-dir) 51 + (append (list (car native-comp-eln-load-path)) 52 + (mapcar (lambda (profile-dir) 47 53 (concat profile-dir "/share/emacs/native-lisp/")) 48 54 (nix--profile-paths)) 49 - native-comp-eln-load-path))) 55 + (cdr native-comp-eln-load-path)))) 50 56 51 57 ;;; Make `woman' find the man pages 52 58 (defvar woman-manpath)