[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 520ecae 19/25: Fix improper registering of a
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole 520ecae 19/25: Fix improper registering of a drag outside of Emacs when none |
Date: |
Tue, 22 Sep 2020 10:29:29 -0400 (EDT) |
branch: externals/hyperbole
commit 520ecae64af21b7969a82db910cc6eac7a0e8974
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Fix improper registering of a drag outside of Emacs when none
---
Changes | 14 +++++++++++
hib-kbd.el | 2 +-
hmouse-drv.el | 78 ++++++++++++++++++++++++++++++++---------------------------
3 files changed, 57 insertions(+), 37 deletions(-)
diff --git a/Changes b/Changes
index eaa0dba..dfb9067 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,17 @@
+2020-08-01 Bob Weiner <rsw@gnu.org>
+
+* hmouse-drv.el (hkey-help): Fixed to not show 'OR' before first 'CALL' listing
+ and to only display Action/Assist Mouse Button contexts when last use was
+ ia mouse button and not keyboard. Also, displayed whether showing mouse or
+ keyboard help.
+
+* hmouse-drv.el (hmouse-key-release-window): Required position of last
action/assist
+ mouse key release event. This fixed the problem of improperly
registering a
+ drag to outside of an emacs frame because
action/assist-key-release-window was not
+ set properly.
+ (hmouse-function): Sent action/assist-key-release-position as
argument
+ to hmouse-key-release-window call.
+
2020-07-29 Bob Weiner <rsw@gnu.org>
* man/hkey-help.txt: Added magit modes.
diff --git a/hib-kbd.el b/hib-kbd.el
index a75706f..02f5503 100644
--- a/hib-kbd.el
+++ b/hib-kbd.el
@@ -256,7 +256,7 @@ keyboad input queue, as if they had been typed by the user."
;;; ************************************************************************
(defun kbd-key:binding (key-series)
- "Return any existing key binding for KEY-SERIES or nil."
+ "Return key binding for KEY-SERIES if it is a single key sequence or nil."
;; This custom function is used to prevent the (kbd) call from
;; mistakenly removing angle brackets from Hyperbole implicit button
;; names, like: <[td]>.
diff --git a/hmouse-drv.el b/hmouse-drv.el
index c168d2e..e7109f8 100644
--- a/hmouse-drv.el
+++ b/hmouse-drv.el
@@ -190,7 +190,7 @@ EVENT will be passed to 'hmouse-function'."
(apply #'action-mouse-key (hmouse-key-release-args-emacs event)))
(defun assist-mouse-key-emacs (event)
- "Set point to the current mouse cursor position and execute 'action-key'.
+ "Set point to the current mouse cursor position and execute 'assist-key'.
EVENT will be passed to 'hmouse-function'."
(interactive "e")
(apply #'assist-mouse-key (hmouse-key-release-args-emacs event)))
@@ -829,15 +829,16 @@ Return non-nil iff a non-nil predicate is found."
(defun hkey-help (&optional assist-flag)
"Display help for the Action Key command in current context.
-With optional ASSIST-FLAG non-nil, display help for the Assist Key command.
+With optional ASSIST-FLAG prefix arg non-nil, display help for the Assist Key
command.
Return non-nil iff associated help documentation is found."
(interactive "P")
- (unless (or action-key-depressed-flag action-key-help-flag)
- (action-key-clear-variables))
- (unless (or assist-key-depressed-flag assist-key-help-flag)
- (assist-key-clear-variables))
- (let ((hkey-forms hmouse-alist)
- hkey-form pred-value call calls cmd-sym doc)
+ (let* ((mouse-flag (or action-key-depress-position
assist-key-depress-position))
+ (hkey-forms (if mouse-flag hmouse-alist hkey-alist))
+ hkey-form pred-value call calls cmd-sym doc)
+ (unless (or action-key-depressed-flag action-key-help-flag)
+ (action-key-clear-variables))
+ (unless (or assist-key-depressed-flag assist-key-help-flag)
+ (assist-key-clear-variables))
(while (and (null pred-value) (setq hkey-form (car hkey-forms)))
(or (setq pred-value (eval (car hkey-form)))
(setq hkey-forms (cdr hkey-forms))))
@@ -863,39 +864,44 @@ Return non-nil iff associated help documentation is
found."
(progn
(let* ((condition (car hkey-form))
(temp-buffer-show-hook
- (lambda (buf)
- (set-buffer buf)
- (help-mode)
- (let ((owind (selected-window)))
- (if (br-in-browser)
- (save-excursion
- (br-to-view-window)
- (select-window (previous-window))
- (display-buffer buf 'other-win))
- (display-buffer buf 'other-win))
- (if (or (and (boundp 'help-window-select)
- help-window-select)
- (and (boundp 'help-selects-help-window)
- help-selects-help-window))
- (select-window (get-buffer-window buf))
- (select-window owind)))))
+ (lambda (buf)
+ (set-buffer buf)
+ (help-mode)
+ (let ((owind (selected-window)))
+ (if (br-in-browser)
+ (save-excursion
+ (br-to-view-window)
+ (select-window (previous-window))
+ (display-buffer buf 'other-win))
+ (display-buffer buf 'other-win))
+ (if (or (and (boundp 'help-window-select)
+ help-window-select)
+ (and (boundp 'help-selects-help-window)
+ help-selects-help-window))
+ (select-window (get-buffer-window buf))
+ (select-window owind)))))
(temp-buffer-show-function temp-buffer-show-hook))
(with-output-to-temp-buffer
(hypb:help-buf-name
- (format "%s Key" (if assist-flag "Assist" "Action")))
- (princ (format "A click of the %s Key"
- (if assist-flag "Assist" "Action")))
+ (format "%s %s"
+ (if assist-flag "Assist" "Action")
+ (if mouse-flag "Mouse Button" "Key")))
+ (princ (format "A %s of the %s %s"
+ (if mouse-flag "click" "press")
+ (if assist-flag "Assist" "Action")
+ (if mouse-flag "Mouse Button" "Key")))
(terpri)
(princ "WHEN ")
(princ
- (or condition
- "there is no matching context"))
+ (or condition
+ "there is no matching context"))
(terpri)
(mapc (lambda (c)
- (if (> (length calls) 1)
+ (when (and (> (length calls) 1)
+ (not (eq (car calls) c)))
;; Is an 'or' set of calls
- (princ "'OR' "))
+ (princ "OR "))
(princ "CALLS ") (princ (if (consp c) c (list c)))
(when (and (fboundp (setq call (if (consp c) (car
c) c)))
(setq doc (documentation call)))
@@ -1273,9 +1279,9 @@ window, return nil. Considers all windows on the
selected frame's display."
pos-x pos-y))
(when edges (list window (cons pos-x pos-y)))))
-(defun hmouse-key-release-window ()
- "Return the window of the current mouse position if any, else nil."
- (ignore-errors (hmouse-window-at-absolute-pixel-position nil t)))
+(defun hmouse-key-release-window (release-position)
+ "Return the Emacs window of last Action/Assist Mouse Key RELEASE-POSITION if
any, else nil."
+ (ignore-errors (hmouse-window-at-absolute-pixel-position release-position
t)))
(defun hmouse-key-release-args-emacs (event)
"For GNU Emacs, return a possibly modified version of EVENT as a list.
@@ -1385,9 +1391,9 @@ SET-POINT-ARG-LIST is passed to the call of the command
bound to
is not bound to a valid function."
(when (fboundp hmouse-set-point-command)
(if assist-flag
- (setq assist-key-release-window (hmouse-key-release-window)
+ (setq assist-key-release-window (hmouse-key-release-window
assist-key-release-position)
assist-key-release-prev-point (point-marker))
- (setq action-key-release-window (hmouse-key-release-window)
+ (setq action-key-release-window (hmouse-key-release-window
action-key-release-position)
action-key-release-prev-point (point-marker)))
(and (eq major-mode 'br-mode)
(setq action-mouse-key-prev-window
- [elpa] externals/hyperbole af73116 07/25: hib-kbd.el: Recognize helm-M-x or counsel-M-x bound to M-x, (continued)
- [elpa] externals/hyperbole af73116 07/25: hib-kbd.el: Recognize helm-M-x or counsel-M-x bound to M-x, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 82653d5 06/25: hib-kbd.el: Recognize helm-M-x or counsel-M-x bound to M-x, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 09032d9 13/25: Disable minibuffer-completion-confirm while processing key series, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 74922d1 14/25: Merge Mats dired-sidebar support and rsw mods, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 7eae539 05/25: (hui:ibut-label-create): Skip back past opening delimiter, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 1cf5f3d 16/25: Allow Action Key to expand a tree when point is on the ellipsis, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 9e13b43 02/25: hui-select.el and hyperbole.el reformatting; no logic changes, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 42487cb 09/25: Temporarily disable helm-mode when executing a key series, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole f633365 17/25: Normalize committer email addresses, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 8ef773d 18/25: Add Action/Assist key support for magit modes, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 520ecae 19/25: Fix improper registering of a drag outside of Emacs when none,
Stefan Monnier <=
- [elpa] externals/hyperbole 008182b 22/25: Fixes, Helm and Magit Smart Key support doc in prep. for 7.1.3, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 6f36320 08/25: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 97a4d80 10/25: Raise org-mode ibtype priority to near top; fix markdown # link activation, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 734c6a8 11/25: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 335441d 15/25: Fix that Action Key did not expand collapsed Koutline trees, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 845119a 24/25: hib-social.el - Rename to hibtypes-git-use-magit-flag; make first ebut in file work without saving, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole d65920b 25/25: V7.1.3 - Improve key series, mouse handling and, Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 3c0df00 12/25: Add support for dired-sidebar (#33), Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole 21b2b1c 20/25: Use magit if available for git social button (#32), Stefan Monnier, 2020/09/22
- [elpa] externals/hyperbole b8fd1e8 23/25: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2020/09/22