From 5292e2cdc3d289acf69fc43df9c5aec3e95ea62e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Hauspie?= <michael.hauspie@univ-lille.fr>
Date: Thu, 5 Sep 2024 16:34:44 +0200
Subject: [PATCH] Use exec-path-from-shell to change exec-path

---
 configuration.org | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/configuration.org b/configuration.org
index de146e6..3a81a70 100644
--- a/configuration.org
+++ b/configuration.org
@@ -260,6 +260,21 @@ Set the line width for fill command
 #+end_src
 
 
+** Environement
+
+Ensure that Emacs uses the path from my shell (especially when using MacOS)
+
+#+begin_src emacs-lisp
+(use-package exec-path-from-shell
+  :custom
+  (shell-file-name "/bin/zsh")
+  (exec-path-from-shell-variables '("PATH" "MANPATH" "PKG_CONFIG_PATH")
+  :init
+  (if (string-equal system-type "darwin")
+      (exec-path-from-shell-initialize)))
+  )
+#+end_src
+
 * UI and visual tweaks
 
 ** Changes to builtin visuals
@@ -660,11 +675,13 @@ Don't ask before evaluating
   (setq org-confirm-babel-evaluate nil)
 #+end_src
 
-Correctly associate =dot= language with the correct major-mode inside org.
+Correctly associate some language with the correct major-mode inside org.
 
 #+begin_src emacs-lisp
-  (use-package graphviz-dot-mode)
-  (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
+(use-package graphviz-dot-mode)
+(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
+(add-to-list 'org-src-lang-modes '("properties" . conf))
+(add-to-list 'org-src-lang-modes '("unixconfig" . conf))
 #+end_src
 
 Make org mode correctly export quotes
@@ -900,12 +917,6 @@ Install =rust-mode= and set the rust language server to [[https://rust-analyzer.
 For this to work, you need to install =rust-analyzer= and =rustmft=. This can be done using
 =rustup=.
 
-Adds cargo installed binaries to exec path
-
-#+begin_src emacs-lisp
-  (setq exec-path (cons "~/.cargo/bin" exec-path))
-#+end_src
-
 *** Lua
     
 Simply add =lua-mode=
@@ -975,12 +986,6 @@ Use =auctex= for better experience editing latex files
     )
 #+end_src
     
-If using macos, add mactex to =exec-path=
-
-#+begin_src emacs-lisp
-  (when (eq system-type 'darwin)
-    (setq exec-path (cons "/Library/TeX/texbin" exec-path)))
-#+end_src
 
 *** Ningx configuration
 
@@ -1096,12 +1101,6 @@ Using grammalecte with flycheck
 
 * Misc.
 
-Adds =/usr/local/bin= to Emacs =exec-path=
-
-#+begin_src emacs-lisp
-  (setq exec-path (cons "/usr/local/bin" exec-path))
-#+end_src
-
 Starts Emacs server so that we can use =emacsclient= for opening new
 files.
 
-- 
GitLab