[slime-devel] [patch] color slime-repl mode line

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”. So i made an ugly patch to fix it. Here it goes: diff --git a/contrib/slime-autodoc.el b/contrib/slime-autodoc.el index 524539d..e69a65c 100644 --- a/contrib/slime-autodoc.el +++ b/contrib/slime-autodoc.el @@ -184,7 +184,11 @@ Return DOCUMENTATION." (erase-buffer) (unless (eq major-mode 'lisp-mode) (lisp-mode) - (slime-autodoc-mode -1) + (let ((slime-echo-arglist-function slime-echo-arglist-function) + (slime-autodoc-mode slime-autodoc-mode) + (eldoc-idle-delay eldoc-idle-delay) + (eldoc-documentation-function eldoc-documentation-function)) + (slime-autodoc-mode -1)) (set (make-local-variable 'slime-highlight-suppressed-forms) nil)) (insert string) (let ((font-lock-verbose nil)) -- polscy Lispnicy, łączmy się -- #lisp-pl na freenode

Stas Boukarev <stassats@gmail.com> writes:
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.
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.
participants (3)
-
Stanislaw Halik
-
Stas Boukarev
-
Tobias C. Rittweiler