Function: smart-helm
smart-helm is a byte-compiled function defined in hui-mouse.el.
Signature
(smart-helm)
Documentation
Execute helm actions based on Action Key click locations.
Locations are:
- At the end of the buffer, quits from helm and exits the minibuffer.
- On a candidate line, performs 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 next source section or
first if on last.
- 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()
"Execute helm actions based on Action Key click locations.
Locations are:
- At the end of the buffer, quits from helm and exits the minibuffer.
- On a candidate line, performs 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 next source section or
first if on last.
- On a candidate separator line, does nothing.
- In the minibuffer window, ends the helm session and performs
the selected item's action."
(unless (hmouse-check-action-key)
(error "(smart-helm): Hyperbole Action Mouse Key - either depress or release event is improperly configured"))
(let* ((non-text-area-p (and (eventp action-key-depress-args)
(posn-area (event-start action-key-depress-args))))
(at-plist (smart-helm-at action-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)))
(smart-helm-resume-helm)
;; Handle end-of-line clicks.
(if (and eol (not eob) (not non-text-area-p))
(progn (with-helm-buffer (funcall action-key-eol-function))
(smart-helm-to-minibuffer))
(smart-helm-to-minibuffer)
(when (and (smart-helm-alive-p) (not separator))
(let* ((key (kbd (cond
;; Exit
(eob "C-g")
;; Move to next source section or first if on last.
(section-hdr "C-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")
;; RET: Performs action of selection and exits the minibuffer.
;; C-j: Performs action of selection and stays in minibuffer.
(hkey-value
(if (helm-action-window) "RET" "C-j"))
(t "RET"))))
(binding (key-binding key)))
(if hkey-debug
(message "(HyDebug): In smart-helm, key to execute is: {%s}; binding is: %s"
(key-description key) binding))
(call-interactively binding))))))