[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-posframe e76a15d 162/195: Merge pull request #53 fr
From: |
Feng Shu |
Subject: |
[elpa] externals/ivy-posframe e76a15d 162/195: Merge pull request #53 from gagbo/patch-1 |
Date: |
Sat, 3 Oct 2020 07:12:05 -0400 (EDT) |
branch: externals/ivy-posframe
commit e76a15dbe37ca428fe583a9eee6b395bc30b8e18
Merge: c654366 556c9a9
Author: tumashu <tumashu@163.com>
Commit: GitHub <noreply@github.com>
Merge pull request #53 from gagbo/patch-1
Check (display-graphic-p) dynamically in advices
---
ivy-posframe.el | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/ivy-posframe.el b/ivy-posframe.el
index 5392f6e..63c5906 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -467,6 +467,20 @@ selection, non-nil otherwise."
;;; Advice
+(defun ivy-posframe--posframe-p-advice (advice-fn &rest args)
+ "Advice function of ADVICE-FN, used to bypass the advice from
+`ivy-posframe-advice-alist' if the posframe cannot be displayed.
+
+ADVICE-FN should be a value from `ivy-posframe-advice-alist', but
+the function only errors if ARGS is empty. There should at least be
+the advised function there (a key from `ivy-posframe-advice-alist')."
+ (unless (< 0 (length args))
+ (error "This function should advise an advice, so args should be at least
a key from ivy-posframe-advice-alist"))
+ (if (display-graphic-p)
+ (apply advice-fn args)
+ (apply (car args) (cdr args)))
+ )
+
(defun ivy-posframe--minibuffer-setup (fn &rest args)
"Advice function of FN, `ivy--minibuffer-setup' with ARGS."
(let ((ivy-fixed-height-minibuffer nil))
@@ -532,10 +546,14 @@ selection, non-nil otherwise."
(let ((advices ivy-posframe-advice-alist))
(if ivy-posframe-mode
(mapcar (lambda (elm)
- (advice-add (car elm) :around (cdr elm)))
+ (progn
+ (advice-add (cdr elm) :around
'ivy-posframe--posframe-p-advice)
+ (advice-add (car elm) :around (cdr elm))))
advices)
(mapcar (lambda (elm)
- (advice-remove (car elm) (cdr elm)))
+ (progn
+ (advice-remove (cdr elm) 'ivy-posframe--posframe-p-advice)
+ (advice-remove (car elm) (cdr elm))))
advices))))
;;;###autoload
- [elpa] externals/ivy-posframe 7dc84ee 152/195: Fix2 First line disappears with the specific condition. #47, (continued)
- [elpa] externals/ivy-posframe 7dc84ee 152/195: Fix2 First line disappears with the specific condition. #47, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe d35af4f 144/195: handle ivy-display-function again, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 8902638 100/195: define ivy-posframe-adbice-alist, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 212eaa1 138/195: indent ivy-posframe-mode, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe b934152 125/195: move variables section above advice section, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 9e0c6da 118/195: generate readme, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 02a357d 104/195: define ivy-posframe-mode instead of ivy-posframe-enable, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe aea9074 122/195: add ivy-posframe--read advice, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 76350e7 146/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe c4091c3 120/195: remove unnesessary code, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe e76a15d 162/195: Merge pull request #53 from gagbo/patch-1,
Feng Shu <=
- [elpa] externals/ivy-posframe 83657be 114/195: add display-functions-alist to restore ivy variable, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 27e3cec 176/195: Try to fix Minibuffer is hiding always #66, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe c43acf3 132/195: alias ivy-posframe-enable as ivy-posframe-mode, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 3c3740e 142/195: Add ivy-posframe-lighter, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 6d697ff 190/195: Try to fix: Posframe max-width? #82, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe ae9bafe 191/195: (defvar avy-pre-action), Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 4242977 079/195: Remove #' (function quote) of `lambda`, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0a870c1 080/195: Remove top-level ivy-posframe setup function executing, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 38aff80 084/195: Add ivy-posframe-demo, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 13180ce 087/195: Merge pull request #35 from conao3/fix-minibuffer-issue, Feng Shu, 2020/10/03