[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-posframe 0be1372 029/195: Remove ivy-posframe-style
From: |
Feng Shu |
Subject: |
[elpa] externals/ivy-posframe 0be1372 029/195: Remove ivy-posframe-style variable |
Date: |
Sat, 3 Oct 2020 07:11:39 -0400 (EDT) |
branch: externals/ivy-posframe
commit 0be1372430b0551effc5b86f52dabcc2de4c595c
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Remove ivy-posframe-style variable
This feature seem to useless, for user can
set different ivy-posframe display function in ivy-display-function
---
README.md | 33 ++++++++++----------------------
ivy-posframe.el | 58 ++++++++++++++-------------------------------------------
2 files changed, 24 insertions(+), 67 deletions(-)
diff --git a/README.md b/README.md
index 55bef0d..ba5e89c 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,19 @@
# 目录
-1. [ivy-posframe README](#org39783d3)
- 1. [What is ivy-posframe](#orgd46557b)
- 2. [Display functions](#orge009677)
- 3. [How to enable ivy-posframe](#org5a3f479)
- 4. [How to custom your ivy-posframe style](#org333b256)
+1. [ivy-posframe README](#orgad72029)
+ 1. [What is ivy-posframe](#orgf3fce48)
+ 2. [Display functions](#org1420034)
+ 3. [How to enable ivy-posframe](#orgcd8666c)
+ 4. [How to custom your ivy-posframe style](#org7c1f241)
-<a id="org39783d3"></a>
+<a id="orgad72029"></a>
# ivy-posframe README
-<a id="orgd46557b"></a>
+<a id="orgf3fce48"></a>
## What is ivy-posframe
@@ -23,7 +23,7 @@ to show its candidate menu.
NOTE: ivy-posframe requires Emacs 26
-<a id="orge009677"></a>
+<a id="org1420034"></a>
## Display functions
@@ -39,7 +39,7 @@ NOTE: ivy-posframe requires Emacs 26
![img](./snapshots/ivy-posframe-display-at-point.gif)
-<a id="org5a3f479"></a>
+<a id="orgcd8666c"></a>
## How to enable ivy-posframe
@@ -63,21 +63,8 @@ NOTE: ivy-posframe requires Emacs 26
(require 'ivy-posframe)
(push '(t . ivy-posframe-display) ivy-display-functions-alist)
-If you use \`ivy-posframe-display', you can use \`ivy-posframe-style'
-to set show style.
-1. window-bottom-left style
-
- (setq ivy-posframe-style 'window-bottom-left)
-2. Window-center style
-
- (setq ivy-posframe-style 'window-center)
-3. Point style
-
- (setq ivy-posframe-style 'point)
-
-
-<a id="org333b256"></a>
+<a id="org7c1f241"></a>
## How to custom your ivy-posframe style
diff --git a/ivy-posframe.el b/ivy-posframe.el
index 35218e5..622ba41 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -71,22 +71,6 @@
;; (push '(t . ivy-posframe-display) ivy-display-functions-alist)
;; #+END_EXAMPLE
-;; If you use `ivy-posframe-display', you can use `ivy-posframe-style'
-;; to set show style.
-
-;; 1. window-bottom-left style
-;; #+BEGIN_EXAMPLE
-;; (setq ivy-posframe-style 'window-bottom-left)
-;; #+END_EXAMPLE
-;; 2. Window-center style
-;; #+BEGIN_EXAMPLE
-;; (setq ivy-posframe-style 'window-center)
-;; #+END_EXAMPLE
-;; 3. Point style
-;; #+BEGIN_EXAMPLE
-;; (setq ivy-posframe-style 'point)
-;; #+END_EXAMPLE
-
;; ** How to custom your ivy-posframe style
;; The simplest way is:
@@ -113,11 +97,6 @@ When nil, Using current frame's font as fallback."
:group 'ivy-posframe
:type 'string)
-(defcustom ivy-posframe-style 'window-bottom-left
- "The style of ivy-posframe."
- :group 'ivy-posframe
- :type 'string)
-
(defface ivy-posframe
'((t (:inherit default :background "#333333" :foreground "#dcdccc")))
"Face used by the ivy-posframe."
@@ -126,21 +105,10 @@ When nil, Using current frame's font as fallback."
(defvar ivy-posframe-buffer " *ivy-posframe-buffer*"
"The posframe-buffer used by ivy-posframe.")
-(defvar ivy-posframe-style-alist
- '((window-center . posframe-poshandler-window-center)
- (frame-center . posframe-poshandler-frame-center)
- (window-bottom-left . posframe-poshandler-window-bottom-left-corner)
- (frame-bottom-left . posframe-poshandler-frame-bottom-left-corner)
- (frame-bottom-window-center . (lambda (info)
- (cons (car
(posframe-poshandler-window-center info))
- (cdr
(posframe-poshandler-frame-bottom-left-corner info)))))
- (point . posframe-poshandler-point-bottom-left-corner))
- "Alist of ivy posframe styles.")
-
;; Fix warn
(defvar emacs-basic-display)
-(defun ivy-posframe-display (str &optional style-or-poshandler)
+(defun ivy-posframe--display (str &optional poshandler)
"Show STR in ivy's posframe."
(if (not (ivy-posframe-workable-p))
(ivy-display-function-fallback str)
@@ -152,34 +120,36 @@ When nil, Using current frame's font as fallback."
(with-current-buffer (get-buffer-create " *Minibuf-1*")
(concat (buffer-string) " " str))
:position (point)
- :poshandler
- (if (functionp style-or-poshandler)
- style-or-poshandler
- (cdr (assq (or style-or-poshandler ivy-posframe-style)
- ivy-posframe-style-alist)))
+ :poshandler poshandler
:background-color (face-attribute 'ivy-posframe :background)
:foreground-color (face-attribute 'ivy-posframe :foreground)
:height ivy-height
:min-height 10
:min-width 50))))
+(defun ivy-posframe-display (str)
+ (ivy-posframe--display str #'posframe-poshandler-frame-bottom-left-corner))
+
(defun ivy-posframe-display-at-window-center (str)
- (ivy-posframe-display str 'window-center))
+ (ivy-posframe--display str #'posframe-poshandler-window-center))
(defun ivy-posframe-display-at-frame-center (str)
- (ivy-posframe-display str 'frame-center))
+ (ivy-posframe--display str #'posframe-poshandler-frame-center))
(defun ivy-posframe-display-at-window-bottom-left (str)
- (ivy-posframe-display str 'window-bottom-left))
+ (ivy-posframe--display str #'posframe-poshandler-window-bottom-left-corner))
(defun ivy-posframe-display-at-frame-bottom-left (str)
- (ivy-posframe-display str 'frame-bottom-left))
+ (ivy-posframe--display str #'posframe-poshandler-frame-bottom-left-corner))
(defun ivy-posframe-display-at-frame-bottom-window-center (str)
- (ivy-posframe-display str 'frame-bottom-window-center))
+ (ivy-posframe--display
+ str #'(lambda (info)
+ (cons (car (posframe-poshandler-window-center info))
+ (cdr (posframe-poshandler-frame-bottom-left-corner info))))))
(defun ivy-posframe-display-at-point (str)
- (ivy-posframe-display str 'point))
+ (ivy-posframe--display str #'posframe-poshandler-point-bottom-left-corner))
(defun ivy-posframe-cleanup ()
"Cleanup ivy's posframe."
- [elpa] externals/ivy-posframe 8a54dbb 011/195: Use ivy-display-function-fallback, (continued)
- [elpa] externals/ivy-posframe 8a54dbb 011/195: Use ivy-display-function-fallback, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 8a3ecb3 014/195: package-require ivy, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0136107 015/195: Remove ivy-posframe-mode, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 2546238 016/195: reuse minibuffer's ivy prompt, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9db2b75 017/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 550c322 018/195: Fix warn, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe c36250a 013/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe cef74e6 021/195: Different command can set different ivy-posframe display function, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 5482c07 024/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 1f3dbf4 026/195: Add ivy-posframe-setup and use it., Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0be1372 029/195: Remove ivy-posframe-style variable,
Feng Shu <=
- [elpa] externals/ivy-posframe 387045c 032/195: Fix README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 26a7ba7 036/195: Add ivy-posframe-enable and use it, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe b9b9a45 038/195: Update, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9f6b58d 040/195: Cursor face inherits from regular cursor face, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 266d622 042/195: Set ivy-posframe-cursor as mulitcursor, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 061a125 030/195: Re-add ivy-posframe-style for compatible, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe e0247bf 035/195: split ivy-posframe-setup to ivy-posframe-init and ivy-posframe-setup, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 3784f59 054/195: ivy-posframe.el (ivy-posframe-avy): Simplify, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ddaf875 020/195: Add Emacs version requirement to README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 7e871bd 022/195: Fix type: buttom -> bottom, Feng Shu, 2020/10/03