fix: add MacPorts + Homebrew to exec-path for GUI Emacs

This commit is contained in:
2026-02-24 11:39:40 +01:00
parent ae3fde475a
commit e099190805

View File

@@ -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)