all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: hideshow minor-mode
Date: Mon, 15 Oct 2012 20:04:34 +0200	[thread overview]
Message-ID: <87626blih9.fsf@web.de> (raw)
In-Reply-To: <mailman.11001.1350265231.855.help-gnu-emacs@gnu.org> (Shiyuan's message of "Sun, 14 Oct 2012 20:40:26 -0500")

Shiyuan <gshy2014@gmail.com> 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	other threads:[~2012-10-15 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.11001.1350265231.855.help-gnu-emacs@gnu.org>
2012-10-15 18:04 ` Michael Heerdegen [this message]
2012-10-15 23:30   ` hideshow minor-mode Shiyuan
     [not found]   ` <mailman.11078.1350343816.855.help-gnu-emacs@gnu.org>
2012-10-16  1:03     ` Michael Heerdegen
2012-10-16  4:20       ` Shiyuan
     [not found]       ` <mailman.11086.1350361261.855.help-gnu-emacs@gnu.org>
2012-10-16  5:17         ` Michael Heerdegen
2012-10-16 14:40           ` Shiyuan
     [not found]           ` <mailman.11111.1350398455.855.help-gnu-emacs@gnu.org>
2012-10-16 18:09             ` Michael Heerdegen
2012-10-15  1:40 Shiyuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87626blih9.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.