help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hideshow minor-mode


From: Michael Heerdegen
Subject: Re: hideshow minor-mode
Date: Mon, 15 Oct 2012 20:04:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Shiyuan <address@hidden> writes:

> I want to turn-on the hide-show-minor-mode in a user-defined
> mymode. But it gives me the error: mymode doesn't support hide show
> minor mode. I have put (require 'hideshow) at the beginning of
> mymode.el, and also
> (hs-minor-mode 1) in the body of the definition of the major mode, and
> after that
> I put (add-to-list 'hs-special-modes-alist '(mymode "{" "}" "/[*/]"
> nil nil)) in mymode.el.
>
> What else I should do to utilize the hs-minor-mode in mymode? Thanks.

Enabling `hs-minor-mode' tests if `comment-start' and `comment-end' are
bound to something non-nil and fails otherwise.  This happens even
before `hs-special-modes-alist' is handled.  IMHO this doesn't make much
sense.  FWIW, your minor-mode must bind `comment-start' and
`comment-end'.

If your mode doesn't have comments at all, you can bind these to a
regexp that always fails matching - like "\\=[^[:ascii:][:nonascii:]]".

Does that help?


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]