unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* cperl mode comments still parsed and colored
@ 2007-08-17 10:55 jidanni
  2007-08-19  1:51 ` jidanni
  0 siblings, 1 reply; 7+ messages in thread
From: jidanni @ 2007-08-17 10:55 UTC (permalink / raw)
  To: emacs-pretest-bug

#-*-cperl-*-
# Notice how the ]{2} is in a different color than comment color. This ]{2} too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-17 10:55 cperl mode comments still parsed and colored jidanni
@ 2007-08-19  1:51 ` jidanni
  2007-08-19  1:58   ` jidanni
  2007-08-19 17:37   ` Randal L. Schwartz
  0 siblings, 2 replies; 7+ messages in thread
From: jidanni @ 2007-08-19  1:51 UTC (permalink / raw)
  To: emacs-devel

bla /m #-*-cperl-*-
#h /Delivery
# \@m

#Save this message body into a file bla.pl and do emacs -Q bla.pl, to
#see more of my discoveries which I hereby report as bugs. Real
#comment color is [this color]. Above you can see I have tricked cperl
#mode into making things in comments render in non comment colors.
#Syntax errors or not, like \@m.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-19  1:51 ` jidanni
@ 2007-08-19  1:58   ` jidanni
  2007-08-19 17:37   ` Randal L. Schwartz
  1 sibling, 0 replies; 7+ messages in thread
From: jidanni @ 2007-08-19  1:58 UTC (permalink / raw)
  To: emacs-devel

P.S., my delicate bug will be mangled if reading
http://article.gmane.org/gmane.emacs.devel/76734 .
http://article.gmane.org/gmane.emacs.devel/76734/raw
is what I actually wrote.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-19  1:51 ` jidanni
  2007-08-19  1:58   ` jidanni
@ 2007-08-19 17:37   ` Randal L. Schwartz
  2007-08-19 23:47     ` jidanni
  1 sibling, 1 reply; 7+ messages in thread
From: Randal L. Schwartz @ 2007-08-19 17:37 UTC (permalink / raw)
  To: emacs-devel

>>>>> "jidanni" == jidanni  <jidanni@jidanni.org> writes:

jidanni> bla /m #-*-cperl-*-
jidanni> #h /Delivery
jidanni> # \@m

jidanni> #Save this message body into a file bla.pl and do emacs -Q bla.pl, to
jidanni> #see more of my discoveries which I hereby report as bugs. Real
jidanni> #comment color is [this color]. Above you can see I have tricked cperl
jidanni> #mode into making things in comments render in non comment colors.
jidanni> #Syntax errors or not, like \@m.

You've got gibberish there.  I could see Perl trying to parse that as

  bla (function, taking arguments...)
  / (begin of regex)
  m #-*-cperl-*- (content of regex)

so it's not a comment yet.

If you can show a reasonable Perl program that breaks, it'd be much
more interesting.  Gibberish in, Gibberish out.

It's like you'd claim that:

q{   # this is a comment

when in fact it's not a comment.  It's part of a single-quoted string.
Don't be naive about Perl if you're going to report bugs in cperl-mode.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-19 17:37   ` Randal L. Schwartz
@ 2007-08-19 23:47     ` jidanni
  2007-08-19 23:57       ` Randal L. Schwartz
  0 siblings, 1 reply; 7+ messages in thread
From: jidanni @ 2007-08-19 23:47 UTC (permalink / raw)
  To: merlyn; +Cc: emacs-devel

RLS> You've got gibberish there.
OK, but you must admit that lines 2 and 3 of this have non-comment
colors inside comments:
#-*-cperl-*-
#  ]{2} ]{2} too.
#\@m

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-19 23:47     ` jidanni
@ 2007-08-19 23:57       ` Randal L. Schwartz
  2007-08-22 19:41         ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Randal L. Schwartz @ 2007-08-19 23:57 UTC (permalink / raw)
  To: jidanni; +Cc: emacs-devel

>>>>> "jidanni" == jidanni  <jidanni@jidanni.org> writes:

RLS> You've got gibberish there.
jidanni> OK, but you must admit that lines 2 and 3 of this have non-comment
jidanni> colors inside comments:
jidanni> #-*-cperl-*-
jidanni> #  ]{2} ]{2} too.
jidanni> #\@m

And again, not typical Perl code.

That's because cperl-mode doesn't promise to be perfect. It actually *can't
be*: see my summary of why *no* parser can parse Perl without executing Perl
at <http://www.perlmonks.org/index.pl?node_id=44722>.  Perl cannot be
statically lexed.  That's incontrovertible.

We've all learned to allow cperl-mode to color Perl "mostly ok", knowing it
can be tricked by very atypical Perl code, including gibberish.  Your stuff is
still very atypical character sequences.  Stop doing that.  Show us a useful
Perl program that doesn't get colored right, and I'm sure Ilya will be happy
to take a stab at compromising cperl-mode a bit more to make it work again.
And even then, most of us have also learned to "give cperl-mode a bone"
occasionally to keep it happy.  It's definitely a lot better than perl-mode,
which required some serious contortions to get right, and why no serious Perl
hacker uses perl-mode any more, and why we're happy Ilya crafted cperl-mode to
get it "mostly right".  Ilya wrote half of the regular expression engine and
half the Perl debugger as well, so he's intimately familiar with trying
to wrangle text engines to do the right thing.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cperl mode comments still parsed and colored
  2007-08-19 23:57       ` Randal L. Schwartz
@ 2007-08-22 19:41         ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2007-08-22 19:41 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: emacs-devel, jidanni

> occasionally to keep it happy.  It's definitely a lot better than perl-mode,
> which required some serious contortions to get right,

For what it's worth perl-mode now does a better job of it.
Obviously I use perl-mode.

> and why no serious Perl hacker uses perl-mode any more,

And indeed, I'm no Perl hacker ;-)

> and why we're happy Ilya crafted cperl-mode to

Yes, it was a significant improvement.  But I must say it had too many
idiosyncrasies for my taste, which is why I preferred to improve perl-mode
than to use cperl-mode.  perl-mode still lacks some things from cperl-mode,
of course.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-22 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17 10:55 cperl mode comments still parsed and colored jidanni
2007-08-19  1:51 ` jidanni
2007-08-19  1:58   ` jidanni
2007-08-19 17:37   ` Randal L. Schwartz
2007-08-19 23:47     ` jidanni
2007-08-19 23:57       ` Randal L. Schwartz
2007-08-22 19:41         ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

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).