Function: actypes::link-to-texinfo-node

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

Signature

(actypes::link-to-texinfo-node FILE NODE-OR-ANCHOR)

Documentation

Display the Texinfo FILE and NODE-OR-ANCHOR (a string).

FILE may be a string or nil, in which case the current buffer is used.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hactypes.el
(defact link-to-texinfo-node (file node-or-anchor)
  "Display the Texinfo FILE and NODE-OR-ANCHOR (a string).
FILE may be a string or nil, in which case the current buffer is used."
  (interactive "fTexinfo file to link to: \nsNode or anchor within file to link to: ")
  (if (stringp node-or-anchor)
      ;; Remove any tabs or newlines that might be in node-or-anchor name.
      (setq node-or-anchor (replace-regexp-in-string "[ \t\n\r\f]+" " " (string-trim node-or-anchor) t t))
    (setq node-or-anchor "Top"))
  (let (node-point)
    (when (equal file "hyperbole.texi")
      (setq file (expand-file-name file (hpath:expand "${hyperb:dir}/man/"))))
    (if file
        (set-buffer (find-file-noselect (hpath:substitute-value file)))
      (setq file (hypb:buffer-file-name)))
    (save-excursion
      (goto-char (point-min))
      (cond ((or (re-search-forward (format "^@node[ \t]+%s *[,\n\r]" node-or-anchor) nil t)
                 (re-search-forward (format "^@anchor{%s}" node-or-anchor) nil t))
	      (setq node-point (match-beginning 0)))
	    (t (hypb:error "(link-to-texinfo-node): Non-existent location: \"%s%s\""
                           (if file
                               (format "(%s)" (file-name-nondirectory file))
                             "")
                           node-or-anchor))))
    (if file
        (hact 'link-to-file file node-point)
      (hypb:error "(link-to-texinfo-node): Non-existent location: \"%s\""
		  node-or-anchor))))