diff options
Diffstat (limited to 'pkgs/applications/editors/emacs/site-start.el')
-rw-r--r-- | pkgs/applications/editors/emacs/site-start.el | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/applications/editors/emacs/site-start.el b/pkgs/applications/editors/emacs/site-start.el index 2f02d6d1a86d..01a6422d731f 100644 --- a/pkgs/applications/editors/emacs/site-start.el +++ b/pkgs/applications/editors/emacs/site-start.el @@ -22,6 +22,36 @@ least specific (the system profile)" (nix--profile-paths))))) (setq load-path (append paths load-path))) +;;; Remove wrapper site-lisp from EMACSLOADPATH so it's not propagated +;;; to any other Emacsen that might be started as subprocesses. +(let ((wrapper-site-lisp (getenv "emacsWithPackages_siteLisp")) + (env-load-path (getenv "EMACSLOADPATH"))) + (when wrapper-site-lisp + (setenv "emacsWithPackages_siteLisp" nil)) + (when (and wrapper-site-lisp env-load-path) + (let* ((env-list (split-string env-load-path ":")) + (new-env-list (delete wrapper-site-lisp env-list))) + (setenv "EMACSLOADPATH" (when new-env-list + (mapconcat 'identity new-env-list ":")))))) + +(let ((wrapper-site-lisp (getenv "emacsWithPackages_siteLispNative")) + (env-load-path (getenv "EMACSNATIVELOADPATH"))) + (when wrapper-site-lisp + (setenv "emacsWithPackages_siteLispNative" nil)) + (when (and wrapper-site-lisp env-load-path) + (let* ((env-list (split-string env-load-path ":")) + (new-env-list (delete wrapper-site-lisp env-list))) + (setenv "EMACSNATIVELOADPATH" (when new-env-list + (mapconcat 'identity new-env-list ":")))))) + +;;; Set up native-comp load path. +(when (featurep 'comp) + ;; Append native-comp subdirectories from `NIX_PROFILES'. + (setq comp-eln-load-path + (append (mapcar (lambda (profile-dir) + (concat profile-dir "/share/emacs/native-lisp/")) + (nix--profile-paths)) + comp-eln-load-path))) ;;; Make `woman' find the man pages (defvar woman-manpath) |