Function: hsys-denote-file-at-p
hsys-denote-file-at-p is a byte-compiled function defined in
hsys-denote.el.
Signature
(hsys-denote-file-at-p)
Documentation
In a denote file or on a dired denote filename, return a link to it, else nil.
If in the file, add any section that point is within, plus relative line and column number.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hsys-denote.el
(defun hsys-denote-file-at-p ()
"In a denote file or on a dired denote filename, return a link to it, else nil.
If in the file, add any section that point is within, plus relative line and
column number."
(when (require 'denote nil t)
(let ((file (or buffer-file-name
(and (derived-mode-p 'dired-mode)
(dired-get-filename nil t)))))
(when (and file
;; This ensures has a file-id
(denote-file-has-denoted-filename-p file))
(let* ((file-id (denote-retrieve-filename-identifier file))
(org-flag (derived-mode-p 'org-mode))
(heading (when org-flag (org-get-heading)))
(section-id (when org-flag (org-id-get))))
(concat
(when section-id
(concat ibut:label-start heading ibut:label-end " "))
"denote:" file-id
(cond (section-id
(concat "#" section-id))
(heading
(concat "#" heading)))
(when buffer-file-name
(let ((line-num (if org-flag
(count-lines
(save-excursion
(condition-case nil
(progn (org-back-to-heading t)
(point))
(error (point-min))))
;; Without 1+, line count is often off by one
(min (1+ (point)) (point-max)))
(line-number-at-pos)))
(col-num (current-column)))
(concat (unless (<= line-num 1)
(format ":L%d" line-num))
(unless (= col-num 0)
(format ":C%d" col-num)))))))))))