Function: smart-helm-assist

smart-helm-assist is a byte-compiled function defined in hui-mouse.el.

Signature

(smart-helm-assist)

Documentation

Execute helm actions based on Assist Key click locations.

Locations are:
- At the end of the buffer, quits from helm and exits the minibuffer.
- On a candidate line, display's the candidate's first action and
  remains in the minibuffer;
- On the top, fixed header line, toggles display of the selected
  candidate's possible actions;
- On an action list line, performs the action after exiting the minibuffer;
- On a source section header, moves to the previous source
  section or last if on first.
- On a candidate separator line, does nothing.
- In the minibuffer window, ends the helm session and performs
  the selected item's action.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-mouse.el
(defun smart-helm-assist()
  "Execute helm actions based on Assist Key click locations.
Locations are:
- At the end of the buffer, quits from helm and exits the minibuffer.
- On a candidate line, display's the candidate's first action and
  remains in the minibuffer;
- On the top, fixed header line, toggles display of the selected
  candidate's possible actions;
- On an action list line, performs the action after exiting the minibuffer;
- On a source section header, moves to the previous source
  section or last if on first.
- On a candidate separator line, does nothing.
- In the minibuffer window, ends the helm session and performs
  the selected item's action."
  ;; Hyperbole has checked that this line has an action prior to
  ;; invoking this function.
  (unless (hmouse-check-assist-key)
    (error "(smart-helm-assist): Hyperbole Assist Mouse Key - either depress or release event is improperly configured"))
  (let* ((non-text-area-p (and (eventp assist-key-depress-args)
			       (posn-area (event-start assist-key-depress-args))))
	 (at-plist (smart-helm-at assist-key-depress-args))
	 (section-hdr (plist-get at-plist 'section-header))
	 (separator (plist-get at-plist 'separator))
	 (eob (plist-get at-plist 'eob))
	 (eol (plist-get at-plist 'eol))
	 (key))
    (unwind-protect
	(smart-helm-resume-helm)
      ;; Handle end-of-line clicks.
      (cond ((and eol (not eob) (not non-text-area-p))
	     (with-helm-buffer (funcall assist-key-eol-function)))
	    ((and (smart-helm-alive-p) (not separator))
	     (setq key (cond
			;; Exit
			(eob "C-g")
			;; Move to previous source section or last if on last.
			(section-hdr "M-o")
			;; If line of the key press is the first /
			;; header line in the window or outside the
			;; buffer area, then use {TAB} command to
			;; switch between match list and action list.
			(non-text-area-p "TAB")
			;; Display action for the current line and
			;; return nil.
			(t (with-help-window "*Helm Help*"
			     (let ((helm-buffer (if (equal helm-action-buffer (buffer-name))
						    helm-buffer (buffer-name))))
			       (with-helm-buffer
				 (princ "The current helm selection item is:\n\t")
				 (princ (helm-get-selection (helm-buffer-get)))
				 (princ "\nwith an action of:\n\t")
				 (princ (smart-helm-get-current-action)))
			       nil)))))
	     (if hkey-debug
		 (message "(HyDebug): In smart-helm-assist, key to execute is: {%s}; binding is: %s"
			  (if key (key-description key) "Help")
			  (if key (key-binding key) "None")))))
      (smart-helm-to-minibuffer))
    (if key (call-interactively (key-binding (kbd key))))))