emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/slime 50d4a7b168 17/44: Fix emacs error when M-.-ing to no


From: ELPA Syncer
Subject: [nongnu] elpa/slime 50d4a7b168 17/44: Fix emacs error when M-.-ing to nonexistent file
Date: Fri, 29 Dec 2023 01:00:02 -0500 (EST)

branch: elpa/slime
commit 50d4a7b16893612b61715c3818717c4d1afd67db
Author: Bike <aeshtaer@gmail.com>
Commit: Stas Boukarev <stassats@gmail.com>

    Fix emacs error when M-.-ing to nonexistent file
    
    When the Lisp reports a source location is in a file that doesn't
    exist, and also gives the :align t hint, slime-location-offset
    will try to (slime-forward-sexp) (beginning-of-sexp) in a new
    empty buffer. This causes a pretty inscrutable
    "Wrong type argument: characterp, nil" error from emacs. This
    problem may also occur if the source file does not have sexp
    syntax, but I haven't tried that myself.
    
    The change just silently ignores any errors from the sexp motion.
    It might be better to have slime report that the file isn't real
    and not do any motion to begin with.
---
 slime.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/slime.el b/slime.el
index 21b7af1e7a..e336ad7fe7 100644
--- a/slime.el
+++ b/slime.el
@@ -3388,8 +3388,11 @@ are supported:
       (when edit-path (slime-search-edit-path edit-path))
       (when call-site (slime-search-call-site call-site))
       (when align
-        (slime-forward-sexp)
-        (beginning-of-sexp)))
+        (condition-case nil
+            (progn
+              (slime-forward-sexp)
+              (beginning-of-sexp))
+          (error (goto-char 0)))))
     (point)))
 
 



reply via email to

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