ui/popup: refactor hacks

This commit is contained in:
Henrik Lissner 2018-08-03 23:56:28 +02:00
parent 1f1f2c3ebf
commit 4489ce6b81
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -35,7 +35,7 @@
;; ;;
;; `company' ;; `company'
(after! company (progn
(defun +popup*dont-select-me (orig-fn &rest args) (defun +popup*dont-select-me (orig-fn &rest args)
(let ((+popup--inhibit-select t)) (let ((+popup--inhibit-select t))
(apply orig-fn args))) (apply orig-fn args)))
@ -43,7 +43,7 @@
;; `eshell' ;; `eshell'
(after! eshell (progn
(setq eshell-destroy-buffer-when-process-dies t) (setq eshell-destroy-buffer-when-process-dies t)
;; When eshell runs a visual command (see `eshell-visual-commands'), it spawns ;; When eshell runs a visual command (see `eshell-visual-commands'), it spawns
@ -59,7 +59,7 @@
;; `evil' ;; `evil'
(after! evil (progn
(defun +popup*evil-command-window (hist cmd-key execute-fn) (defun +popup*evil-command-window (hist cmd-key execute-fn)
"The evil command window has a mind of its own (uses `switch-to-buffer'). We "The evil command window has a mind of its own (uses `switch-to-buffer'). We
monkey patch it to use pop-to-buffer, and to remember the previous window." monkey patch it to use pop-to-buffer, and to remember the previous window."
@ -150,7 +150,7 @@ the command buffer."
;; `helpful' ;; `helpful'
(after! helpful (progn
;; Open link in origin window (non-popup) instead of inside the popup window. ;; Open link in origin window (non-popup) instead of inside the popup window.
(defun +popup*helpful--navigate (button) (defun +popup*helpful--navigate (button)
(let ((path (substring-no-properties (button-get button 'path))) (let ((path (substring-no-properties (button-get button 'path)))
@ -183,7 +183,7 @@ the command buffer."
;; `helm-ag' ;; `helm-ag'
(after! helm-ag (progn
(defun +helm*pop-to-buffer (orig-fn &rest args) (defun +helm*pop-to-buffer (orig-fn &rest args)
(pop-to-buffer (pop-to-buffer
(save-window-excursion (apply orig-fn args) (save-window-excursion (apply orig-fn args)
@ -290,8 +290,7 @@ instead of switch-to-buffer-*."
;; `which-key' ;; `which-key'
(after! which-key (setq which-key-popup-type 'custom
(setq which-key-popup-type 'custom
which-key-custom-popup-max-dimensions-function (lambda (_) (which-key--side-window-max-dimensions)) which-key-custom-popup-max-dimensions-function (lambda (_) (which-key--side-window-max-dimensions))
which-key-custom-hide-popup-function #'which-key--hide-buffer-side-window which-key-custom-hide-popup-function #'which-key--hide-buffer-side-window
which-key-custom-show-popup-function which-key-custom-show-popup-function
@ -300,7 +299,7 @@ instead of switch-to-buffer-*."
(lambda (buffer alist) (lambda (buffer alist)
(+popup-display-buffer-stacked-side-window (+popup-display-buffer-stacked-side-window
buffer (append '((vslot . -9999)) alist))))) buffer (append '((vslot . -9999)) alist)))))
(which-key--show-buffer-side-window act-popup-dim))))) (which-key--show-buffer-side-window act-popup-dim))))
;; `windmove' ;; `windmove'