General cleanup + refactor

This commit is contained in:
Henrik Lissner 2017-02-25 02:11:56 -05:00
parent a0305418ae
commit 253858303e
2 changed files with 17 additions and 25 deletions

View file

@ -28,12 +28,10 @@
;; `exec-path-from-shell' is slow, so bring out the cache ;; `exec-path-from-shell' is slow, so bring out the cache
(setq exec-path (setq exec-path
(or (persistent-soft-fetch 'exec-path "emacs") (or (persistent-soft-fetch 'exec-path "emacs")
(persistent-soft-store (and (require 'exec-path-from-shell nil t)
'exec-path (progn (exec-path-from-shell-initialize)
(progn (when (require 'exec-path-from-shell nil t) (persistent-soft-store 'exec-path exec-path "emacs")))
(exec-path-from-shell-initialize)) exec-path)))
exec-path)
"emacs"))))
(t (t
(when (require 'osx-clipboard nil t) (when (require 'osx-clipboard nil t)
(osx-clipboard-mode +1)))) (osx-clipboard-mode +1))))

View file

@ -27,13 +27,6 @@
(defvar-local doom-popup-rules nil (defvar-local doom-popup-rules nil
"The shackle rule that caused this buffer to be recognized as a popup.") "The shackle rule that caused this buffer to be recognized as a popup.")
(defvar doom-popup-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [escape] 'doom/popup-close-maybe)
(define-key map (kbd "ESC") 'doom/popup-close-maybe)
map)
"Active keymap in popup windows.")
(defvar doom-popup-window-parameters '(:noesc :modeline :autokill) (defvar doom-popup-window-parameters '(:noesc :modeline :autokill)
"A list of window parameters that are set (and cleared) when `doom-popup-mode "A list of window parameters that are set (and cleared) when `doom-popup-mode
is enabled/disabled.'") is enabled/disabled.'")
@ -111,6 +104,13 @@ for :align t on every rule."
(dolist (param doom-popup-window-parameters) (dolist (param doom-popup-window-parameters)
(push (cons param 'writable) window-persistent-parameters)) (push (cons param 'writable) window-persistent-parameters))
(defvar doom-popup-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [escape] 'doom/popup-close-maybe)
(define-key map (kbd "ESC") 'doom/popup-close-maybe)
map)
"Active keymap in popup windows.")
(define-minor-mode doom-popup-mode (define-minor-mode doom-popup-mode
"Minor mode for popup windows." "Minor mode for popup windows."
:init-value nil :init-value nil
@ -270,8 +270,7 @@ the command buffer."
;; Don't block moving to/from popup windows ;; Don't block moving to/from popup windows
(defun doom*ignore-window-parameters-in-popups (dir &optional arg window) (defun doom*ignore-window-parameters-in-popups (dir &optional arg window)
(window-in-direction (window-in-direction (cond ((eq dir 'up) 'above)
(cond ((eq dir 'up) 'above)
((eq dir 'down) 'below) ((eq dir 'down) 'below)
(t dir)) (t dir))
window t arg windmove-wrap-around t)) window t arg windmove-wrap-around t))
@ -304,7 +303,8 @@ the command buffer."
:supertype 'help-xref :supertype 'help-xref
'help-function 'help-function
(lambda (var &optional file) (lambda (var &optional file)
(when (eq file 'C-source) (setq file (help-C-file-name var 'var))) (when (eq file 'C-source)
(setq file (help-C-file-name var 'var)))
(doom--switch-from-popup (find-variable-noselect var file)))) (doom--switch-from-popup (find-variable-noselect var file))))
(define-button-type 'help-face-def (define-button-type 'help-face-def
@ -332,15 +332,9 @@ the command buffer."
(save-selected-window (save-selected-window
(neotree-show)))))) (neotree-show))))))
;; Prevent neotree from interfering with popups
;; (advice-add 'shackle-display-buffer :around 'doom*popups-save-neotree)
;; Prevents messing up the neotree buffer on window changes ;; Prevents messing up the neotree buffer on window changes
(advice-add '+evil-window-move :around 'doom*popups-save-neotree) (advice-add '+evil-window-move :around 'doom*popups-save-neotree)
;; (advice-add 'doom-popup-buffer :around 'doom*popups-save-neotree)
;; Don't let neotree interfere with moving, splitting or rebalancing windows ;; Don't let neotree interfere with moving, splitting or rebalancing windows
;; (advice-add 'balance-windows :around 'doom*popups-save-neotree)
;; (advice-add 'split-window :around 'doom*popups-save-neotree)
;; (advice-add 'shackle-display-buffer :around 'doom*popups-save-neotree)
(advice-add 'evil-window-move-very-bottom :around 'doom*popups-save-neotree) (advice-add 'evil-window-move-very-bottom :around 'doom*popups-save-neotree)
(advice-add 'evil-window-move-very-top :around 'doom*popups-save-neotree) (advice-add 'evil-window-move-very-top :around 'doom*popups-save-neotree)
(advice-add 'evil-window-move-far-left :around 'doom*popups-save-neotree) (advice-add 'evil-window-move-far-left :around 'doom*popups-save-neotree)