all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* HideShow.el configuration for a custom Major Mode
@ 2010-04-05 22:47 Sergei Lebefev
  0 siblings, 0 replies; only message in thread
From: Sergei Lebefev @ 2010-04-05 22:47 UTC (permalink / raw)
  To: help-gnu-emacs

Hello, I've been making a major mode for a small language called Io.
The language syntax is pretty simple, since everything is an object
and every construct is a method call. But strangely enough i've ran
into some weird problems with hs-special-modes-alist. Here's an
example of the code I need to fold:

SomeObject := Object clone do(
    someMethod := method(a, b, c
        if(a,
            b println
        ,
            c println
        )
    )
)

According to hideshow documentation, i must define the start-end
regexp pair for the mode to work. So I came up with the following:

  (unless (assq 'io-mode hs-special-modes-alist)
    (add-to-list 'hs-special-modes-alist '(io-mode "(" ")"))

It was working okay, except for one detail - it folded all off the
parenthesized expressions. All of my attempts to make it fold __only__
method(...)'s failed. Here's what I've tried:
1. A different start regexp: "method(" and "method" - both doesn't
fold anything
2. Advising hs-hide-block - only top level block got folded,
regardless of the point position and contents of the advising
function.

So the general question is: is there a way to make HideShow hide only
the blocks i need? Or how to prevent it from hiding the blocks i don't
want to be hidden, "if()" for instance.

Thanks,
Sergei.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-05 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 22:47 HideShow.el configuration for a custom Major Mode Sergei Lebefev

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.