Add set-env! autodef; make :env obsolete
This commit is contained in:
parent
3b0fad871f
commit
98d2f1de3f
8 changed files with 20 additions and 8 deletions
9
core/autoload/os.el
Normal file
9
core/autoload/os.el
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
;;; core/autoload/os.el -*- lexical-binding: t; no-byte-compile: t -*-
|
||||||
|
|
||||||
|
;; FIXME obsolete :env
|
||||||
|
;;;###autoload
|
||||||
|
(def-setting! :env (&rest vars)
|
||||||
|
"TODO"
|
||||||
|
:obsolete set-env!
|
||||||
|
(when (featurep 'exec-path-from-shell)
|
||||||
|
`(exec-path-from-shell-copy-envs ,@vars)))
|
|
@ -12,6 +12,9 @@
|
||||||
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
||||||
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
||||||
|
|
||||||
|
(defmacro set-env! (&rest _vars)
|
||||||
|
"Inject VARS from your shell environment into Emacs.")
|
||||||
|
|
||||||
(cond (IS-MAC
|
(cond (IS-MAC
|
||||||
(setq mac-command-modifier 'meta
|
(setq mac-command-modifier 'meta
|
||||||
mac-option-modifier 'alt
|
mac-option-modifier 'alt
|
||||||
|
@ -32,9 +35,9 @@
|
||||||
;; environment, so envvars will be wrong. That includes the PATH Emacs
|
;; environment, so envvars will be wrong. That includes the PATH Emacs
|
||||||
;; picks up. `exec-path-from-shell' fixes this.
|
;; picks up. `exec-path-from-shell' fixes this.
|
||||||
(when (require 'exec-path-from-shell nil t)
|
(when (require 'exec-path-from-shell nil t)
|
||||||
(def-setting! :env (&rest vars)
|
(defun set-env! (&rest vars)
|
||||||
"Inject VARS from your shell environment into Emacs."
|
"Inject VARS from your shell environment into Emacs."
|
||||||
`(exec-path-from-shell-copy-envs (list ,@vars)))
|
(exec-path-from-shell-copy-envs vars))
|
||||||
(setq exec-path-from-shell-check-startup-files nil
|
(setq exec-path-from-shell-check-startup-files nil
|
||||||
exec-path-from-shell-arguments (delete "-i" exec-path-from-shell-arguments))
|
exec-path-from-shell-arguments (delete "-i" exec-path-from-shell-arguments))
|
||||||
(defvaralias 'exec-path-from-shell-debug 'doom-debug-mode)
|
(defvaralias 'exec-path-from-shell-debug 'doom-debug-mode)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
;; `term' (built-in)
|
;; `term' (built-in)
|
||||||
(after! term
|
(after! term
|
||||||
(set! :env "SHELL")
|
(set-env! "SHELL")
|
||||||
|
|
||||||
;; Consider term buffers real
|
;; Consider term buffers real
|
||||||
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real))
|
(add-hook 'term-mode-hook #'doom|mark-buffer-as-real))
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(after! go-mode
|
(after! go-mode
|
||||||
(set! :env "GOPATH" "GOROOT")
|
(set-env! "GOPATH" "GOROOT")
|
||||||
(set! :repl 'go-mode #'gorepl-run)
|
(set! :repl 'go-mode #'gorepl-run)
|
||||||
(set! :lookup 'go-mode
|
(set! :lookup 'go-mode
|
||||||
:definition #'go-guru-definition
|
:definition #'go-guru-definition
|
||||||
|
|
|
@ -24,7 +24,7 @@ is loaded.")
|
||||||
:config
|
:config
|
||||||
(add-hook! 'python-mode-hook #'(flycheck-mode highlight-numbers-mode))
|
(add-hook! 'python-mode-hook #'(flycheck-mode highlight-numbers-mode))
|
||||||
|
|
||||||
(set! :env "PYTHONPATH" "PYENV_ROOT")
|
(set-env! "PYTHONPATH" "PYENV_ROOT")
|
||||||
(set! :electric 'python-mode :chars '(?:))
|
(set! :electric 'python-mode :chars '(?:))
|
||||||
(set! :repl 'python-mode #'+python/repl)
|
(set! :repl 'python-mode #'+python/repl)
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'ruby-mode 'company-dabbrev-code)
|
(set-company-backend! 'ruby-mode 'company-dabbrev-code)
|
||||||
(set! :electric 'ruby-mode :words '("else" "end" "elseif"))
|
(set! :electric 'ruby-mode :words '("else" "end" "elseif"))
|
||||||
(set! :env "RBENV_ROOT")
|
(set-env! "RBENV_ROOT")
|
||||||
(set! :repl 'ruby-mode #'inf-ruby) ; `inf-ruby'
|
(set! :repl 'ruby-mode #'inf-ruby) ; `inf-ruby'
|
||||||
(setq ruby-deep-indent-paren t)
|
(setq ruby-deep-indent-paren t)
|
||||||
;; Don't interfere with my custom RET behavior
|
;; Don't interfere with my custom RET behavior
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! rust-mode
|
(after! rust-mode
|
||||||
(set! :env "RUST_SRC_PATH")
|
(set-env! "RUST_SRC_PATH")
|
||||||
(set! :docset 'rust-mode "Rust")
|
(set! :docset 'rust-mode "Rust")
|
||||||
(setq rust-indent-method-chain t)
|
(setq rust-indent-method-chain t)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
;; `pass'
|
;; `pass'
|
||||||
(after! pass
|
(after! pass
|
||||||
(set! :env "PASSWORD_STORE_DIR")
|
(set-env! "PASSWORD_STORE_DIR")
|
||||||
(set-evil-initial-state! 'pass-mode 'emacs)
|
(set-evil-initial-state! 'pass-mode 'emacs)
|
||||||
(set-popup-rule! "^\\*Password-Store"
|
(set-popup-rule! "^\\*Password-Store"
|
||||||
'((side . left) (size . 0.25))
|
'((side . left) (size . 0.25))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue