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

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

HideShow, syntax tables, cperl-mode...


From: kj
Subject: HideShow, syntax tables, cperl-mode...
Date: Thu, 8 Mar 2007 16:02:20 +0000 (UTC)
User-agent: nn/6.7.2


Against my better judgement, I'm trying to debug hideshow.el.

Specifically, I'm trying to figure out why hs-hide-all fails on
relatively simple folding tasks, such as the block in

// JavaScript
for ( var x in y ) {
} 

or the one in

# perl
for ( @foo ) {
}

...while, at the same time, hs-toggle-hiding has no problem with
either.  (BTW, during my tests the snippets above were the entire
contents of the respective buffers, so there's no intereference by
other code.)

(In what follows I'll refer to the Perl case, but exactly the same
is true *down to every detail* for the JavaScript one.  I.e. I
don't think the problem, whatever it is, is due to Perl's notoriously
unruly syntax.)

When I look at the value of hs-block-start-regexp, I see that it
is '\s(', and when I then look at the syntax table I see the
following line for '(':

(               ()      which means: open, matches )

OK, I don't know much about Emacs/Elisp syntax tables, so the line
above makes very little sense to me.  More precisely, I don't
understand why '(' should be the indicator of the beginning of a
block in Perl.  The only explanation I can come up with is that
the innocent-looking "open" there stands for something more
complicated than what it appears, but I can't figure out exactly
what that is.

Can someone explain to me what the syntax table line above means?
(I did attempt the ol' RTFM thing, but I was going blind on the
stuff and getting no closer to understanding.) 

TIA!

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


reply via email to

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