Function: doc-id:help

doc-id:help is a byte-compiled function defined in hib-doc-id.el.

Signature

(doc-id:help BUT)

Documentation

Display site-specific document index entry given by doc-id BUT.

Also display standard Hyperbole help for implicit button BUT.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hib-doc-id.el
;;; ************************************************************************
;;; Private functions
;;; ************************************************************************

(defun doc-id:help (but)
  "Display site-specific document index entry given by doc-id BUT.
Also display standard Hyperbole help for implicit button BUT."
  (let ((hyrolo-hdr-and-entry-regexp doc-id-index-entry-regexp)
	(hyrolo-display-buffer (hypb:help-buf-name "Doc ID"))
	(doc-id (hbut:key-to-label (hattr:get but 'lbl-key))))
    (cond ((null doc-id-indices)
	   (error "(doc-id-index-entry): You must set the `doc-id-indices' variable first"))
	  ((zerop (hyrolo-grep (funcall doc-id-match doc-id) 1 doc-id-indices
			       nil nil 'no-display))
	   (error
	     "(doc-id-index-entry): No document index entry found for %s%s%s"
		  doc-id-start doc-id doc-id-end)))
    (let* ((report-buf (hypb:help-buf-name))
	   (temp-buffer-show-hook
	    (lambda (buffer)
	      (setq hkey--wconfig (current-window-configuration))
	      (let ((wind (get-buffer-create buffer)))
		(setq minibuffer-scroll-window wind))))
	   (temp-buffer-show-function temp-buffer-show-hook))
      (hbut:report but)
      (with-current-buffer hyrolo-display-buffer
	(setq buffer-read-only nil)
	(goto-char (point-max))
	(insert-buffer-substring report-buf)
	(set-buffer-modified-p nil)
	(setq buffer-read-only nil)
	(goto-char (point-min)))
      (kill-buffer report-buf))))