2017-02-19 07:02:03 -05:00
|
|
|
;;; core-os.el
|
|
|
|
|
|
|
|
(defconst IS-MAC (eq system-type 'darwin))
|
|
|
|
(defconst IS-LINUX (eq system-type 'gnu/linux))
|
|
|
|
|
|
|
|
;; clipboard
|
|
|
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)
|
|
|
|
;; Use a shared clipboard
|
|
|
|
select-enable-clipboard t
|
|
|
|
select-enable-primary t)
|
|
|
|
|
|
|
|
|
|
|
|
(cond (IS-MAC
|
|
|
|
(setq mac-command-modifier 'meta
|
|
|
|
mac-option-modifier 'alt
|
|
|
|
;; sane trackpad/mouse scroll settings
|
|
|
|
mac-redisplay-dont-reset-vscroll t
|
|
|
|
mac-mouse-wheel-smooth-scroll nil
|
|
|
|
mouse-wheel-scroll-amount '(5 ((shift) . 2)) ; one line at a time
|
|
|
|
mouse-wheel-progressive-speed nil ; don't accelerate scrolling
|
|
|
|
;; Curse Lion and its sudden but inevitable fullscreen mode!
|
|
|
|
;; NOTE Meaningless to railwaycat's emacs-mac build
|
|
|
|
ns-use-native-fullscreen nil
|
|
|
|
;; Don't open files from the workspace in a new frame
|
|
|
|
ns-pop-up-frames nil)
|
|
|
|
|
2017-03-17 22:50:28 -04:00
|
|
|
;; 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, and its result is cached.
|
2017-03-19 23:48:43 -04:00
|
|
|
;; Run `doom/clean-cache' to regenerate exec-path if PATH changes.
|
2017-02-19 07:02:03 -05:00
|
|
|
(cond ((display-graphic-p)
|
|
|
|
;; `exec-path-from-shell' is slow, so bring out the cache
|
|
|
|
(setq exec-path
|
2017-03-19 22:51:29 -04:00
|
|
|
(eval-when-compile
|
|
|
|
(require 'exec-path-from-shell nil t)
|
|
|
|
(nconc exec-path-from-shell-variables '("GOPATH" "GOROOT" "PYTHONPATH"))
|
|
|
|
(exec-path-from-shell-initialize)
|
|
|
|
(persistent-soft-store 'exec-path exec-path "emacs")
|
|
|
|
exec-path)))
|
2017-02-19 07:02:03 -05:00
|
|
|
(t
|
|
|
|
(when (require 'osx-clipboard nil t)
|
|
|
|
(osx-clipboard-mode +1))))
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(after! evil
|
2017-02-19 07:02:03 -05:00
|
|
|
;; On OSX, stop copying each visual state move to the clipboard:
|
|
|
|
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
|
|
|
|
;; Most of this code grokked from:
|
|
|
|
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
|
|
|
(when (or (featurep 'mac) (featurep 'ns))
|
|
|
|
(advice-add 'evil-visual-update-x-selection :override 'ignore))))
|
|
|
|
|
|
|
|
(IS-LINUX
|
|
|
|
;; nothing yet
|
|
|
|
))
|
|
|
|
|
|
|
|
(provide 'core-os)
|
|
|
|
;;; core-os.el ends here
|