[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 909483e 090/110: avy.el (avy--process): Make `overlay-fn'
From: |
Oleh Krehel |
Subject: |
[elpa] master 909483e 090/110: avy.el (avy--process): Make `overlay-fn' arg optional |
Date: |
Sat, 11 May 2019 10:15:51 -0400 (EDT) |
branch: master
commit 909483e104a2decf69d27fba8662100c57353fe4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy--process): Make `overlay-fn' arg optional
---
avy.el | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/avy.el b/avy.el
index f5110fd..eb48403 100644
--- a/avy.el
+++ b/avy.el
@@ -787,9 +787,10 @@ Set `avy-style' according to COMMMAND as well."
#'avy--remove-leading-chars))))
(avy--done))))))
-(defun avy--process (candidates overlay-fn)
+(defun avy--process (candidates &optional overlay-fn)
"Select one of CANDIDATES using `avy-read'.
Use OVERLAY-FN to visualize the decision overlay."
+ (setq overlay-fn (or overlay-fn (avy--style-fn avy-style)))
(unless (and (consp (car candidates))
(windowp (cdar candidates)))
(setq candidates
@@ -1155,6 +1156,7 @@ exist."
(post #'avy--overlay-post)
(de-bruijn #'avy--overlay-at-full)
(words #'avy--overlay-at-full)
+ (ignore #'ignore)
(t (error "Unexpected style %S" style))))
(defun avy--generic-jump (regex window-flip &optional beg end)
@@ -1168,8 +1170,7 @@ BEG and END narrow the scope where candidates are
searched."
(not avy-all-windows)
avy-all-windows)))
(avy--process
- (avy--regex-candidates regex beg end)
- (avy--style-fn style))))
+ (avy--regex-candidates regex beg end))))
;;* Commands
;;;###autoload
@@ -1255,8 +1256,7 @@ When ARG is non-nil, do the opposite of
`avy-all-windows'."
(avy--process
(avy--regex-candidates (if isearch-regexp
isearch-string
- (regexp-quote isearch-string)))
- (avy--style-fn avy-style))
+ (regexp-quote isearch-string))))
(isearch-done))))
;;;###autoload
@@ -1413,7 +1413,7 @@ BEG and END narrow the scope where candidates are
searched."
(not (get-char-property (point) 'invisible))
(push (cons (point) (selected-window)) window-cands)))
(setq candidates (nconc candidates window-cands))))))
- (avy--process candidates (avy--style-fn avy-style)))))
+ (avy--process candidates))))
;;;###autoload
(defun avy-goto-subword-1 (char &optional arg)
@@ -1566,13 +1566,14 @@ The window scope is determined by `avy-all-windows'.
When ARG is non-nil, do the opposite of `avy-all-windows'.
BEG and END narrow the scope where candidates are searched.
When BOTTOM-UP is non-nil, display avy candidates from top to bottom"
- (let ((avy-action #'identity))
+ (let ((avy-action #'identity)
+ (avy-style (if avy-linum-mode
+ (progn
+ (message "Goto line:")
+ 'ignore)
+ avy-style)))
(avy--process
- (avy--line-cands arg beg end bottom-up)
- (if avy-linum-mode
- (progn (message "Goto line:")
- 'ignore)
- (avy--style-fn avy-style)))))
+ (avy--line-cands arg beg end bottom-up))))
;;;###autoload
(defun avy-goto-line (&optional arg)
@@ -1978,8 +1979,7 @@ The window scope is determined by `avy-all-windows' (ARG
negates it)."
avy-all-windows)))
(avy-with avy-goto-char-timer
(avy--process
- (avy--read-candidates)
- (avy--style-fn avy-style)))))
+ (avy--read-candidates)))))
(defun avy-push-mark ()
"Store the current point and window."
@@ -2047,8 +2047,7 @@ The window scope is determined by `avy-all-windows' (ARG
negates it)."
(avy--process
(avy--read-candidates
(lambda (input)
- (format "^\\*+ .*\\(%s\\)" input)))
- (avy--style-fn avy-style))
+ (format "^\\*+ .*\\(%s\\)" input))))
(org-back-to-heading))))
(provide 'avy)
- [elpa] master 9a15d1f 103/110: avy.el (avy-show-dispatch-help): Add and bind to "?", (continued)
- [elpa] master 9a15d1f 103/110: avy.el (avy-show-dispatch-help): Add and bind to "?", Oleh Krehel, 2019/05/11
- [elpa] master 74501e1 094/110: avy.el: More fixes to org-toggle-link-display, Oleh Krehel, 2019/05/11
- [elpa] master 8db2759 099/110: Change avy--process to accept cleanup function, Oleh Krehel, 2019/05/11
- [elpa] master 7d73cee 100/110: avy.el: Use avy-process instead of avy--process, Oleh Krehel, 2019/05/11
- [elpa] master fd0101e 101/110: avy.el (avy-push-mark): Turn off message, Oleh Krehel, 2019/05/11
- [elpa] master e802510 098/110: avy.el (avy-jump): New API, don't use avy--generic-jump, Oleh Krehel, 2019/05/11
- [elpa] master 7cfe11e 074/110: Added ability to display avy candidates from bottom to top, Oleh Krehel, 2019/05/11
- [elpa] master 8606a89 072/110: avy.el (avy--process): Remove redundant copy-sequence, Oleh Krehel, 2019/05/11
- [elpa] master 002b8f3 091/110: avy.el (avy--visible-p): Add to fix org-toggle-link-display, Oleh Krehel, 2019/05/11
- [elpa] master 16482e0 089/110: avy.el (avy--generic-jump): Remove `style' arg, Oleh Krehel, 2019/05/11
- [elpa] master 909483e 090/110: avy.el (avy--process): Make `overlay-fn' arg optional,
Oleh Krehel <=
- [elpa] master 24b5137 087/110: Ignore mistyping when no candidates available, Oleh Krehel, 2019/05/11
- [elpa] master c4e2d50 077/110: avy.el: avy-goto-char will now display shortest overlays for cands near point, Oleh Krehel, 2019/05/11
- [elpa] master 1de6233 076/110: Add avy-goto-end-of-line, Oleh Krehel, 2019/05/11
- [elpa] master c2e2a4a 083/110: avy.el (avy--read-candidates): Custom keys for deleting last read char, Oleh Krehel, 2019/05/11
- [elpa] master 4f1b8a1 086/110: avy.el: Fix compiler warnings, Oleh Krehel, 2019/05/11
- [elpa] master e7c0fc0 088/110: avy.el (avy-pre-action): New defvar, Oleh Krehel, 2019/05/11
- [elpa] master bcc0cb0 085/110: avy.el (avy-org-refile-as-child): Don't refile when avy aborted, Oleh Krehel, 2019/05/11
- [elpa] master 6331b7a 071/110: avy.el (avy--process): Fix avy-goto-line for empty buffer, Oleh Krehel, 2019/05/11
- [elpa] master fd7b929 078/110: Add option to display an indented goto line overlay, Oleh Krehel, 2019/05/11
- [elpa] master 70e384a 073/110: avy.el (avy--process-1): Extract, Oleh Krehel, 2019/05/11