unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* HideShow, syntax tables, cperl-mode...
@ 2007-03-08 16:02 kj
  0 siblings, 0 replies; only message in thread
From: kj @ 2007-03-08 16:02 UTC (permalink / raw)
  To: help-gnu-emacs



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.

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

only message in thread, other threads:[~2007-03-08 16:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-08 16:02 HideShow, syntax tables, cperl-mode kj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).