emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 3aa8f4d: In xref-location-marker, handle delete


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] master 3aa8f4d: In xref-location-marker, handle deleted file or outdated xref location nicely
Date: Sun, 20 Oct 2019 17:25:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi Stephen,

On 20.10.2019 16:39, Stephen Leake wrote:
branch: master
commit 3aa8f4d44c33d71b815e4e94c02d5ec13cfd6372
Author: Stephen Leake <address@hidden>
Commit: Stephen Leake <address@hidden>

     In xref-location-marker, handle deleted file or outdated xref location 
nicely
* lisp/progmodes/xref.el (xref-location-marker): Add ignore-errors.

Shouldn't it output a warning, at least?

  lisp/progmodes/xref.el | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 702de89..8d8e7ab 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.

IUUC, this doesn't handle the case when the file was deleted.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]