2017-06-08 11:47:56 +02:00
|
|
|
;;; core-os.el -*- lexical-binding: t; -*-
|
2017-02-19 07:02:03 -05:00
|
|
|
|
2018-06-08 13:31:45 +02:00
|
|
|
;; clipboard
|
2019-02-28 03:21:40 -05:00
|
|
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
2018-06-08 13:31:45 +02:00
|
|
|
|
2019-03-02 03:54:04 -05:00
|
|
|
;; fewer opts to process for systems that don't need them
|
|
|
|
(unless IS-MAC (setq command-line-ns-option-alist nil))
|
|
|
|
(unless IS-LINUX (setq command-line-x-option-alist nil))
|
|
|
|
|
2019-03-06 17:21:38 -05:00
|
|
|
;; Fix the clipboard in terminal or daemon Emacs (non-GUI)
|
|
|
|
(defun doom|init-clipboard-in-tty-emacs ()
|
|
|
|
(if IS-MAC
|
|
|
|
(if (require 'osx-clipboard nil t) (osx-clipboard-mode))
|
|
|
|
(if (require 'xclip nil t) (xclip-mode))))
|
|
|
|
(add-hook 'tty-setup-hook #'doom|init-clipboard-in-tty-emacs)
|
|
|
|
|
2019-04-06 11:11:53 -04:00
|
|
|
;; Enable mouse in terminal Emacs
|
|
|
|
(add-hook 'tty-setup-hook #'xterm-mouse-mode)
|
|
|
|
|
2018-06-08 13:31:45 +02:00
|
|
|
;; stop copying each visual state move to the clipboard:
|
|
|
|
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
|
2018-09-02 17:18:31 +02:00
|
|
|
;; grokked from: http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
2018-06-08 13:31:45 +02:00
|
|
|
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
|
|
|
|
|
|
|
(cond (IS-MAC
|
2019-01-22 18:03:22 -05:00
|
|
|
(setq mac-command-modifier 'super
|
|
|
|
mac-option-modifier 'meta
|
2018-06-08 13:31:45 +02:00
|
|
|
;; sane trackpad/mouse scroll settings
|
|
|
|
mac-redisplay-dont-reset-vscroll t
|
|
|
|
mac-mouse-wheel-smooth-scroll nil
|
|
|
|
;; Curse Lion and its sudden but inevitable fullscreen mode!
|
|
|
|
;; NOTE Meaningless to railwaycat's emacs-mac build
|
|
|
|
ns-use-native-fullscreen nil
|
2018-12-22 04:01:17 -05:00
|
|
|
;; Visit files opened outside of Emacs in existing frame, rather
|
|
|
|
;; than a new one
|
:boom: Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.
Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)
The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.
+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
running `doom env enable` (`doom env clear` will reverse this and
delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
file. You won't need it if you're confident Emacs will always be
started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
doom/reload-env`. Note: this won't work if the Emacs session you're
running it in doesn't have a correct SHELL set. i.e. don't use this to
create your first env file!
The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.
This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 00:06:10 -04:00
|
|
|
ns-pop-up-frames nil)
|
|
|
|
|
|
|
|
;; Syncs ns frame parameters with theme (and fixes mismatching text color
|
|
|
|
;; in the frame title)
|
|
|
|
(when (and (or (daemonp)
|
|
|
|
(display-graphic-p))
|
|
|
|
(require 'ns-auto-titlebar nil t))
|
|
|
|
(add-hook 'doom-load-theme-hook #'ns-auto-titlebar-mode)))
|
2018-06-08 13:31:45 +02:00
|
|
|
|
|
|
|
(IS-LINUX
|
|
|
|
(setq x-gtk-use-system-tooltips nil ; native tooltips are ugly!
|
2018-12-23 23:54:27 -05:00
|
|
|
x-underline-at-descent-line t)) ; draw underline lower
|
2018-06-08 13:31:45 +02:00
|
|
|
|
|
|
|
(IS-WINDOWS
|
2018-12-31 15:00:05 -05:00
|
|
|
(setq w32-get-true-file-attributes nil) ; fix file io slowdowns
|
2018-12-22 17:00:06 -05:00
|
|
|
(when (display-graphic-p)
|
|
|
|
(setenv "GIT_ASKPASS" "git-gui--askpass"))))
|
2017-02-19 07:02:03 -05:00
|
|
|
|
|
|
|
(provide 'core-os)
|
|
|
|
;;; core-os.el ends here
|