[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-posframe 9f6628d 158/195: Add ivy-posframe-size-fun
From: |
Feng Shu |
Subject: |
[elpa] externals/ivy-posframe 9f6628d 158/195: Add ivy-posframe-size-function #50 |
Date: |
Sat, 3 Oct 2020 07:12:05 -0400 (EDT) |
branch: externals/ivy-posframe
commit 9f6628dd184ceec4be43f7466ba589ec705c50ad
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add ivy-posframe-size-function #50
---
ivy-posframe.el | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/ivy-posframe.el b/ivy-posframe.el
index 631d86e..6590d9d 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -183,6 +183,11 @@ When nil, Using current frame's font as fallback."
:group 'ivy-posframe
:type 'number)
+(defcustom ivy-posframe-size-function #'ivy-posframe-get-size
+ "The function which is used to deal with posframe's size."
+ :group 'ivy-posframe
+ :type 'function)
+
(defcustom ivy-posframe-border-width 1
"The border width used by ivy-posframe.
When 0, no border is showed."
@@ -248,23 +253,28 @@ This variable is useful for `ivy-posframe-read-action' .")
(ivy-display-function-fallback str)
(setq ivy-posframe--display-p t)
(with-ivy-window
- (posframe-show
- ivy-posframe-buffer
- :font ivy-posframe-font
- :string str
- :position (point)
- :poshandler poshandler
- :background-color (face-attribute 'ivy-posframe :background nil t)
- :foreground-color (face-attribute 'ivy-posframe :foreground nil t)
- :height ivy-posframe-height
- :width ivy-posframe-width
- :min-height (or ivy-posframe-min-height (+ ivy-height 1))
- :min-width (or ivy-posframe-min-width (round (* (frame-width) 0.62)))
- :internal-border-width ivy-posframe-border-width
- :internal-border-color (face-attribute 'ivy-posframe-border :background
nil t)
- :override-parameters ivy-posframe-parameters))
+ (apply #'posframe-show
+ ivy-posframe-buffer
+ :font ivy-posframe-font
+ :string str
+ :position (point)
+ :poshandler poshandler
+ :background-color (face-attribute 'ivy-posframe :background nil t)
+ :foreground-color (face-attribute 'ivy-posframe :foreground nil t)
+ :internal-border-width ivy-posframe-border-width
+ :internal-border-color (face-attribute 'ivy-posframe-border
:background nil t)
+ :override-parameters ivy-posframe-parameters
+ (funcall ivy-posframe-size-function)))
(ivy-posframe--add-prompt 'ignore)))
+(defun ivy-posframe-get-size ()
+ "The default functon used by `ivy-posframe-size-function'."
+ (list
+ :height ivy-posframe-height
+ :width ivy-posframe-width
+ :min-height (or ivy-posframe-min-height (+ ivy-height 1))
+ :min-width (or ivy-posframe-min-width (round (* (frame-width) 0.62)))))
+
(defun ivy-posframe-display (str)
"Display STR via `posframe' by `ivy-posframe-style'."
(let ((func (intern (format "ivy-posframe-display-at-%s"
ivy-posframe-style))))
- [elpa] externals/ivy-posframe cc64ed6 115/195: extend display-functions-alist to configure-alist, (continued)
- [elpa] externals/ivy-posframe cc64ed6 115/195: extend display-functions-alist to configure-alist, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe e500f69 188/195: try and fix issues with posframe, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe d539ac2 195/195: version 0.2.0, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 76456e6 149/195: Merge pull request #46 from tttuuu888/work, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe fd1e40a 113/195: change variable name, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 2cac20d 178/195: Hide minibuffer when posframe workable, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 97337e3 109/195: fix docstring, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9b084b7 174/195: Fix Minibuffer hiding does not work #62, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ce7505d 171/195: Merge pull request #57 from conao3/fix-warning, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe e76565a 140/195: use (ivy-posframe-mode 1), Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9f6628d 158/195: Add ivy-posframe-size-function #50,
Feng Shu <=
- [elpa] externals/ivy-posframe 2f1fdbe 169/195: use mapc instead of mapcar, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe f4e17ae 127/195: remove unneeded configure alist variable, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 057d628 182/195: Fix for prompt line duplicated issue. #71, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 716ce62 105/195: refactoring; using let-environment, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 8ad4668 180/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 8abcf52 163/195: define defun-advice function, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0082f43 147/195: add maintainer comment of conao3 at header, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe d5e7314 099/195: move ivy-posframe--add-prompt to advice section, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 80036e7 103/195: define keybind with ivy-posframe-keybind-list, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 52ba5f7 156/195: Merge pull request #49 from tttuuu888/work-list2, Feng Shu, 2020/10/03