[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master eda091b 017/167: Customize ivy-avy and fix compile warning
From: |
Oleh Krehel |
Subject: |
[elpa] master eda091b 017/167: Customize ivy-avy and fix compile warnings |
Date: |
Tue, 08 Dec 2015 10:49:37 +0000 |
branch: master
commit eda091bf5d0c501116585d73d35b2e3ec2652fcd
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Customize ivy-avy and fix compile warnings
* ivy.el (ivy-avy): Require avy. Allow the user to customize `avy-keys',
`avy-background' and `avy-style' (but prefer 'pre to 'at-full, since
it doesn't obscure any letters). Don't issue an extra `ivy-call'.
Fixes #246
---
ivy.el | 55 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/ivy.el b/ivy.el
index b983db0..6c3c789 100644
--- a/ivy.el
+++ b/ivy.el
@@ -745,28 +745,51 @@ On error (read-only), call `ivy-on-del-error-function'."
(setq ivy--old-re nil)
(cl-rotatef ivy--regex-function ivy--regexp-quote))
+(defvar avy-all-windows)
+(defvar avy-action)
+(defvar avy-keys)
+(defvar avy-keys-alist)
+(defvar avy-style)
+(defvar avy-styles-alist)
+(declare-function avy--process "ext:avy")
+(declare-function avy--style-fn "ext:avy")
+
+(eval-after-load 'avy
+ '(add-to-list 'avy-styles-alist '(ivy-avy . pre)))
+
(defun ivy-avy ()
"Jump to one of the current ivy candidates."
(interactive)
+ (unless (require 'avy nil 'noerror)
+ (error "Package avy isn't installed"))
(let* ((avy-all-windows nil)
- (avy-background t)
- (candidate (let ((candidates))
- (save-excursion
- (save-restriction
- (narrow-to-region (window-start) (window-end))
- (goto-char (point-min))
- (forward-line)
- (while (< (point) (point-max))
- (push (cons (point) (selected-window))
- candidates)
- (forward-line))))
- (setq avy-action #'identity)
- (avy--process (nreverse candidates)
- (avy--style-fn 'at-full)))))
+ (avy-keys (or (cdr (assq 'ivy-avy avy-keys-alist))
+ avy-keys))
+ (avy-style (or (cdr (assq 'ivy-avy
+ avy-styles-alist))
+ avy-style))
+ (candidate
+ (let ((candidates))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region
+ (window-start)
+ (window-end))
+ (goto-char (point-min))
+ (forward-line)
+ (while (< (point) (point-max))
+ (push
+ (cons (point)
+ (selected-window))
+ candidates)
+ (forward-line))))
+ (setq avy-action #'identity)
+ (avy--process
+ (nreverse candidates)
+ (avy--style-fn avy-style)))))
(ivy-set-index (- (line-number-at-pos candidate) 2))
(ivy--exhibit)
- (ivy-done)
- (ivy-call)))
+ (ivy-done)))
(defun ivy-sort-file-function-default (x y)
"Compare two files X and Y.
- [elpa] master 4ad797b 002/167: Improve "C-g" out of a long-running async process, (continued)
- [elpa] master 4ad797b 002/167: Improve "C-g" out of a long-running async process, Oleh Krehel, 2015/12/08
- [elpa] master 41b5850 005/167: ivy.el (ivy--regex-fuzzy): Add minibuffer highlighting, Oleh Krehel, 2015/12/08
- [elpa] master 19d2a40 004/167: Add flx sorting, Oleh Krehel, 2015/12/08
- [elpa] master 3146501 010/167: ivy.el (ivy-resume): Don't regexp-quote preselect, Oleh Krehel, 2015/12/08
- [elpa] master f04aec8 009/167: ivy-hydra.el: Bind "t" to toggle-truncate-lines, Oleh Krehel, 2015/12/08
- [elpa] master 82a317c 011/167: Make swiper compatible with visual-line-mode, Oleh Krehel, 2015/12/08
- [elpa] master 45b54e3 015/167: counsel.el (counsel--gg-count): Fix for "'" in query, Oleh Krehel, 2015/12/08
- [elpa] master 6bf3239 006/167: ivy.el (ivy-yank-word): Add only one space each time, Oleh Krehel, 2015/12/08
- [elpa] master 73e5799 012/167: Fix counsel-git-grep not updating to 0 candidates, Oleh Krehel, 2015/12/08
- [elpa] master dfb41d0 016/167: Implement ivy-avy, Oleh Krehel, 2015/12/08
- [elpa] master eda091b 017/167: Customize ivy-avy and fix compile warnings,
Oleh Krehel <=
- [elpa] master fa49a81 018/167: Fix "End of buffer" for swiper and visual-line-mode, Oleh Krehel, 2015/12/08
- [elpa] master 1714220 022/167: swiper.el (swiper-font-lock-ensure): Exclude help-mode, Oleh Krehel, 2015/12/08
- [elpa] master 6db3d54 024/167: ivy.el (ivy--insert-prompt): Use newlines instead of truncation, Oleh Krehel, 2015/12/08
- [elpa] master 1c1e6fc 008/167: ivy.el (ivy--reset-state): Less strict on :preselect, Oleh Krehel, 2015/12/08
- [elpa] master c89c167 007/167: Specify shell command for counsel-git-grep with prefix arg, Oleh Krehel, 2015/12/08
- [elpa] master ff077c6 013/167: counsel.el (counsel--gg-candidates): Use counsel-git-grep-cmd, Oleh Krehel, 2015/12/08
- [elpa] master cbaa811 014/167: Use forward-line instead of line-move if possible, Oleh Krehel, 2015/12/08
- [elpa] master 4e0c3f1 019/167: swiper-avy: show avy hints in minibuffer as well, Oleh Krehel, 2015/12/08
- [elpa] master 52c9565 020/167: swiper.el (swiper--candidates): Avoid line-move for large buffers, Oleh Krehel, 2015/12/08
- [elpa] master 47a220d 023/167: Support hash tables in ivy-read, Oleh Krehel, 2015/12/08