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.