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