Conform helm posframe code to Doom conventions

This commit is contained in:
Henrik Lissner 2018-06-01 13:03:25 +02:00 committed by GitHub
parent a3915dfc91
commit 8f673f52fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,25 +53,6 @@
(require 'helm-projectile) (require 'helm-projectile)
(set-keymap-parent helm-projectile-find-file-map helm-map) (set-keymap-parent helm-projectile-find-file-map helm-map)
;; Posframes!
(when (and EMACS26+ (featurep! +childframe))
(defvar helm-posframe-buffer nil)
(defun helm-posframe-display (buffer &optional _resume)
(posframe-show
(setq helm-posframe-buffer buffer)
:poshandler #'posframe-poshandler-frame-bottom-left-corner
:left-fringe 10
:width (frame-width)
:height 16 ;; ivy/+childframe uses 16
:respect-header-line t))
(defun helm-posframe-cleanup ()
(posframe-hide helm-posframe-buffer))
(add-hook! 'helm-cleanup-hook #'helm-posframe-cleanup)
(setq helm-display-function #'helm-posframe-display))
;;; Helm hacks ;;; Helm hacks
(defun +helm*replace-prompt (plist) (defun +helm*replace-prompt (plist)
"Globally replace helm prompts with `+helm-global-prompt'." "Globally replace helm prompts with `+helm-global-prompt'."
@ -161,7 +142,24 @@
(def-package! posframe (def-package! posframe
:when (and EMACS26+ (featurep! +childframe)) :when (and EMACS26+ (featurep! +childframe))
:after helm) :after helm
:config
(defvar +helm--posframe-buffer nil)
(defun +helm-posframe-display (buffer &optional _resume)
(posframe-show
(setq +helm--posframe-buffer buffer)
:poshandler #'posframe-poshandler-frame-bottom-left-corner
:left-fringe 10
:width (frame-width)
:height 16 ;; ivy/+childframe uses 16
:respect-header-line t))
(defun +helm|posframe-cleanup ()
(posframe-hide +helm--posframe-buffer))
(add-hook! 'helm-cleanup-hook #'+helm|posframe-cleanup)
(setq helm-display-function #'+helm-posframe-display))
;; ;;