Function: eca-editor--xref-marker->location

eca-editor--xref-marker->location is a natively compiled function defined in eca-editor.el.

Signature

(eca-editor--xref-marker->location MARKER)

Documentation

Convert MARKER into an eca location with a 1-based point range.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-editor.el
(defun eca-editor--xref-marker->location (marker)
  "Convert MARKER into an eca location with a 1-based point range."
  (when-let ((buffer (marker-buffer marker))
             (file (buffer-file-name (marker-buffer marker))))
    (with-current-buffer buffer
      (save-excursion
        (save-restriction
          (widen)
          (goto-char marker)
          (let ((position (list :line (line-number-at-pos nil t)
                                :character (1+ (- (point) (line-beginning-position))))))
            (list :uri (eca--path-to-uri file)
                  :range (list :start position :end position))))))))