Function: hywiki-add-path-link

hywiki-add-path-link is an interactive and byte-compiled function defined in hywiki.el.

Signature

(hywiki-add-path-link WIKIWORD &optional FILE POS)

Documentation

Set a path link anchored possible position for WIKIWORD and return it.

If WIKIWORD is invalid, trigger a user-error if called interactively or return nil if not.

Interactively prompt for the file and whether to use the current position if a buffer is visiting the file; non-interactively, you may optionally provide the FILE and POS arguments.

After successfully adding the path link, run hywiki-add-referent-hook.

Use hywiki-get-referent to determine whether WIKIWORD exists prior to calling this function.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-add-path-link (wikiword &optional file pos)
  "Set a path link anchored possible position for WIKIWORD and return it.
If WIKIWORD is invalid, trigger a `user-error' if called interactively
or return nil if not.

Interactively prompt for the file and whether to use the current
position if a buffer is visiting the file; non-interactively, you may
optionally provide the FILE and POS arguments.

After successfully adding the path link, run `hywiki-add-referent-hook'.

Use `hywiki-get-referent' to determine whether WIKIWORD exists prior to
calling this function."
  (interactive (list (or (hywiki-word-at)
			 (hywiki-word-read-new "Add/Edit HyWikiWord: "))))
  (let* ((path-args (if (and file pos)
			(list file pos)
		      (hactypes:link-to-file-interactively)))
	 (path-link (and (= (length path-args) 2)
			 (hpath:file-position-to-line-and-column
			  (car path-args) (cadr path-args)))))
    (when path-link
      (hywiki-add-referent wikiword (cons 'path-link path-link)))))