Function: hmouse-alist-add-window-handlers

hmouse-alist-add-window-handlers is a byte-compiled function defined in hui-window.el.

Signature

(hmouse-alist-add-window-handlers)

Documentation

Add Smart Mouse Key drag actions to hmouse-alist.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-window.el
(defun hmouse-alist-add-window-handlers ()
  "Add Smart Mouse Key drag actions to `hmouse-alist'."
  (unless (assoc '(hmouse-inactive-minibuffer-p) hmouse-alist)
    (setq hmouse-alist
	  (append
	   '(
	     ((hmouse-drag-thing)
	      . ((hmouse-yank-region) . (hmouse-kill-and-yank-region)))
	     ((hmouse-drag-window-side)
	      . ((hmouse-resize-window-side) . (hmouse-resize-window-side)))
	     ;;
	     ;; Although Hyperbole can distinguish whether inter-window
	     ;; drags are between frames or not, having different behavior
	     ;; for those 2 cases could be confusing, so treat all
	     ;; modeline drags between windows the same and comment out
	     ;; this next clause.
	     ;;   Modeline drag between frames
	     ;;   ((and (hmouse-modeline-depress) (hmouse-drag-between-frames)) .
	     ;;    ((hmouse-clone-window-to-frame) . (hmouse-move-window-to-frame)))
	     ;;
	     ;; Drag from an item to display (not a Modeline) with release on a Modeline
	     ((and (setq hkey-value (and (not (hmouse-modeline-depress))
					 (hmouse-modeline-release)
					 (not (hmouse-modeline-click))))
		   (hmouse-at-item-p action-key-depress-window))
	      . ((hmouse-item-to-window t) . (hmouse-swap-buffers)))
	     ;; Drag from within a window (not a Modeline and not an item) with release on a Modeline
	     (hkey-value
	      . ((hmouse-buffer-to-window t) . (hmouse-swap-buffers)))
	     ;; Non-vertical Modeline drag between windows
	     ((and (hmouse-modeline-depress) (hmouse-drag-between-windows)
		   (not (hmouse-drag-vertically-within-emacs)))
	      . ((hmouse-buffer-to-window) . (hmouse-swap-buffers)))
	     ;; Modeline drag that ends outside of Emacs
	     ((and (hmouse-modeline-depress) (hmouse-drag-outside-all-windows))
	      . ((hycontrol-clone-window-to-new-frame)
		 . (hycontrol-window-to-new-frame)))
	     ;; Other Modeline click or drag
	     ((hmouse-modeline-depress)
	      . ((action-key-modeline) . (assist-key-modeline)))
	     ;; Drag between windows and on an item (buffer-name, file-name or Hyperbole button)
	     ((and (hmouse-drag-between-windows)
		   (hmouse-at-item-p (if assist-flag assist-key-depress-window
				       action-key-depress-window)))
	      . ((hmouse-drag-item-to-display) . (hmouse-drag-item-to-display)))
	     ;; Drag between windows not on an item
	     ((hmouse-drag-between-windows)
	      ;; Note that functions on next line use any region as button name
	      . ((hui:ibut-link-directly) . (hui:ebut-link-directly)))
	     ((hmouse-drag-region-active)
	      . ((hmouse-drag-not-allowed) . (hmouse-drag-not-allowed)))
	     ((setq hkey-value (hmouse-drag-horizontally))
	      . ((hmouse-horizontal-action-drag) . (hmouse-horizontal-assist-drag)))
	     ((hmouse-drag-vertically)
	      . ((hmouse-vertical-action-drag) . (hmouse-vertical-assist-drag)))
	     ((setq hkey-value (hmouse-drag-diagonally))
	      . ((call-interactively #'hywconfig-ring-save)
		 . (call-interactively #'hywconfig-yank-pop)))
	     ;; Window drag that ends outside of Emacs
	     ((hmouse-drag-outside-all-windows)
	      . ((or (hmouse-drag-item-to-display)
		     (hycontrol-clone-window-to-new-frame))
		 . (hycontrol-window-to-new-frame)))
	     ;; If click in the minibuffer when it is not active (blank),
	     ;; Action Key displays the Hyperbole minibuffer menu and
	     ;; the Assist Key popups the jump menu.
	     ((hmouse-inactive-minibuffer-p)
	      . ((funcall action-key-minibuffer-function)
		 . (funcall assist-key-minibuffer-function)))
	     ((and (boundp 'ivy-mode) ivy-mode
		   (minibuffer-window-active-p (selected-window)))
	      . ((ivy-mouse-done action-key-release-args)
		 . (ivy-mouse-dispatching-done assist-key-release-args)))
	     ;; Handle widgets in Custom-mode
	     ((eq major-mode 'Custom-mode)
	      . ((smart-custom) . (smart-custom-assist)))
	     ;;
	     ;; Now since this is not a drag and if there was an active
	     ;; region prior to when the Action or Assist Key was
	     ;; pressed, then store point at one end of the region into
	     ;; `hkey-value' and the string value of the region
	     ;; into `hkey-region' which is either yanked, or
	     ;; killed and yanked at the current point.
	     ((hmouse-prior-active-region)
	      . ((hmouse-yank-region) . (hmouse-kill-and-yank-region))))
	   hmouse-alist))))