From: Stephen Leake Date: Sun, 20 Oct 2019 13:39:02 +0000 (-0700) Subject: In xref-location-marker, handle deleted file or outdated xref location nicely X-Git-Tag: emacs-27.0.90~955 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3aa8f4d44c33d71b815e4e94c02d5ec13cfd6372;p=emacs.git In xref-location-marker, handle deleted file or outdated xref location nicely * lisp/progmodes/xref.el (xref-location-marker): Add ignore-errors. --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 702de894528..8d8e7ab208e 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -131,8 +131,13 @@ Line numbers start from 1 and columns from 0.") (widen) (save-excursion (goto-char (point-min)) - (beginning-of-line line) - (forward-char column) + (ignore-errors + ;; xref location may be out of date; it may be past the + ;; end of the current file, or the file may have been + ;; deleted. Return a reasonable location; the user will + ;; figure it out. + (beginning-of-line line) + (forward-char column)) (point-marker)))))) (cl-defmethod xref-location-group ((l xref-file-location))