Skip to content

Commit 50d4a7b

Browse files
Bikestassats
authored andcommitted
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.
1 parent 96de8b0 commit 50d4a7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

slime.el

+5-2
Original file line numberDiff line numberDiff line change
@@ -3388,8 +3388,11 @@ are supported:
33883388
(when edit-path (slime-search-edit-path edit-path))
33893389
(when call-site (slime-search-call-site call-site))
33903390
(when align
3391-
(slime-forward-sexp)
3392-
(beginning-of-sexp)))
3391+
(condition-case nil
3392+
(progn
3393+
(slime-forward-sexp)
3394+
(beginning-of-sexp))
3395+
(error (goto-char 0)))))
33933396
(point)))
33943397

33953398

0 commit comments

Comments
 (0)