Clearer when running on a Mac system.
Which fixes a bug when running on Linux, that doesn't need the Shell PATH set (at least, not for me).
This commit is contained in:
parent
40f30013b6
commit
7a3d95d70b
3 changed files with 24 additions and 12 deletions
|
@ -54,6 +54,17 @@ While that enables the =:straight t= extension to =use-package=, let's just have
|
||||||
See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
|
See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
|
||||||
|
|
||||||
** OS Path and Native Compilation
|
** OS Path and Native Compilation
|
||||||
|
Helper functions to allow code for specific operating systems:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(defun ha-running-on-macos? ()
|
||||||
|
"Return non-nil if running on Mac OS systems."
|
||||||
|
(equal system-type 'darwin))
|
||||||
|
|
||||||
|
(defun ha-running-on-linux? ()
|
||||||
|
"Return non-nil if running on Linux systems."
|
||||||
|
(equal system-type 'gnu/linux))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
With the way I start Emacs, I may not have the PATH I /actually/ use (from the shell) available, so we'll force it (code taken [[https://www.emacswiki.org/emacs/ExecPath][from here]]):
|
With the way I start Emacs, I may not have the PATH I /actually/ use (from the shell) available, so we'll force it (code taken [[https://www.emacswiki.org/emacs/ExecPath][from here]]):
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -71,22 +82,23 @@ With the way I start Emacs, I may not have the PATH I /actually/ use (from the s
|
||||||
(setenv "PATH" path-from-shell)
|
(setenv "PATH" path-from-shell)
|
||||||
(setq exec-path (split-string path-from-shell path-separator))))
|
(setq exec-path (split-string path-from-shell path-separator))))
|
||||||
|
|
||||||
(set-exec-path-from-shell)
|
(when (ha-running-on-macos?)
|
||||||
|
(set-exec-path-from-shell))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Clear up a Mac-specific issue that sometimes arises since I'm switching to [[http://akrl.sdf.org/gccemacs.html][native compilation project]], as the =Emacs.app= that I use doesn't have its =bin= directory, e.g. =Emacs.app/Contents/MacOS/bin=:
|
Clear up a Mac-specific issue that sometimes arises since I'm switching to [[http://akrl.sdf.org/gccemacs.html][native compilation project]], as the =Emacs.app= that I use doesn't have its =bin= directory, e.g. =Emacs.app/Contents/MacOS/bin=:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(when (equal system-type 'darwin)
|
(when (ha-running-on-macos?)
|
||||||
(add-to-list 'exec-path (concat invocation-directory "bin") t))
|
(add-to-list 'exec-path (concat invocation-directory "bin") t))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Getting tired off all the packages that I load spewing a bunch of warnings that I can't do anything about:
|
Getting tired off all the packages that I load spewing a bunch of warnings that I can't do anything about:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(when (and (fboundp 'native-comp-available-p)
|
(when (and (fboundp 'native-comp-available-p)
|
||||||
(native-comp-available-p))
|
(native-comp-available-p))
|
||||||
(setq native-comp-async-report-warnings-errors nil
|
(setq native-comp-async-report-warnings-errors nil
|
||||||
native-comp-deferred-compilation t))
|
native-comp-deferred-compilation t))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Basic Libraries
|
** Basic Libraries
|
||||||
The following packages come with Emacs, but seems like they still need loading:
|
The following packages come with Emacs, but seems like they still need loading:
|
||||||
|
|
|
@ -46,11 +46,11 @@ More settings:
|
||||||
|
|
||||||
And some Mac-specific settings:
|
And some Mac-specific settings:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(when (equal system-type 'darwin)
|
(when (ha-running-on-macos?)
|
||||||
(setq mac-option-modifier 'meta)
|
(setq mac-option-modifier 'meta)
|
||||||
(setq mac-command-modifier 'super)
|
(setq mac-command-modifier 'super)
|
||||||
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
|
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
|
||||||
(add-to-list 'default-frame-alist '(ns-appearance . dark)))
|
(add-to-list 'default-frame-alist '(ns-appearance . dark)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Support Packages
|
* Support Packages
|
||||||
** Piper
|
** Piper
|
||||||
|
|
|
@ -35,7 +35,7 @@ Each operating system as a different way of working with the clipboard, so let's
|
||||||
(defun ha-get-clipboard ()
|
(defun ha-get-clipboard ()
|
||||||
"Returns a list where the first entry is the content type,
|
"Returns a list where the first entry is the content type,
|
||||||
either :html or :text, and the second is the clipboard contents."
|
either :html or :text, and the second is the clipboard contents."
|
||||||
(if (eq system-type 'darwin)
|
(if (ha-running-on-macos?)
|
||||||
(ha-get-mac-clipboard)
|
(ha-get-mac-clipboard)
|
||||||
(ha-get-linux-clipboard)))
|
(ha-get-linux-clipboard)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
Loading…
Reference in a new issue