[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-explorer e7e2e4e 12/29: Improve posframe support
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/ivy-explorer e7e2e4e 12/29: Improve posframe support |
Date: |
Tue, 12 Mar 2019 09:04:35 -0400 (EDT) |
branch: externals/ivy-explorer
commit e7e2e4ecf18cfa59798968206559696b145bd20b
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Improve posframe support
---
ivy-explorer.el | 46 ++++++++++++++++++++++++++++++++++++----------
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/ivy-explorer.el b/ivy-explorer.el
index 6175347..4332c2f 100644
--- a/ivy-explorer.el
+++ b/ivy-explorer.el
@@ -85,6 +85,10 @@ By default you can choose between `ivy-explorer--posframe'
and
:group 'ivy-explorer
:type 'function)
+(defcustom ivy-explorer-height ivy-height
+ "Height used if `ivy-explorer-message-function' has no dynamic height."
+ :type 'integer)
+
(defcustom ivy-explorer-auto-init-avy nil
"Whether to load grid views with avy selection enabled by default."
:group 'ivy-explorer
@@ -149,12 +153,16 @@ Only the background color is significant."
(push '(ivy-explorer--display-function :cleanup ivy-explorer--cleanup)
ivy-display-functions-props)
+(defvar ivy-explorer--posframe-buffer
+ " *ivy-explorer-pos-frame-buffer*")
+
(defun ivy-explorer--cleanup ()
(when (and ivy-explorer-mode
;; TODO: add a user option?
(string-match "posframe"
(symbol-name ivy-explorer-message-function)))
- (ivy-posframe-cleanup)))
+ (when (ivy-posframe-workable-p)
+ (posframe-hide ivy-explorer--posframe-buffer))))
;; * Ivy explorer menu
@@ -301,13 +309,27 @@ the menu string as `cdr'."
(defun ivy-explorer--posframe (msg)
- (let ((ivy-posframe-width (frame-width)))
- (ivy-posframe--display (concat "\n" msg)
- (lambda (info)
- (cons 0
- (- 0
- (plist-get info :mode-line-height)
- (plist-get info :minibuffer-height)))))))
+ (unless (require 'posframe nil t)
+ (user-error "Posframe library not found"))
+ (with-selected-window (ivy--get-window ivy-last)
+ (posframe-show
+ ivy-explorer--posframe-buffer
+ :string
+ (with-current-buffer (get-buffer-create " *Minibuf-1*")
+ (let ((point (point))
+ (string (concat (buffer-string) " \n" msg)))
+ (add-text-properties (- point 1) point '(face (:inherit cursor))
+ string)
+ string))
+ :poshandler (lambda (info)
+ (cons (frame-parameter nil 'left-fringe)
+ (- 0
+ (plist-get info :mode-line-height)
+ (plist-get info :minibuffer-height))))
+ :background-color (face-attribute 'fringe :background)
+ :height ivy-explorer-height
+ :width (frame-width))))
+
;; * Minibuffer commands
@@ -362,8 +384,10 @@ the menu string as `cdr'."
(ivy-explorer--avy-1 b))))
(defun ivy-explorer-avy-posframe-handler ()
- (let* ((w (ivy-posframe--window))
- (b ivy-posframe-buffer))
+ (let* ((b ivy-explorer--posframe-buffer)
+ (w (frame-selected-window
+ (buffer-local-value 'posframe--frame
+ (get-buffer b)))))
(with-selected-window w
(ivy-explorer--avy-1 b ))))
@@ -629,6 +653,8 @@ Call the permanent action if possible.")
"Invoke ivy explorer for F with ARGS."
(let ((ivy-display-function #'ivy-explorer--display-function)
(completing-read-function 'ivy-completing-read)
+ (ivy-posframe-hide-minibuffer
+ (eq ivy-explorer-message-function #'ivy-explorer--posframe))
;; max number of candidates
(ivy-height (funcall ivy-explorer-max-function))
(ivy-wrap nil)
- [elpa] externals/ivy-explorer updated (be8008b -> 5f9dafc), Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4262a07 04/29: Ignore ivy-posframe-hide-minibuffer setting., Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 3325d82 02/29: Add bol/eol commands for grid (#6), Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 5161d5f 06/29: Remove unused ivy-explorer-lv-force-update variable, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 545e0a9 05/29: Make message function a user option, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer e7e2e4e 12/29: Improve posframe support,
Clemens Radermacher <=
- [elpa] externals/ivy-explorer 918c133 11/29: Add row counter variable, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 35ee473 13/29: Skip first line when parsing posframe buffer for avy, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer af08f55 03/29: Refactoring, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 5475145 01/29: Add Elpa badge, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 1da2e48 16/29: Increase default number of columns to 5, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4c19171 22/29: Add ivy-explorer-read function to read any colledtion with the grid, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer a30fc60 15/29: Actually respect the setting of `ivy-explorer-max-columns`, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer 4a48ec4 17/29: Add posframe screenshot, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer bc207da 10/29: Add basic posframe support for #7, Clemens Radermacher, 2019/03/12
- [elpa] externals/ivy-explorer f9e3b7a 07/29: Add auto-init-avy option, and improve avy exit behaviour, Clemens Radermacher, 2019/03/12