I took some time to go over the latest docs and then update my emacs startup settings for slime, but I have a couple of unresolved questions.
- Is TAB bound to slime-indent-and-complete-symbol by default or not? I thought that it was, but removing this key binding definition reverted to simple indentation behavior.
- It seems autodoc mode is not working correctly when the mark is over a symbol that used to have its value displayed. I found slime-use-autodoc-mode but it does not have documentation and cannot be set or called.
- What is the correct way to set a key binding: with define-key global-map, define-key slime-mode-map, or is there a different way?
Thanks!
-- jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
* Jonathon McKitrick [2007-09-03 11:51+0200] writes:
I took some time to go over the latest docs and then update my emacs startup settings for slime, but I have a couple of unresolved questions.
Right now, things are bit more if flux than usual and not everything might work.
- Is TAB bound to slime-indent-and-complete-symbol by default or not? I
thought that it was, but removing this key binding definition reverted to simple indentation behavior.
TAB in lisp-mode should be bound to lisp-indent-line. Indentation should be done by lisp-mode not by Slime. It the REPL buffer it's bound to slime-indent-and-complete-symbol.
- It seems autodoc mode is not working correctly when the mark is over a
symbol that used to have its value displayed. I found slime-use-autodoc-mode but it does not have documentation and cannot be set or called.
This is probably a bit screwed up at the moment. If you have
(add-hook 'slime-load-hook (lambda () (require 'slime-autodoc)))
in your .emacs, you should be able to turn on autodoc mode with M-x slime-autodoc-mode. Setting slime-use-autodoc-mode should turn it on automatically, but it might be broken right now. When I move point over *package*, get *PACKAGE* => #<PACKAGE "COMMON-LISP-USER"> in the echo area.
- What is the correct way to set a key binding: with define-key
global-map, define-key slime-mode-map, or is there a different way?
Most likely define-key slime-mode-map, but it depends a bit on what you want to achieve. slime-mode-map is used by the Slime minor mode. The global-map seems to contain mostly the self-inserting commands; it's probably better not touch those. Other interesting keymaps are slime-repl-mode-map, sldb-mode-map, and of course lisp-mode-map.
Helmut.
On Mon, Sep 03, 2007 at 01:29:25PM +0200, Helmut Eller wrote: : * Jonathon McKitrick [2007-09-03 11:51+0200] writes: : > - It seems autodoc mode is not working correctly when the mark is over a : > symbol that used to have its value displayed. I found : > slime-use-autodoc-mode but it does not have documentation and cannot be : > set or called. : : This is probably a bit screwed up at the moment. : If you have : : (add-hook 'slime-load-hook (lambda () (require 'slime-autodoc))) : : in your .emacs, you should be able to turn on autodoc mode with M-x : slime-autodoc-mode. Setting slime-use-autodoc-mode should turn it on : automatically, but it might be broken right now. When I move point : over *package*, get *PACKAGE* => #<PACKAGE "COMMON-LISP-USER"> in the : echo area.
This still does not work for me. Not sure why not.
Also, the load-system shortcut ',load' does not work. I have this is my startup file:
(add-hook 'slime-load-hook (lambda () (require 'slime-asdf)))
and I also load slime-fancy. What else do I need to add?
jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
* Jonathon McKitrick [2007-09-04 17:28+0200] writes:
This still does not work for me. Not sure why not.
Do you get some error message if you type M-x slime-autodoc-mode ?
Also, the load-system shortcut ',load' does not work. I have this is my startup file:
(add-hook 'slime-load-hook (lambda () (require 'slime-asdf)))
and I also load slime-fancy. What else do I need to add?
Can you load it manually with M-x load-library slime-asdf ?
On Wed, Sep 05, 2007 at 01:13:12PM +0200, Helmut Eller wrote: : * Jonathon McKitrick [2007-09-04 17:28+0200] writes: : : > : > This still does not work for me. Not sure why not. : : Do you get some error message if you type M-x slime-autodoc-mode
I have this in my Preferences.el I'm running Aquamacs:
(slime-setup :autodoc t) (setq slime-use-autodoc-mode)
But M-x slime-autodoc-mode says 'No match' Do I need a (require 'slime-autodoc) somewhere?
: ? : : > : > Also, the load-system shortcut ',load' does not work. I have this : > is my startup file: : > : > (add-hook 'slime-load-hook (lambda () (require 'slime-asdf))) : > : > and I also load slime-fancy. What else do I need to add? : : Can you load it manually with M-x load-library slime-asdf ?
When I do that, it accepts the command. Then when I type ,load it says 'connection broken by peer.' Then I re-start sbcl, then re-type ,load and after it finds the system name and hit return, it loads.
jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
* Jonathon McKitrick [2007-09-05 13:59+0200] writes:
I have this in my Preferences.el I'm running Aquamacs:
(slime-setup :autodoc t) (setq slime-use-autodoc-mode)
But M-x slime-autodoc-mode says 'No match' Do I need a (require 'slime-autodoc) somewhere?
Yes, but slime-fancy does that already.
Hmm... I guess, you have (require 'slime) somewhere, before you do (add-hook 'slime-load-hook ...). I.e. the load hook is already executed before the customizations are added.
Can you delete (require 'slime) and try something like this instead:
(require 'slime-autoloads) (slime-setup :autodoc t) (defun my-slime-load-hook () (require 'slime-fancy) (require 'slime-asdf)) (add-hook 'slime-load-hook 'my-slime-load-hook)
: Can you load it manually with M-x load-library slime-asdf ?
When I do that, it accepts the command. Then when I type ,load it says 'connection broken by peer.' Then I re-start sbcl, then re-type ,load and after it finds the system name and hit return, it loads.
OK, that's expected. The swank part isn't loaded properly at this point.
Helmut.
On Wed, Sep 05, 2007 at 02:34:17PM +0200, Helmut Eller wrote: : * Jonathon McKitrick [2007-09-05 13:59+0200] writes: : : > I have this in my Preferences.el I'm running Aquamacs: : > : > (slime-setup :autodoc t) : > (setq slime-use-autodoc-mode) : > : > But M-x slime-autodoc-mode says 'No match' : > Do I need a (require 'slime-autodoc) somewhere? : : Yes, but slime-fancy does that already. : : Hmm... I guess, you have (require 'slime) somewhere, before you do : (add-hook 'slime-load-hook ...). I.e. the load hook is already : executed before the customizations are added.
Would it be simpler just to rearrange these calls?
: Can you delete (require 'slime) and try something like this instead: : : (require 'slime-autoloads) : (slime-setup :autodoc t) : (defun my-slime-load-hook () : (require 'slime-fancy) : (require 'slime-asdf)) : (add-hook 'slime-load-hook 'my-slime-load-hook)
Thank you, that does work. Should I move all of my define-key slime-mode-map settings into my-slime-load-hook? They do not work if called before slime is loaded, of course.
-- jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
* Jonathon McKitrick [2007-09-05 14:53+0200] writes:
Would it be simpler just to rearrange these calls?
That should also work. Not loading Slime saves some startup time, in those situations when you don't use Slime. Use what you prefer.
Thank you, that does work. Should I move all of my define-key slime-mode-map settings into my-slime-load-hook? They do not work if called before slime is loaded, of course.
It wouldn't hurt to do that.
Helmut.
On Wed, Sep 05, 2007 at 03:04:18PM +0200, Helmut Eller wrote: : * Jonathon McKitrick [2007-09-05 14:53+0200] writes: : : > Would it be simpler just to rearrange these calls? : : That should also work. Not loading Slime saves some startup time, in : those situations when you don't use Slime. Use what you prefer. : : > Thank you, that does work. Should I move all of my define-key : > slime-mode-map settings into my-slime-load-hook? They do not work if : > called before slime is loaded, of course. : : It wouldn't hurt to do that.
I'm new to elisp programming, but not to lisp itself. I currently have <f5> bound to 'slime, and that works well. Would it make more sense to write my own elisp function that is bound to <f5> and in that function call (require 'slime) and (slime-setup) instead of calling it every time emacs starts?
-- jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
* Jonathon McKitrick [2007-09-05 15:17+0200] writes:
I'm new to elisp programming, but not to lisp itself. I currently have <f5> bound to 'slime, and that works well. Would it make more sense to write my own elisp function that is bound to <f5> and in that function call (require 'slime) and (slime-setup) instead of calling it every time emacs starts?
The only problem I see with that approach, is that you may also need some other commands, say slime-connect, and that would probably lead to some duplication.
I'd load slime-autoloads, bind <f5> to 'slime, and call slime-setup in .emacs. Slime local key bindings for can be defined in slime-mode-hook or slime-load-hook.
In ELisp you can use `autoload' to declare a function as autoloaded. E.g. (autoload 'slime "slime" nil t) will automatically load "slime.el[c]" when the function slime is called the first time. [Loading the file will then install the proper function, and if the file doesn't have a definition for it, Emacs complains with a somewhat meaningful error message.]
The usual way to save startup time is to declare all needed functions as autoloaded and to do customizations in hooks. The file slime-autoloads does just that.
slime-setup just sets some variables; it's cheap to execute. slime-setup is also intended for newbies, so that they only need one or two lines in their .emacs. More experienced users will probably add the necessary hooks "manually".
Helmut.
On Wed, Sep 05, 2007 at 03:53:46PM +0200, Helmut Eller wrote: : I'd load slime-autoloads, bind <f5> to 'slime, and call slime-setup in : .emacs. Slime local key bindings for can be defined in : slime-mode-hook or slime-load-hook.
Excellent. I have it working!
Thank you for all your hard work. We 'fire-n-forget' slime users appreciate it!
-- jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
On Wed, Sep 05, 2007 at 01:13:12PM +0200, Helmut Eller wrote: : * Jonathon McKitrick [2007-09-04 17:28+0200] writes: : : > : > This still does not work for me. Not sure why not. : : Do you get some error message if you type M-x slime-autodoc-mode : ?
I now get a broken lisp connection message. Is there a way to extract more error info?
jcm@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org
On Thu, Sep 06, 2007 at 04:25:02AM +0000, Jonathon McKitrick wrote: : On Wed, Sep 05, 2007 at 01:13:12PM +0200, Helmut Eller wrote: : : * Jonathon McKitrick [2007-09-04 17:28+0200] writes: : : : : > : : > This still does not work for me. Not sure why not. : : : : Do you get some error message if you type M-x slime-autodoc-mode : : ? : : I now get a broken lisp connection message. Is there a way to extract : more error info?
Perhaps this is of help? Maybe not...
;; Connection to Emacs lost. [ ;; condition: READER-ERROR at 40 (line 1, column 40) on #<SB-IMPL::STRING-INPUT-STREAM {1174B751}>: Symbol "ARGLIST-FOR-ECHO-AREA" not found in the SWANK package. ;; type: SB-KERNEL:READER-PACKAGE-ERROR ;; encoding: NIL style: :SPAWN dedicated: NIL]
: : jcm@sdf.lonestar.org : SDF Public Access UNIX System - http://sdf.lonestar.org : _______________________________________________ : slime-devel site list : slime-devel@common-lisp.net : http://common-lisp.net/mailman/listinfo/slime-devel
Jonathon McKitrick -- My other computer is your Windows box.
Jonathon McKitrick jcm@sdf.lonestar.org writes:
Perhaps this is of help? Maybe not...
;; Connection to Emacs lost. [ ;; condition: READER-ERROR at 40 (line 1, column 40) on #<SB-IMPL::STRING-INPUT-STREAM {1174B751}>: Symbol "ARGLIST-FOR-ECHO-AREA" not found in the SWANK package. ;; type: SB-KERNEL:READER-PACKAGE-ERROR ;; encoding: NIL style: :SPAWN dedicated: NIL]
How do you update slime from CVS? Could you please run the command "cvs up -C -dPA", and try with that checkout again?
-T.
On Thu, Sep 06, 2007 at 11:38:20AM +0200, Tobias C. Rittweiler wrote: : Jonathon McKitrick jcm@sdf.lonestar.org writes: : : > Perhaps this is of help? Maybe not... : > : > ;; Connection to Emacs lost. [ : > ;; condition: READER-ERROR at 40 (line 1, column 40) on #<SB-IMPL::STRING-INPUT-STREAM {1174B751}>: : > Symbol "ARGLIST-FOR-ECHO-AREA" not found in the SWANK package. : > ;; type: SB-KERNEL:READER-PACKAGE-ERROR : > ;; encoding: NIL style: :SPAWN dedicated: NIL] : : How do you update slime from CVS? Could you please run the command "cvs : up -C -dPA", and try with that checkout again?
No change. No updates came down, and I get the same error. Is there some other error info I can look for in another buffer that might help?
Jonathon McKitrick -- My other computer is your Windows box.
Jonathon McKitrick jcm@sdf.lonestar.org writes:
: Jonathon McKitrick jcm@sdf.lonestar.org writes:
: > Perhaps this is of help? Maybe not... : > : > ;; Connection to Emacs lost. [ : > ;; condition: READER-ERROR at 40 (line 1, column 40) on #<SB-IMPL::STRING-INPUT-STREAM {1174B751}>: : > Symbol "ARGLIST-FOR-ECHO-AREA" not found in the SWANK package. : > ;; type: SB-KERNEL:READER-PACKAGE-ERROR : > ;; encoding: NIL style: :SPAWN dedicated: NIL]
Way to reproduce this:
Start Emacs just with `(require 'slime)' in your .emacs, but _no_ `(require 'slime-fancy)' (or slime-autodoc for that matter.)
M-x slime, then manually require slime-fancy:
M-: (require 'slime-fancy)
The next time slime tries to do autodoc, the above error should occur.
The reason is that `slime-autodoc-init' only runs SWANK-REQUIRE in `slime-connected-hook' -- yet in the above scenario, Slime is already connected, so the arglist stuff is never loaded into the Swank side.. resulting in the above error.
(This is similiarly valid for other contribs.)
A possible fix would be to insert something like
(when (slime-connected-p) (slime-eval-async '(swank:swank-require :swank-arglists)))
in `slime-autodoc-init' (and all other relevant contribs.)
This analysis is mostly due to Matt Pillsbury.
-T.
On Fri, Sep 07, 2007 at 01:12:50AM +0200, Tobias C. Rittweiler wrote: : Jonathon McKitrick jcm@sdf.lonestar.org writes: : : > : Jonathon McKitrick jcm@sdf.lonestar.org writes: : > : > : > Perhaps this is of help? Maybe not... : > : > : > : > ;; Connection to Emacs lost. [ : > : > ;; condition: READER-ERROR at 40 (line 1, column 40) on #<SB-IMPL::STRING-INPUT-STREAM {1174B751}>: : > : > Symbol "ARGLIST-FOR-ECHO-AREA" not found in the SWANK package. : > : > ;; type: SB-KERNEL:READER-PACKAGE-ERROR : > : > ;; encoding: NIL style: :SPAWN dedicated: NIL] : : : Way to reproduce this: : : Start Emacs just with `(require 'slime)' in your .emacs, but _no_ : `(require 'slime-fancy)' (or slime-autodoc for that matter.) : : M-x slime, then manually require slime-fancy: : : M-: (require 'slime-fancy) : : The next time slime tries to do autodoc, the above error should occur. : : : The reason is that `slime-autodoc-init' only runs SWANK-REQUIRE in : `slime-connected-hook' -- yet in the above scenario, Slime is already : connected, so the arglist stuff is never loaded into the Swank side.. : resulting in the above error. : : (This is similiarly valid for other contribs.) : : : A possible fix would be to insert something like : : (when (slime-connected-p) : (slime-eval-async '(swank:swank-require :swank-arglists))) : : in `slime-autodoc-init' (and all other relevant contribs.) : : : This analysis is mostly due to Matt Pillsbury.
Ah, thanks for tracking it down and/or following up.
Until a correct patch is applied, is there something I can do in my .emacs or even manually as a workaround?
Jonathon McKitrick -- My other computer is your Windows box.
* Jonathon McKitrick [2007-09-07 03:37+0200] writes:
Ah, thanks for tracking it down and/or following up.
Until a correct patch is applied, is there something I can do in my .emacs or even manually as a workaround?
Loading the contribs before connecting should help. One way to do it, is to call (require 'slime-autodoc) in a slime-load-hook, and make sure that the load hook is actually called.
Manually you could do it with:
1.) M-x load-library slime 2.) M-x load-library slime-autodoc 3.) M-: (setq slime-use-autodoc-mode t) 4.) M-x slime
Helmut.
Jonathon McKitrick jcm@sdf.lonestar.org writes:
- It seems autodoc mode is not working correctly when the mark is over a
symbol that used to have its value displayed. I found slime-use-autodoc-mode but it does not have documentation and cannot be set or called.
If anything autodoc-related is not working at the moment, I'm most probably the culprit. I can't reproduce this one, though.
-T.