Function: hywiki-get-existing-page-file
hywiki-get-existing-page-file is a byte-compiled function defined in
hywiki.el.
Signature
(hywiki-get-existing-page-file FILE-STEM-NAME)
Documentation
Return existing hywiki-directory path from FILE-STEM-NAME or nil.
FILE-STEM-NAME should not contain a directory and may have or may omit
hywiki-file-suffix and an optional trailing #section.
Checks only that FILE-STEM-NAME is not nil, not an empty string and does not contain a directory path or returns nil.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-get-existing-page-file (file-stem-name)
"Return existing `hywiki-directory' path from FILE-STEM-NAME or nil.
FILE-STEM-NAME should not contain a directory and may have or may omit
`hywiki-file-suffix' and an optional trailing #section.
Checks only that FILE-STEM-NAME is not nil, not an empty string and does
not contain a directory path or returns nil."
(make-directory hywiki-directory t)
(unless (or (null file-stem-name) (string-empty-p file-stem-name)
(file-name-directory file-stem-name))
(let (file-name
referent
section)
;; Remove any suffix from `file-stem-name' and make it singular
(if (string-match hywiki-word-suffix-regexp file-stem-name)
(setq section (match-string 0 file-stem-name)
file-name (hywiki-get-singular-wikiword
(substring file-stem-name 0 (match-beginning 0))))
(setq file-name file-stem-name))
(setq referent (hywiki-get-referent file-name))
(when (and (eq (car referent) 'page)
;; The referent replaces the page name with name.org, so can be next.
(setq file-name (expand-file-name (cdr referent) hywiki-directory))
(file-exists-p file-name))
(concat file-name section)))))