[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a0ce6a7 050/110: Add avy-mouse-event-window and fix typo
From: |
Oleh Krehel |
Subject: |
[elpa] master a0ce6a7 050/110: Add avy-mouse-event-window and fix typo |
Date: |
Sat, 11 May 2019 10:15:41 -0400 (EDT) |
branch: master
commit a0ce6a7558e48b2ae150042a3e3cd559ba26152c
Author: Bob Weiner <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add avy-mouse-event-window and fix typo
Fixes #226
---
avy.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/avy.el b/avy.el
index 877e6b4..c03bb61 100644
--- a/avy.el
+++ b/avy.el
@@ -434,6 +434,16 @@ KEYS is the path from the root of `avy-tree' to LEAF."
(defvar avy-current-path ""
"Store the current incomplete path during `avy-read'.")
+(defun avy-mouse-event-window (char)
+ "If CHAR is a mouse event, return the window of the event if any or the
selected window.
+Return nil if not a mouse event."
+ (when (mouse-event-p char)
+ (cond ((windowp (posn-window (event-start char)))
+ (posn-window (event-start char)))
+ ((framep (posn-window (event-start char)))
+ (frame-selected-window (posn-window (event-start char))))
+ (t (selected-window)))))
+
(defun avy-read (tree display-fn cleanup-fn)
"Select a leaf from TREE using consecutive `read-char'.
@@ -442,7 +452,7 @@ associated with CHAR will be selected if CHAR is pressed.
This is
commonly done by adding a CHAR overlay at LEAF position.
CLEANUP-FN should take no arguments and remove the effects of
-multiple DISPLAY-FN invokations."
+multiple DISPLAY-FN invocations."
(catch 'done
(setq avy-current-path "")
(while tree
- [elpa] master d4aa876 063/110: Note that change to store full avy path is for external packages, (continued)
- [elpa] master d4aa876 063/110: Note that change to store full avy path is for external packages, Oleh Krehel, 2019/05/11
- [elpa] master 793a5e2 061/110: avy.el (avy-action-teleport): Add save-excursion, Oleh Krehel, 2019/05/11
- [elpa] master 08370cd 069/110: Add option to limit avy-goto-subword-0 scope, Oleh Krehel, 2019/05/11
- [elpa] master 2d613eb 068/110: avy.el (avy-action-zap-to-char): Add and bind to "z", Oleh Krehel, 2019/05/11
- [elpa] master 869261a 064/110: Display actual character that triggered an error, Oleh Krehel, 2019/05/11
- [elpa] master 78392e6 058/110: avy.el (avy-action-teleport): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master 7f83bbc 059/110: avy.el (avy-action-ispell): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master a25b255 057/110: avy.el (avy-action-yank): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master 631214d 060/110: Correct spelling mistake, Oleh Krehel, 2019/05/11
- [elpa] master ddf3c58 052/110: avy.el (avy-handler-default): Fix typo, Oleh Krehel, 2019/05/11
- [elpa] master a0ce6a7 050/110: Add avy-mouse-event-window and fix typo,
Oleh Krehel <=
- [elpa] master 9489ca9 062/110: Add window selection via mouse button press and fix typo, Oleh Krehel, 2019/05/11
- [elpa] master 1b9f061 055/110: avy.el (avy-action-kill-stay): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master dee0284 056/110: avy.el (avy-action-kill-move): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master 56f6590 054/110: avy.el (avy-action-copy): Adjust for avy-goto-line, Oleh Krehel, 2019/05/11
- [elpa] master c08fc7c 049/110: Add option to match newline in avy-goto-char-timer, Oleh Krehel, 2019/05/11
- [elpa] master 245b5d6 046/110: avy.el: Fix compile warnings, Oleh Krehel, 2019/05/11
- [elpa] master 0ed6408 043/110: avy.el: Fix checkdoc warnings, Oleh Krehel, 2019/05/11
- [elpa] master 36f768d 047/110: avy.el (avy-words): Specify custom type, Oleh Krehel, 2019/05/11
- [elpa] master 9103291 048/110: Update description to be easier to understand., Oleh Krehel, 2019/05/11
- [elpa] master f4c45d3 044/110: avy.el: Add org-mode commands for jumping to and refiling headings, Oleh Krehel, 2019/05/11