M-, not working in Sly (works in Slime)
Test file:
(defun f ()
(format t "f~%"))
(defun test ()
(f))
M-x slyC-c C-k- Place cursor at call of
fin functiontest. M-.- Cursor jumps to
(defun f(). M-,: "At start of xref history" message in minibuffer and cursor remains at(defun f()
M-. and M-, work as expected in Slime.
I can't reproduce.
Can confirm this behavior on my system as well. However, if I run OPs example code and hit M-. I get an error:
sly-edit-definition: (((DEFUN FN) (:error Error: DEFINITION-SOURCE of function FN did not contain meaningful information.)))
On all other code I can go to the definitions, but I can't backtrack.
I can't make heads or tails of this recipe. When you M-x sly in an Emacs -Q, it lands you in an SLY mREPL. And there, C-c C-k isn't bound to anything. So people here are talking about different things. Also I suspect the OP is in a Elisp buffer, not a Common Lisp one. Because that message is from ELisp's xref.el, which is not in use by SLY (I wish it was, but it's not).
So please, provide meaningful recipes starting from Emacs -Q some-lisp-file.lisp -l path-to-sly-autoloads.el -f sly or something like that.
In my example, I wasn't in an elisp buffer and I was not in the sly mrepl. Note that I compiled with "C-c C-k" perfectly valid in a lisp buffer but not valid in an elisp buffer.
See also:
https://github.com/slime/slime/commit/789584a7acb15747678fa62a8fcfc8d1187be867
and:
https://www.reddit.com/r/lisp/comments/ssqhrr/slimepopfinddefinitionstack_not_working/
In my example, I wasn't in an elisp buffer and I was not in the sly mrepl. Note that I compiled with "C-c C-k" perfectly valid in a lisp buffer but not valid in an elisp buffer.
How am I to know that? You say "M-x sly" then "C-c C-k" it makes no sense.
I still can't reproduce, and I'm using a super-duper latest Emacs from master. So post an idiot proof recipe, pretty please with sugar on top.
I did a bit of investigation on my side with a minimal config:
(add-to-list 'load-path "~/build/sly") ; after pulling the git repo to this path
(require 'sly-autoloads)
(setq inferior-lisp-program "/usr/bin/sbcl")
When I evaluate the code that @toddkfisher suggested:
(defun f ()
(format t "f~%"))
(defun test ()
(f))
and hit M-. on the f in the test function I get an error:
(((DEFUN F) (:error Error: DEFINITION-SOURCE of function F did not contain meaningful information.)))
When, however, I did a simple M-. on #'+ then I could move back easily with M-,
So @toddkfisher there's something in our configs that interfers with M-,...
I am on 31.0.50 on Arch Linux, so quite close to the bleeding edge.
Further digging: I wiped my entire config clean, and the problem persisted. However, it works fine when I use the version of sly that I pulled down from git and installed manually. Whenever I use melpa to install it the problem returns.
Sounds like a duplicate of https://github.com/joaotavora/sly/discussions/691#discussioncomment-14917242.
I plan to make a release soon. In the meantime, please don't use MELPA stable.