Stas Boukarev stassats@gmail.com writes:
Stanislaw Halik sthalik@test123.ltd.pl writes:
When the REPL is started without lisp-mode windows, the arglist isn't fontified until something is „M-x slime-mode”'d because of this:
[slime-autodoc.el] (defun slime-fontify-string (string) "Fontify STRING as `font-lock-mode' does in Lisp mode." (with-current-buffer (get-buffer-create " *slime-fontify*") (erase-buffer) (unless (eq major-mode 'lisp-mode) (lisp-mode) (slime-autodoc-mode -1) ...) ...))
…and „slime-autodoc-mode” sets „slime-echo-arglist-function” when arg satisfies „minusp”.
Thanks for discovering this, Stanislaw. I think this is the root of another problem that sometimes pressing SPACE involves `slime-show-arglist' and not autodoc due to a race condition.
So i made an ugly patch to fix it. Here it goes:
I see no reason why slime-autodoc-mode should be turned off in this buffer, so I just removed (slime-autodoc-mode -1) line and committed it.
It's the other way around, there's not reason why it should be turned on; especially because it's used within the autodoc code itself, so there may have been recursive problems I forgot. Another thing is that because autodoc is performed periodically involving an RPC request, you don't want it to happen if you're just vising a .lisp file without having started slime.
Another way would be to make slime-echo-arglist-function buffer-local in slime-autodoc-mode, but I'm not sure that this is desirable.
The real fix, I think, is to conditionalize on `slime-use-autodoc-mode' in `slime-compute-autodoc', and binding the variable to nil inside of `slime-fontify-string'.
-T.