good evening,
it's my first time using slime, but i can't seem to make it start. after configuring my .emacs, i try to run the command "slime", but after displaying the message "Swank started at port: 1038" it breaks. the backtrace shows:
Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) hs-hide-block-at-point() slime-log-event((:open-dedicated-output-stream 1040)) slime-dispatch-event((:open-dedicated-output-stream 1040) #<process SLIME Lisp>) slime-process-available-input() slime-net-filter(#<process SLIME Lisp> "^@^@%(:open-dedicated-output-stream 1040)\n")
i don't really understand what's going on, but shouldn't it try to open the stream on port 1038, where swank is listening? what can i do to fix this?
thank you, henrique rodrigues
Henrique Rodrigues hmtr@rnl.ist.utl.pt writes:
good evening,
it's my first time using slime, but i can't seem to make it start. after configuring my .emacs, i try to run the command "slime", but after displaying the message "Swank started at port: 1038" it breaks. the backtrace shows:
Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) hs-hide-block-at-point() slime-log-event((:open-dedicated-output-stream 1040))
Which Emacs and Lisp versions? I seem to remember Raymond Toy having a similar problem in the past under XEmacs, but we never really got to the bottom of it IIRC.
As a work-around, can you try setting the Elisp variable `slime-log-events' to nil and see if that fixes it?
-Luke
On Mon, 2004-04-05 at 04:49, Luke Gorrie wrote:
Henrique Rodrigues hmtr@rnl.ist.utl.pt writes:
good evening,
it's my first time using slime, but i can't seem to make it start. after configuring my .emacs, i try to run the command "slime", but after displaying the message "Swank started at port: 1038" it breaks. the backtrace shows:
Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) hs-hide-block-at-point() slime-log-event((:open-dedicated-output-stream 1040))
Which Emacs and Lisp versions? I seem to remember Raymond Toy having a similar problem in the past under XEmacs, but we never really got to the bottom of it IIRC.
i'm using emacs 21.3.1 and cmucl 18e on a gentoo system.
As a work-around, can you try setting the Elisp variable `slime-log-events' to nil and see if that fixes it?
thanks for the tip, it worked (although i don't know why)!
Henrique Rodrigues wrote:
[...]
Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) hs-hide-block-at-point() slime-log-event((:open-dedicated-output-stream 1040))
Coming to this late, this looks like a previous bug that ought to have been fixed by this:
2004-01-12 Lawrence Mitchell wence@gmx.li
* slime.el (slime-events-buffer): Set `hs-block-start-regexp' before running `hs-minor-mode'.
Just out of interest, what slime revision are you running?
[...]
Luke Gorrie:
As a work-around, can you try setting the Elisp variable `slime-log-events' to nil and see if that fixes it?
thanks for the tip, it worked (although i don't know why)!
It means that slime-log-event never gets called, and so the looking-at(nil) bug never occurs.
Lawrence Mitchell wence@gmx.li writes:
Coming to this late, this looks like a previous bug that ought to have been fixed by this:
2004-01-12 Lawrence Mitchell wence@gmx.li
- slime.el (slime-events-buffer): Set `hs-block-start-regexp'
before running `hs-minor-mode'.
I still experience the startup problem described, running XEmacs 21.4 with CLISP 2.33 on Cygwin. My slime.el does seem to include the patch described above. Here is slime-events-buffer:
(defun slime-events-buffer () (or (get-buffer "*slime-events*") (let ((buffer (get-buffer-create "*slime-events*"))) (with-current-buffer buffer (lisp-mode) (set (make-local-variable 'hs-block-start-regexp) "^(") (hs-minor-mode) (setq font-lock-defaults nil) (current-buffer)))))
But note that when I switch to the *slime-events* buffer and check out hs-block-start-regexp, I see that it's not set per the definition above:
,----[ Evaluated in *slime-events* ] | `hs-block-start-regexp' is a variable declared in Lisp. | -- loaded from "hideshow" | | Value: "\s(" | | This value is specific to the current buffer. | | Default-value: nil | | Documentation: | Regexp for beginning of block. Buffer-local. `----
Where is that "\s(" coming from? Clearly it's similar to the intended "^(", but not anchored and perhaps not sufficient to resolve the hs-minor-mode bug.
Ah, take a look in hideshow.el's hs-grok-mode-type function, called form hs-minor-mode. Near the end, we find:
(let ((lookup (assoc major-mode hs-special-modes-alist))) (setq hs-block-start-regexp (or (nth 1 lookup) "\s(") hs-block-end-regexp (or (nth 2 lookup) "\s)") hs-forward-sexp-func (or (nth 3 lookup) 'forward-sexp)))
The only modes in hs-special-modes-alist are c-mode and c++-mode, so this function overwrites slime's desired regexp with "\s(". Maybe we should set hs-block-start-regexp /after/ calling hs-minor-mode, or even install a special mode entry for *slime-events* in hs-special-modes-alist.
Just out of interest, what slime revision are you running?
I'm running the FAIRLY-STABLE version from CVS.
Steven E. Harris wrote:
[...]
Where is that "\s(" coming from? Clearly it's similar to the intended "^(", but not anchored and perhaps not sufficient to resolve the hs-minor-mode bug.
Ah, take a look in hideshow.el's hs-grok-mode-type function, called form hs-minor-mode. Near the end, we find:
Yes, I see the same problem. It would appear that setting hs-block-start-regexp directly is not the way to go, but one should rather bind something in hs-special-modes-alist. Can you try this version of slime-events-buffer?
(defun slime-events-buffer () (or (get-buffer "*slime-events*") (let ((buffer (get-buffer-create "*slime-events*")) ;; `hs-grok-mode-type' overrides the setting of ;; `hs-block-start-regexp' using this variable. Bind it ;; accordingly -- Lawrence 2004/04/27 (hs-special-modes-alist '((fundamental-mode "^(" nil ";" nil nil)))) (with-current-buffer buffer ;; Will most likely get overridden by ;; `hs-special-modes-alist', but better safe than sorry ;; -- Lawrence 2004/04/27 (set (make-local-variable 'hs-block-start-regexp "^(")) (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-end) "") (hs-minor-mode)) buffer)))
[...]
Lawrence Mitchell wence@gmx.li writes:
Can you try this version of slime-events-buffer?
The hs-special-modes-alist requires a different set of values than what you proposed. Here's a corrected version:
(defun slime-events-buffer () (or (get-buffer "*slime-events*") (let ((buffer (get-buffer-create "*slime-events*")) ;; `hs-grok-mode-type' overrides the setting of ;; `hs-block-start-regexp' using this variable. Bind it ;; accordingly -- Lawrence 2004/04/27 (hs-special-modes-alist '((fundamental-mode "^(" nil)))) (with-current-buffer buffer ;; Will most likely get overridden by ;; `hs-special-modes-alist', but better safe than sorry ;; -- Lawrence 2004/04/27 (set (make-local-variable 'hs-block-start-regexp) "^(") (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-end) "") (hs-minor-mode)) buffer)))
Starting up a fresh XEmacs instance with this definition allowed slime to start up properly on the first and every subsequent try.
Steven E. Harris wrote:
The hs-special-modes-alist requires a different set of values than what you proposed. Here's a corrected version.
XEmacs and Emacs have incompatible formats for hs-special-mode-alist, hence my version being wrong for you.
Here's a corrected patch --- Maintainers? :)
[...]
Starting up a fresh XEmacs instance with this definition allowed slime to start up properly on the first and every subsequent try.
Index: ChangeLog =================================================================== RCS file: /project/slime/cvsroot/slime/ChangeLog,v retrieving revision 1.355 diff -u -r1.355 ChangeLog --- ChangeLog 27 Apr 2004 22:49:45 -0000 1.355 +++ ChangeLog 27 Apr 2004 23:03:20 -0000 @@ -1,3 +1,10 @@ +2004-04-28 Lawrence Mitchell wence@gmx.li + + * slime.el (slime-events-buffer): Remove test for XEmacsness. + Bind `hs-special-modes-alist' correctly to set + `hs-block-start-regexp' for both Emacs and XEmacs. + (slime-same-line-p): Fix indentation. + 2004-04-28 Helmut Eller e9626484@stud3.tuwien.ac.at
* slime.el (slime-net-connect): Bind inhibit-quit to nil, so that
Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.281 diff -u -r1.281 slime.el --- slime.el 27 Apr 2004 22:35:24 -0000 1.281 +++ slime.el 27 Apr 2004 23:02:16 -0000 @@ -1666,16 +1666,22 @@
(defun slime-events-buffer () (or (get-buffer "*slime-events*") - (let ((buffer (get-buffer-create "*slime-events*"))) - ;; Using hideshow mode in XEmacs has caused obscure problems - ;; for some users. -luke (24/Apr/2004) - (unless (featurep 'xemacs) - (with-current-buffer buffer - (set (make-local-variable 'hs-block-start-regexp) "^(") - (set (make-local-variable 'comment-start) ";") - (set (make-local-variable 'comment-end) "") - (unless (featurep 'xemacs) - (hs-minor-mode)))) + (let ((buffer (get-buffer-create "*slime-events*")) + ;; `hs-grok-mode-type' overrides the setting of + ;; `hs-block-start-regexp' using this variable. Bind it + ;; accordingly -- Lawrence 2004/04/27 + (hs-special-modes-alist (if (featurep 'xemacs) + '((fundamental-mode "^(" nil)) + '((fundamental-mode "^(" nil + ";" nil nil))))) + (with-current-buffer buffer + ;; Will most likely get overridden by + ;; `hs-special-modes-alist', but better safe than sorry + ;; -- Lawrence 2004/04/27 + (set (make-local-variable 'hs-block-start-regexp) "^(") + (set (make-local-variable 'comment-start) ";") + (set (make-local-variable 'comment-end) "") + (hs-minor-mode)) buffer)))
@@ -2989,8 +2995,8 @@
(defun slime-same-line-p (pos1 pos2) "Return t if buffer positions POS1 and POS2 are on the same line." - (save-excursion (goto-char (min pos1 pos2)) - (<= (max pos1 pos2) (line-end-position)))) + (save-excursion (goto-char (min pos1 pos2)) + (<= (max pos1 pos2) (line-end-position))))
(defun slime-severity-face (severity) "Return the name of the font-lock face representing SEVERITY."
Lawrence Mitchell wence@gmx.li writes:
XEmacs and Emacs have incompatible formats for hs-special-mode-alist, hence my version being wrong for you.
I figured that must have been the case. My choice of words was poor; I meant to say, "That doesn't work /here/, and here's something that does work."
Thanks for pushing this fix through.
Lawrence Mitchell wence@gmx.li writes:
Steven E. Harris wrote:
The hs-special-modes-alist requires a different set of values than what you proposed. Here's a corrected version.
XEmacs and Emacs have incompatible formats for hs-special-mode-alist, hence my version being wrong for you.
Here's a corrected patch --- Maintainers? :)
This is pretty hairy code. I don't think hs-minor-mode is useful enough to warrant it, myself.
Luke Gorrie wrote:
[...] hs-minor-mode fix.
This is pretty hairy code. I don't think hs-minor-mode is useful enough to warrant it, myself.
I'd be inclined to agree. Especially due to the XEmacs/Emacs schism involved --- this is due to the fact the the released XEmacs contains version 3.4 of hideshow, whereas Emacs has version 5.something. The new file is not backward-compatible, sadly.
How about using outline-minor-mode instead. This is simpler, and cross-emacs compatible.
(defun slime-log-event (event) (when slime-log-events (with-current-buffer (slime-events-buffer) ;; trim? (when (> (buffer-size) 100000) (goto-char (/ (buffer-size) 2)) (re-search-forward "^(" nil t) (delete-region (point-min) (point))) (goto-char (point-max)) (save-excursion (pp event (current-buffer))) (when outline-minor-mode (hide-entry)) (goto-char (point-max)))))
(defun slime-events-buffer () (or (get-buffer "*slime-events*") (let ((buffer (get-buffer-create "*slime-events*"))) (with-current-buffer buffer (set (make-local-variable 'outline-regexp) "^(") (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-end) "") (outline-minor-mode)) buffer)))
Lawrence Mitchell wence@gmx.li writes:
How about using outline-minor-mode instead. This is simpler, and cross-emacs compatible.
Good idea! Committed.
Luke Gorrie writes:
Lawrence Mitchell wence@gmx.li writes:
How about using outline-minor-mode instead. This is simpler, and cross-emacs compatible.
Good idea! Committed.
It's unfortunately not cross-USER compatible; I for one do not use the distributed outline; I use noutline and/or allout. Slime breaks for me until I load outline.el.
Alain.Picard@memetrics.com wrote:
[...] outline-minor-mode.
It's unfortunately not cross-USER compatible; I for one do not use the distributed outline; I use noutline and/or allout. Slime breaks for me until I load outline.el.
I don't think this is our fault. outline-minor-mode should be autoloaded in your emacs (unless you use an XEmacs without it installed, I forget if it's in the base-support section), and if noutline and/or allout override it as something different, there's not really very much we can do. Complain to their authors, I suppose.
Lawrence Mitchell wence@gmx.li writes:
Alain.Picard@memetrics.com wrote:
[...] outline-minor-mode.
It's unfortunately not cross-USER compatible; I for one do not use the distributed outline; I use noutline and/or allout. Slime breaks for me until I load outline.el.
I don't think this is our fault. outline-minor-mode should be autoloaded in your emacs (unless you use an XEmacs without it installed, I forget if it's in the base-support section), and if noutline and/or allout override it as something different, there's not really very much we can do. Complain to their authors, I suppose.
I disabled outline-mode for the events buffers. Can be customized with slime-inhibit-ouline-mode-in-events-buffer.
Helmut.
On Tue, 11 May 2004 23:14:11 +0200, Helmut Eller e9626484@stud3.tuwien.ac.at wrote:
I disabled outline-mode for the events buffers. Can be customized with slime-inhibit-ouline-mode-in-events-buffer.
Looks like it's really "ouline" in the sources - I guess this was a typo... :)
I updated from CVS some minutes ago and had to patch slime.el in order not to get an error:
--- slime.el.orig 2004-05-12 17:57:42.000000000 +0200 +++ slime.el 2004-05-12 17:58:41.000000000 +0200 @@ -1705,7 +1705,8 @@ (goto-char (point-max)) (save-excursion (pp event (current-buffer))) - (when outline-minor-mode + (when (and (boundp 'outline-minor-mode) + outline-minor-mode) (hide-entry)) (goto-char (point-max)))))
(GNU Emacs 21.3.50 from CVS)
Cheers, Edi.
Edi Weitz edi@agharta.de writes:
On Tue, 11 May 2004 23:14:11 +0200, Helmut Eller e9626484@stud3.tuwien.ac.at wrote:
I disabled outline-mode for the events buffers. Can be customized with slime-inhibit-ouline-mode-in-events-buffer.
Looks like it's really "ouline" in the sources - I guess this was a typo... :)
I updated from CVS some minutes ago and had to patch slime.el in order not to get an error:
Thanks, applied.
"Steven E. Harris" seharris@raytheon.com writes:
I still experience the startup problem described, running XEmacs 21.4 with CLISP 2.33 on Cygwin. My slime.el does seem to include the patch described above. Here is slime-events-buffer:
In the interim I've committed a change to just disable all use of hs-minor-mode in XEmacs. (The other day I disabled entering the mode, but there was still a call to hs-hide-block-at-point until just now).
Hopefully this problem has disappeared for now. I'm not sure if any XEmacs users care about the *slime-events* buffer not using hs-minor-mode.
-Luke
Luke Gorrie luke@bluetail.com writes:
In the interim I've committed a change to just disable all use of hs-minor-mode in XEmacs.
That may be an overly severe way to go. Please see my reply to Lawrence Mitch with a refinement of his proposed fix. At least with limited testing here, the problem seems to be solved.