[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-posframe 3784f59 054/195: ivy-posframe.el (ivy-posf
From: |
Feng Shu |
Subject: |
[elpa] externals/ivy-posframe 3784f59 054/195: ivy-posframe.el (ivy-posframe-avy): Simplify |
Date: |
Sat, 3 Oct 2020 07:11:44 -0400 (EDT) |
branch: externals/ivy-posframe
commit 3784f593f7260a392f1646e8aeb583cdf23f25d7
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy-posframe.el (ivy-posframe-avy): Simplify
---
ivy-posframe.el | 47 ++++-------------------------------------------
1 file changed, 4 insertions(+), 43 deletions(-)
diff --git a/ivy-posframe.el b/ivy-posframe.el
index f8675e1..8304c6a 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -287,13 +287,6 @@ selection, non-nil otherwise."
(setcar actions (1+ action-idx))
(ivy-set-action actions)))))))
-(defun ivy-posframe--avy-action (pt)
- "Finish ivy session with the candidate at PT."
- (with-current-buffer ivy-posframe-buffer
- (ivy--done
- (substring-no-properties
- (nth (- (line-number-at-pos pt) 2) ivy--old-cands)))))
-
(defun ivy-posframe--window ()
"Return the posframe window displaying `ivy-posframe-buffer'."
(frame-selected-window
@@ -302,46 +295,14 @@ selection, non-nil otherwise."
(defvar avy-all-windows)
(defvar avy-keys)
-(defvar avy-keys-alist)
(defvar avy-style)
-(defvar avy-styles-alist)
-(defvar avy-action)
-(declare-function avy--process "avy")
-(declare-function avy--style-fn "avy")
+
(defun ivy-posframe-avy ()
"Jump to one of the current ivy candidates."
(interactive)
- (unless (require 'avy nil 'noerror)
- (error "Package avy isn't installed"))
- (unless (boundp 'avy-pre-action)
- (error "A newer version of avy is required for this command"))
- (let* ((avy-all-windows nil)
- (avy-keys (or (cdr (assq 'ivy-avy avy-keys-alist))
- avy-keys))
- (avy-style (or (cdr (assq 'ivy-avy
- avy-styles-alist))
- avy-style))
- ;; prevent default pre action, which calls
- ;; `select-frame-set-input-focus', deselecting the minibuffer and
- ;; causing `ivy-posframe-cleanup' to run prematurely
- (avy-pre-action #'ignore)
- (window (ivy-posframe--window))
- candidates)
- (with-current-buffer ivy-posframe-buffer
- (save-excursion
- (save-restriction
- (narrow-to-region
- (window-start window)
- (window-end window))
- (goto-char (point-min))
- (forward-line)
- (while (< (point) (point-max))
- (push (cons (point) window) candidates)
- (forward-line)))))
- (setq avy-action #'ivy-posframe--avy-action)
- (avy--process
- (nreverse candidates)
- (avy--style-fn avy-style))))
+ (let ((avy-pre-action #'ignore))
+ (with-selected-window (ivy-posframe--window)
+ (ivy-avy))))
(declare-function avy--make-backgrounds "avy")
(declare-function avy-window-list "avy")
- [elpa] externals/ivy-posframe 5482c07 024/195: Update README, (continued)
- [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, 2020/10/03
- [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 <=
- [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
- [elpa] externals/ivy-posframe 823d3db 023/195: Update README, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0f159d5 025/195: Add frame-bottom-window-center style, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe e1624e7 027/195: ivy-posframe-display: style -> style-or-poshandler, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 5312e07 031/195: Add ivy-posframe-parameters, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 8f62984 033/195: Add ivy-posframe-read-action and ivy-posframe-dispatching-done, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 26e3a64 034/195: ivy-posframe: add ivy-posframe-avy, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe 0989e42 039/195: Show cursor's position, fix #9, Feng Shu, 2020/10/03
- [elpa] externals/ivy-posframe b37e713 041/195: Merge pull request #10 from drrlvn/patch-1, Feng Shu, 2020/10/03