Function: actypes::link-to-doc

actypes::link-to-doc is an interactive and byte-compiled function defined in hib-doc-id.el.

Signature

(actypes::link-to-doc DOC-ID)

Documentation

Display an online version of a document given by DOC-ID (no delimiters).

If online version of document is not found in doc-id-indices, signal an error.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hib-doc-id.el
;;; ************************************************************************
;;; Public implicit button types
;;; ************************************************************************

;;; ========================================================================
;;; Displays a documentation index entry given an ID.
;;; ========================================================================

(defact link-to-doc (doc-id)
  "Display an online version of a document given by DOC-ID (no delimiters).
If online version of document is not found in `doc-id-indices', signal
an error."
  (interactive "sID for document to link to (omit delimiters): ")
  (let ((hyrolo-display-buffer (hypb:help-buf-name "Doc ID"))
	(delim-doc-id (concat doc-id-start doc-id doc-id-end)))
    (cond ((null doc-id-indices)
	   (error "(doc-id-index-entry): You must set the `doc-id-indices' variable first"))
	  ((let ((hyrolo-hdr-and-entry-regexp doc-id-index-entry-regexp))
	     (zerop (hyrolo-grep (funcall doc-id-match doc-id)
				 1 doc-id-indices nil nil 'no-display)))
	   (error "(doc-id-index-entry): %s not found in document index"
		  delim-doc-id))
	  ;; Matching index entry has been put into `hyrolo-display-buffer'.
	  (t (with-current-buffer hyrolo-display-buffer
	       (goto-char (point-min))
	       (message "Searching for document %s..." delim-doc-id)
	       (if (re-search-forward doc-id-online-regexp nil t)
		   (progn
		     (goto-char (match-beginning 1))
		     (let ((doc-path (match-string 1))
			   (ibut (ibut:at-p)))
		       (if ibut
			   (progn (hbut:act ibut)
				  (message "Displaying %s." delim-doc-id))
			 (error
			  "(link-to-doc): %s online location is invalid: \"%s\""
			  delim-doc-id doc-path))))
		 (error "(link-to-doc): %s is unavailable in online form"
			delim-doc-id)))))))