Fix exec-path/osx-clipboard initializing too early

This commit is contained in:
Henrik Lissner 2018-05-20 00:08:19 +02:00
parent dc4e0f1556
commit 2d2ce3cff9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -30,20 +30,21 @@
;; Don't open files from the workspace in a new frame
ns-pop-up-frames nil)
(cond ((display-graphic-p)
;; A known problem with GUI Emacs on MacOS: it runs in an isolated
;; environment, so envvars will be wrong. That includes the PATH
;; Emacs picks up. `exec-path-from-shell' fixes this.
(when (require 'exec-path-from-shell nil t)
(def-setting! :env (&rest vars)
"Inject VARS from your shell environment into Emacs."
`(exec-path-from-shell-copy-envs (list ,@vars)))
(setq exec-path-from-shell-check-startup-files nil
exec-path-from-shell-arguments (delete "-i" exec-path-from-shell-arguments))
(defvaralias 'exec-path-from-shell-debug 'doom-debug-mode)
(exec-path-from-shell-initialize)))
((require 'osx-clipboard nil t)
(osx-clipboard-mode +1))))
(if (not (display-graphic-p))
(add-hook 'doom-post-init-hook #'osx-clipboard-mode)
;; A known problem with GUI Emacs on MacOS: it runs in an isolated
;; environment, so envvars will be wrong. That includes the PATH Emacs
;; picks up. `exec-path-from-shell' fixes this.
(defun doom|init-exec-path ()
(when (require 'exec-path-from-shell nil t)
(def-setting! :env (&rest vars)
"Inject VARS from your shell environment into Emacs."
`(exec-path-from-shell-copy-envs (list ,@vars)))
(setq exec-path-from-shell-check-startup-files nil
exec-path-from-shell-arguments (delete "-i" exec-path-from-shell-arguments))
(defvaralias 'exec-path-from-shell-debug 'doom-debug-mode)
(exec-path-from-shell-initialize)))
(add-hook 'doom-pre-init-hook #'doom|init-exec-path)))
(IS-LINUX
(setq x-gtk-use-system-tooltips nil ; native tooltips are ugly!