Function: actypes::link-to-ebut

actypes::link-to-ebut is an interactive and byte-compiled function defined in hactypes.el.

Signature

(actypes::link-to-ebut KEY &optional KEY-SRC)

Documentation

Perform explicit button action specified by KEY and optional KEY-SRC.

Interactively, KEY-SRC defaults to the current buffer's file name.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260815.958/hactypes.el
(defact link-to-ebut (key &optional key-src)
  "Perform explicit button action specified by KEY and optional KEY-SRC.
Interactively, KEY-SRC defaults to the current buffer's file name."
  (interactive
   (let (but-lbl
         but-file)
     (while (cond ((setq but-file
                         (read-file-name
                          "File of button to link to: " nil nil t))
                   (if (string-equal but-file "")
                       (progn (beep) t)))
                  ((not (file-readable-p but-file))
                   (message "(link-to-ebut): You cannot read `%s'."
                            but-file)
                   (beep) (sit-for 3))))
     (list (progn
             (find-file-noselect but-file)
             (while (string-equal "" (setq but-lbl
                                           (hargs:read-match
                                            "Button to link to: "
                                            (ebut:alist but-file)
                                            nil nil nil 'ebut)))
               (beep))
             (ebut:label-to-key but-lbl))
           but-file)))
  (let* ((key-src-buf-flag (or (bufferp key-src)
                               (and (stringp key-src) (get-buffer key-src))))
         (but (if key-src-buf-flag
                  (ebut:get key key-src)
                (ebut:get key nil key-src))))
    (if but
        (ebut:act but)
      (unless key-src-buf-flag
        (setq key-src (if key-src
                          (hpath:normalize key-src)
                        (hbut:get-key-src t))))
      (hypb:error "(link-to-ebut): No button `%s' in `%s'"
                  (ebut:key-to-label key)
                  key-src))))