Function: hkey-throw
hkey-throw is an autoloaded, interactive and byte-compiled function
defined in hmouse-drv.el.
Signature
(hkey-throw RELEASE-WINDOW &optional THROW-REGION-FLAG)
Documentation
Throw a thing to display in RELEASE-WINDOW.
Throw one of:
- the active (highlighted) region,
- a displayable item at point or
- the current buffer.
With optional prefix arg THROW-REGION-FLAG, throw the current region
even if not active. After the throw, the RELEASE-WINDOW becomes the
selected window.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hmouse-drv.el
;; Once the "display-until.el" library is added to Emacs, hkey-throw can be simplified to the following:
;;
;; (defun hkey-throw (release-window)
;; "Throw either a displayable item at point or the current buffer for display in RELEASE-WINDOW.
;; The selected window does not change."
;; (interactive
;; (list (let ((mode-line-text (concat " Ace - " (nth 2 (assq ?t aw-dispatch-alist)))))
;; (aw-select mode-line-text))))
;; (if (cadr (assq major-mode hmouse-drag-item-mode-forms))
;; ;; Throw the item at point
;; (let ((action-key-depress-window (selected-window))
;; (action-key-release-window release-window)
;; (action-key-depress-args))
;; (hmouse-item-to-window)
;; (select-window action-key-depress-window)
;; (display-window-until release-window))
;; ;; Throw the current buffer
;; (display-window-until release-window (current-buffer))))
;;;###autoload
(defun hkey-throw (release-window &optional throw-region-flag)
"Throw a thing to display in RELEASE-WINDOW.
Throw one of:
- the active (highlighted) region,
- a displayable item at point or
- the current buffer.
With optional prefix arg THROW-REGION-FLAG, throw the current region
even if not active. After the throw, the RELEASE-WINDOW becomes the
selected window."
(interactive (list (ace-window nil) current-prefix-arg))
(let ((depress-frame (selected-frame))
(display-delay (if (boundp 'temp-display-delay)
temp-display-delay
0.5)))
;; Throw either the region or the item at point and keep selected-window
(let ((action-key-depress-window (selected-window))
(action-key-release-window release-window)
(action-key-depress-args))
(unless (hkey-insert-region action-key-depress-window release-window throw-region-flag display-delay)
(if (cadr (assq major-mode hmouse-drag-item-mode-forms))
(hmouse-item-to-window)
(set-window-buffer release-window (current-buffer))))
(unless (eq depress-frame (window-frame release-window))
;; Force redisplay or item buffer won't be displayed here.
(redisplay t)
;; Show the frame thrown to before it is covered when
;; input-focus is returned to the depress-frame.
(raise-frame (window-frame release-window))
(select-frame-set-input-focus (window-frame release-window))
;; Don't use sit-for here because it can be interrupted early.
(sleep-for display-delay))
(select-window release-window))))