diff options
| author | Stephen Leake | 2019-10-20 06:39:02 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-10-20 06:39:02 -0700 |
| commit | 3aa8f4d44c33d71b815e4e94c02d5ec13cfd6372 (patch) | |
| tree | d7dabf323f95e5e6381e6fc6eb8fcb50cb1d59fb | |
| parent | f22a1008a1be01c1735e0ab42666b7d0ef537ffd (diff) | |
| download | emacs-3aa8f4d44c33d71b815e4e94c02d5ec13cfd6372.tar.gz emacs-3aa8f4d44c33d71b815e4e94c02d5ec13cfd6372.zip | |
In xref-location-marker, handle deleted file or outdated xref location nicely
* lisp/progmodes/xref.el (xref-location-marker): Add ignore-errors.
| -rw-r--r-- | lisp/progmodes/xref.el | 9 |
1 files changed, 7 insertions, 2 deletions
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.") | |||
| 131 | (widen) | 131 | (widen) |
| 132 | (save-excursion | 132 | (save-excursion |
| 133 | (goto-char (point-min)) | 133 | (goto-char (point-min)) |
| 134 | (beginning-of-line line) | 134 | (ignore-errors |
| 135 | (forward-char column) | 135 | ;; xref location may be out of date; it may be past the |
| 136 | ;; end of the current file, or the file may have been | ||
| 137 | ;; deleted. Return a reasonable location; the user will | ||
| 138 | ;; figure it out. | ||
| 139 | (beginning-of-line line) | ||
| 140 | (forward-char column)) | ||
| 136 | (point-marker)))))) | 141 | (point-marker)))))) |
| 137 | 142 | ||
| 138 | (cl-defmethod xref-location-group ((l xref-file-location)) | 143 | (cl-defmethod xref-location-group ((l xref-file-location)) |