Function: hpath:file-line-and-column

hpath:file-line-and-column is a byte-compiled function defined in hpath.el.

Signature

(hpath:file-line-and-column PATH-LINE-AND-COL)

Documentation

Return list of parts from PATH-LINE-AND-COL string of format path:line:col.

Parse out the parts and return a list, else nil.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hpath.el
(defun hpath:file-line-and-column (path-line-and-col)
  "Return list of parts from PATH-LINE-AND-COL string of format path:line:col.
Parse out the parts and return a list, else nil."
  (when (stringp path-line-and-col)
    (cond ((string-match hpath:section-line-and-column-regexp path-line-and-col)
           ;; Ensure any variables and heading suffixes following [#,] are removed before returning file.
           (let ((file (save-match-data (hpath:expand (match-string-no-properties 1 path-line-and-col))))
                 (line-num (string-to-number (match-string-no-properties 3 path-line-and-col)))
                 (col-num (when (match-end 4)
                            (string-to-number (match-string-no-properties 5 path-line-and-col)))))
             (when (and (save-match-data (setq file (hpath:is-p file)))
                        file)
	       (if line-num
                   (if col-num
		       (list file line-num col-num)
                     (list file line-num))))))
          (t (let ((file (hpath:is-p (hpath:expand path-line-and-col))))
               (when file
                 (list file)))))))