mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
use-package macOS stuff
That was the last of the packages!
This commit is contained in:
parent
a3a859cba1
commit
0441d32ae8
81
init.org
81
init.org
@ -200,49 +200,64 @@
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
The configuration assumes that the packages listed below are installed. To
|
|
||||||
ensure we install missing packages if they are missing.
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
|
|
||||||
(let* ((package--builtins nil)
|
|
||||||
(packages
|
|
||||||
'()))
|
|
||||||
(when (memq window-system '(mac ns))
|
|
||||||
(push 'exec-path-from-shell packages)
|
|
||||||
(push 'reveal-in-osx-finder packages))
|
|
||||||
(let ((packages (seq-remove 'package-installed-p packages)))
|
|
||||||
(when packages
|
|
||||||
;; Install uninstalled packages
|
|
||||||
(package-refresh-contents)
|
|
||||||
(mapc 'package-install packages))))
|
|
||||||
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Mac OS X
|
* Mac OS X
|
||||||
|
|
||||||
I run this configuration mostly on Mac OS X, so we need a couple of settings
|
I run this configuration mostly on macOS, so we need a couple of settings to
|
||||||
to make things work smoothly. In the package section =exec-path-from-shell=
|
make things work smoothly. I use the =Command=-key as the =Meta=-key, Freeing
|
||||||
is included (only if you're running OS X), this is to include
|
up the =Option=-key, which I need for typing Norwegian characters on a US
|
||||||
environment-variables from the shell. It makes using Emacs along with
|
keyboard. In addition, it is more comfortable.
|
||||||
external processes a lot simpler. I also prefer using the =Command=-key as
|
|
||||||
the =Meta=-key.
|
I try to minimize the use of frames. The native compilation gives a lot of
|
||||||
|
warnings, but they seem safe to ignore.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(when (memq window-system '(mac ns))
|
(when (memq window-system '(mac ns))
|
||||||
(setq ns-pop-up-frames nil
|
(setq mac-option-modifier nil
|
||||||
mac-option-modifier nil
|
|
||||||
mac-command-modifier 'meta
|
mac-command-modifier 'meta
|
||||||
native-comp-async-report-warnings-errors nil)
|
ns-pop-up-frames nil
|
||||||
(exec-path-from-shell-initialize)
|
native-comp-async-report-warnings-errors nil))
|
||||||
(when (fboundp 'mac-auto-operator-composition-mode)
|
|
||||||
(mac-auto-operator-composition-mode 1))
|
|
||||||
(require 'ls-lisp)
|
|
||||||
(setq ls-lisp-use-insert-directory-program nil))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
The package [[https://github.com/purcell/exec-path-from-shell][exec-path-from-shell]] synchronizes environment variables from the
|
||||||
|
shell to Emacs. This makes it a lot easier to deal with external programs on
|
||||||
|
macOS.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:if (memq window-system '(mac ns))
|
||||||
|
:config
|
||||||
|
(exec-path-from-shell-initialize))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
I had some problems with Dired, and this seems to have solved it. I /think/
|
||||||
|
the solutions was from [[https://stackoverflow.com/questions/4076360/error-in-dired-sorting-on-os-x][here]], and my problems were related, but not the same.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(use-package ls-lisp
|
||||||
|
:ensure nil
|
||||||
|
:if (memq window-system '(mac ns))
|
||||||
|
:config
|
||||||
|
(setq ls-lisp-use-insert-directory-program nil))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
It is useful to be able to occasionally open the file associated with a
|
||||||
|
buffer in macOS Finder.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(use-package reveal-in-osx-finder
|
||||||
|
:if (memq window-system '(mac ns)))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
|
||||||
* Sane defaults
|
* Sane defaults
|
||||||
|
|
||||||
These are what /I/ consider to be saner defaults.
|
These are what /I/ consider to be saner defaults.
|
||||||
|
Loading…
Reference in New Issue
Block a user