From e099190805fbdd3df77e37e651b6c34a81bb17bc Mon Sep 17 00:00:00 2001 From: Daneel Date: Tue, 24 Feb 2026 11:39:40 +0100 Subject: [PATCH] fix: add MacPorts + Homebrew to exec-path for GUI Emacs --- config.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config.el b/config.el index 1fa1d3c..877fe64 100644 --- a/config.el +++ b/config.el @@ -64,9 +64,18 @@ select-enable-primary t inhibit-splash-screen t) -;; PATH: add MacTeX binaries -(setenv "PATH" (concat "/Library/TeX/texbin:" (getenv "PATH"))) -(add-to-list 'exec-path "/Library/TeX/texbin") +;; PATH: ensure GUI Emacs sees the same paths as the terminal. +;; macOS GUI apps do not inherit the shell PATH, so we add critical +;; directories explicitly. Order matches the shell's $PATH priority. +(let ((extra-paths '("/opt/local/bin" ; MacPorts + "/opt/local/sbin" ; MacPorts sbin + "/opt/homebrew/bin" ; Homebrew (mu, msmtp, …) + "/opt/homebrew/sbin" ; Homebrew sbin + "/usr/local/bin" ; local wrappers (emacs script, …) + "/Library/TeX/texbin"))) ; MacTeX + (dolist (p (reverse extra-paths)) + (setenv "PATH" (concat p ":" (getenv "PATH"))) + (add-to-list 'exec-path p))) ;; macOS clipboard integration via pbcopy/pbpaste (works in terminal Emacs too) (defun my/pbcopy (text &optional _push)