all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is this a bug in cperl mode
@ 2003-02-10  3:20 Harry Putnam
  2003-02-10  9:29 ` Kai Großjohann
  0 siblings, 1 reply; 19+ messages in thread
From: Harry Putnam @ 2003-02-10  3:20 UTC (permalink / raw)



I get several kinds of goofy behavior from cperl mode on this snippet
of code.  The syntax hylight breaks down on last section too.  Makes
cperl pretty useless for what its designed for. Maybe its local guff
causing it but starting emacs -q -no-site-file doesn't seem to help.

And perl, even in strict mode, has no problem with it.

emacs perl-mode doesn't complain either.

In cperl-mode:
Try C-x h C-M \ on this code or just navigate around in it,
particularly at if($opt_s).

  #!/usr/local/bin/perl -w
  
  use strict;
  use vars qw($opt_d $opt_s);
  use Getopt::Std;
  my $optstr ="ds";
  getopts($optstr);
  
  if($opt_d){
    print "an -d was used\n";
  
  }
  
  if($opt_s){
     print "an -s was used\n";
  }

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

* Re: Is this a bug in cperl mode
  2003-02-10  3:20 Is this a bug in cperl mode Harry Putnam
@ 2003-02-10  9:29 ` Kai Großjohann
  2003-02-10 10:14   ` Daniel Pfeiffer
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Kai Großjohann @ 2003-02-10  9:29 UTC (permalink / raw)


Harry Putnam <hgp@sbcglobal.net> writes:

> I get several kinds of goofy behavior from cperl mode on this snippet
> of code.  The syntax hylight breaks down on last section too.  Makes
> cperl pretty useless for what its designed for. Maybe its local guff
> causing it but starting emacs -q -no-site-file doesn't seem to help.

I could reproduce this with the cperl that comes with Emacs, but the
cperl from Ilya (I have 4.32, it seems) works.

How about you check that and submit a bug report, suggesting to
upgrade the cperl in Emacs.  (It seems that the cperl in Emacs is
quite old.)
-- 
A turnip curses Elvis

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

* Re: Is this a bug in cperl mode
  2003-02-10  9:29 ` Kai Großjohann
@ 2003-02-10 10:14   ` Daniel Pfeiffer
  2003-02-11  1:23     ` Unknown
  2003-02-10 15:50   ` Harry Putnam
  2003-02-11 21:21   ` Daniel Pfeiffer
  2 siblings, 1 reply; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-10 10:14 UTC (permalink / raw)


kai.grossjohann@uni-duisburg.de (Kai Großjohann) skribis:
> Harry Putnam <hgp@sbcglobal.net> writes:

> > I get several kinds of goofy behavior from cperl mode on this snippet
> > of code.  The syntax hylight breaks down on last section too.  Makes
> > cperl pretty useless for what its designed for. Maybe its local guff
> > causing it but starting emacs -q -no-site-file doesn't seem to help.

> I could reproduce this with the cperl that comes with Emacs, but the
> cperl from Ilya (I have 4.32, it seems) works.

> How about you check that and submit a bug report, suggesting to
> upgrade the cperl in Emacs.  (It seems that the cperl in Emacs is
> quite old.)

Actually I've been exploring this recently, and the opposite is the case. 
The CPerl from Ilya is quite old.  The emacs variant has had quite a few
little bug-fixes over the last three years.  This seems the first case where
Ilya's is better.  As for $opt_s, $opt{s}, %opt = ( s => ..., $p::s and all
such single occurences of 's' they're a nightmare in both variants.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: Is this a bug in cperl mode
  2003-02-10  9:29 ` Kai Großjohann
  2003-02-10 10:14   ` Daniel Pfeiffer
@ 2003-02-10 15:50   ` Harry Putnam
  2003-02-10 16:11     ` Harry Putnam
  2003-02-10 21:26     ` Daniel Pfeiffer
  2003-02-11 21:21   ` Daniel Pfeiffer
  2 siblings, 2 replies; 19+ messages in thread
From: Harry Putnam @ 2003-02-10 15:50 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1573 bytes --]

kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> Harry Putnam <hgp@sbcglobal.net> writes:
>
>> I get several kinds of goofy behavior from cperl mode on this snippet
>> of code.  The syntax hylight breaks down on last section too.  Makes
>> cperl pretty useless for what its designed for. Maybe its local guff
>> causing it but starting emacs -q -no-site-file doesn't seem to help.
>
> I could reproduce this with the cperl that comes with Emacs, but the
> cperl from Ilya (I have 4.32, it seems) works.
>
> How about you check that and submit a bug report, suggesting to
> upgrade the cperl in Emacs.  (It seems that the cperl in Emacs is
> quite old.)

I'm running a recent cvs of emacs (GNU Emacs 21.3.50.1 )

checking C-h v cperl-version <RET> shows:
  cperl-version's value is "4.32"
  Version of IZ-supported CPerl package this file is based on.
  Defined in `cperl-mode'.

Must be more than one version of 4.32 :)
With the posted code in a cperl-mode buffer and running
C-x h
C-M \

I get:
  forward-sexp: Scan error: "Unbalanced parentheses", 169, 212
Switching to plain perl-mode and running the same commands produces
error/warnings.

Daniel writes:
> such single occurences of 's' they're a nightmare in both variants.

Seems like regular perl-mode deals with that.  At least in this case.
Can code be stolen or example drawn from it?

Oh and can some thing be set so that
  if(some_test){
    some_action
  }

Isn't expanded into:
  if (some_test) {
    some_action
  }

Or is the lack of space between `if and (', `) and {' part of the same
problem?

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

* Re: Is this a bug in cperl mode
  2003-02-10 15:50   ` Harry Putnam
@ 2003-02-10 16:11     ` Harry Putnam
  2003-02-10 21:07       ` Daniel Pfeiffer
  2003-02-16  1:28       ` Ilya Zakharevich
  2003-02-10 21:26     ` Daniel Pfeiffer
  1 sibling, 2 replies; 19+ messages in thread
From: Harry Putnam @ 2003-02-10 16:11 UTC (permalink / raw)


Harry Putnam <hgp@sbcglobal.net> writes:

> Must be more than one version of 4.32 :)
> With the posted code in a cperl-mode buffer and running

Yup.  Diffing the cperl-mode from emacs distro which claims to be
4.32 agaist the 4.32 found on Ilya's page shows major diff.  And the
one from Ilya's page doesn't have a problem with the posted code just
like Kai said.

So whats up with the versioning?  Is it normal for there to be
numerous versions of a 4.32 version number?

And Daniel,  Are there other problems with the 4.32 from Ilya's page
that are not present with the 4.32 in the distro?

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

* Re: Is this a bug in cperl mode
  2003-02-10 16:11     ` Harry Putnam
@ 2003-02-10 21:07       ` Daniel Pfeiffer
  2003-02-16  1:30         ` Ilya Zakharevich
  2003-02-16  1:28       ` Ilya Zakharevich
  1 sibling, 1 reply; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-10 21:07 UTC (permalink / raw)


Harry Putnam <hgp@sbcglobal.net> skribis:
> Harry Putnam <hgp@sbcglobal.net> writes:

> > Must be more than one version of 4.32 :)
> > With the posted code in a cperl-mode buffer and running

> Yup.  Diffing the cperl-mode from emacs distro which claims to be
> 4.32 agaist the 4.32 found on Ilya's page shows major diff.  And the
> one from Ilya's page doesn't have a problem with the posted code just
> like Kai said.

The version by Ilya has hairy turned on by default, which is something RMS
refuses.  Must be something in there that works better for this code.  I use
the GNU variant with hairy, and other than $opt_s I had no problem with the
posted code.

> So whats up with the versioning?  Is it normal for there to be
> numerous versions of a 4.32 version number?

I'm currently looking at a few fixes for this, and I'm upping the version to
4.33 and copyright 2003 to end this confusion.  The thing is that emacs
modules don't usually have their own versions (just belong to emacs 21.2 or
whatever).  So they don't update this variable, but when you look at CVS,
they've been doing quite a lot.  While Ilya seems to have abandoned this...

> And Daniel,  Are there other problems with the 4.32 from Ilya's page
> that are not present with the 4.32 in the distro?

While manually scanning through the diff, I noticed a few fixes, including
one (failing M-x man) I had stumbled across myself in Ilya's.  From looking
through things there seems to remain a lot of work...

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: Is this a bug in cperl mode
  2003-02-10 15:50   ` Harry Putnam
  2003-02-10 16:11     ` Harry Putnam
@ 2003-02-10 21:26     ` Daniel Pfeiffer
  1 sibling, 0 replies; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-10 21:26 UTC (permalink / raw)


Harry Putnam <hgp@sbcglobal.net> skribis:
> I get:
>   forward-sexp: Scan error: "Unbalanced parentheses", 169, 212

That's the $opt_s which is recognized as a substitution s)...)...)

> Daniel writes:
> > such single occurences of 's' they're a nightmare in both variants.

> Seems like regular perl-mode deals with that.  At least in this case.
> Can code be stolen or example drawn from it?

Oh no, it's far worse!  Give it a nice s/a'b/y"z/ and watch it get lost. 
Recognizing s (and its kin) is definitely the right thing to do.  Alas it's
hard to do perfectly...

> Oh and can some thing be set so that
>   if(some_test){
>     some_action
>   }

> Isn't expanded into:
>   if (some_test) {
>     some_action
>   }

Sounds like one of the hairy options.  Btw. I just checked, I don't have
hairy on, because I didn't like it.  And after all hairy doesn't influence
the s))) scan.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: Is this a bug in cperl mode
  2003-02-10 10:14   ` Daniel Pfeiffer
@ 2003-02-11  1:23     ` Unknown
  2003-02-11  2:04       ` Unknown
  0 siblings, 1 reply; 19+ messages in thread
From: Unknown @ 2003-02-11  1:23 UTC (permalink / raw)


Daniel Pfeiffer wrote:

> kai.grossjohann@uni-duisburg.de (Kai Großjohann) skribis:
>> Harry Putnam <hgp@sbcglobal.net> writes:
> 
>> > I get several kinds of goofy behavior from cperl mode on this snippet
>> > of code.  The syntax hylight breaks down on last section too.  Makes
>> > cperl pretty useless for what its designed for. Maybe its local guff
>> > causing it but starting emacs -q -no-site-file doesn't seem to help.
> 
>> I could reproduce this with the cperl that comes with Emacs, but the
>> cperl from Ilya (I have 4.32, it seems) works.
> 
>> How about you check that and submit a bug report, suggesting to
>> upgrade the cperl in Emacs.  (It seems that the cperl in Emacs is
>> quite old.)
> 
> Actually I've been exploring this recently, and the opposite is the case.
> The CPerl from Ilya is quite old.  The emacs variant has had quite a few
> little bug-fixes over the last three years.  This seems the first case where
> Ilya's is better.

Here is another:

Using filladapt-mode, I'm able to fill end-of-line comments with the Ilya's 
version.  This is broken in the Emacs version, both CVS and stable.

I just checked, and adaptive-fill-mode is broken in the same manner.

I can turn filladapt off in the mode hook, but still regression is never good.

--
Le

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

* Re: Is this a bug in cperl mode
  2003-02-11  1:23     ` Unknown
@ 2003-02-11  2:04       ` Unknown
  0 siblings, 0 replies; 19+ messages in thread
From: Unknown @ 2003-02-11  2:04 UTC (permalink / raw)


Le Wang wrote:

> Daniel Pfeiffer wrote:
> 
>> kai.grossjohann@uni-duisburg.de (Kai Großjohann) skribis:
>>> Harry Putnam <hgp@sbcglobal.net> writes:
>> 
>>> > I get several kinds of goofy behavior from cperl mode on this snippet
>>> > of code.  The syntax hylight breaks down on last section too.  Makes
>>> > cperl pretty useless for what its designed for. Maybe its local guff
>>> > causing it but starting emacs -q -no-site-file doesn't seem to help.
>> 
>>> I could reproduce this with the cperl that comes with Emacs, but the
>>> cperl from Ilya (I have 4.32, it seems) works.
>> 
>>> How about you check that and submit a bug report, suggesting to
>>> upgrade the cperl in Emacs.  (It seems that the cperl in Emacs is
>>> quite old.)
>> 
>> Actually I've been exploring this recently, and the opposite is the case.
>> The CPerl from Ilya is quite old.  The emacs variant has had quite a few
>> little bug-fixes over the last three years.  This seems the first case
>> where Ilya's is better.
> 
> Here is another:
> 
> Using filladapt-mode, I'm able to fill end-of-line comments with the Ilya's
> version.  This is broken in the Emacs version, both CVS and stable.
> 
> I just checked, and adaptive-fill-mode is broken in the same manner.
> 
> I can turn filladapt off in the mode hook, but still regression is never
> good.

Oops, things just got a little worse.  In the cvs version of emacs, no matter 
what version of cperl-mode (emacs' or Ilya's) I use, even if I turn filladapt 
off in the mode hook, filling is broken as described above.  With the 
addition that even whole line comments won't fill at all. I'm trying to fill 
by pressing <M-q>, which runs cperl-fill-paragraph.

Bummer.

--
Le

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

* Re: Is this a bug in cperl mode
  2003-02-10  9:29 ` Kai Großjohann
  2003-02-10 10:14   ` Daniel Pfeiffer
  2003-02-10 15:50   ` Harry Putnam
@ 2003-02-11 21:21   ` Daniel Pfeiffer
  2003-02-16  2:56     ` Ilya Zakharevich
  2003-02-17  7:56     ` CPerl mode v5.0 Ilya Zakharevich
  2 siblings, 2 replies; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-11 21:21 UTC (permalink / raw)


kai.grossjohann@uni-duisburg.de (Kai Großjohann) skribis:
> Harry Putnam <hgp@sbcglobal.net> writes:
> > I get several kinds of goofy behavior from cperl mode on this snippet
> > of code.  The syntax hylight breaks down on last section too.  Makes
> > cperl pretty useless for what its designed for. Maybe its local guff
> > causing it but starting emacs -q -no-site-file doesn't seem to help.
> 
> I could reproduce this with the cperl that comes with Emacs, but the
> cperl from Ilya (I have 4.32, it seems) works.

Here is a little snippet of (wrong!) Perl code, which shows what is needed
to catch each of the font-lock errors:

\$"asd"
\$'asd'
\$`asd`

$opt_s!asd!bsd!
$opt::s!asd!bsd!
$opt{s}asd}bsd}
(s => ...)=bsd=

The fourth case is the one originally posted here.  Both Ilya's and Emacs'
modes fall into precisely the same traps.  If anybody sees this differently,
I'd very much like to see their .emacs.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: Is this a bug in cperl mode
  2003-02-10 16:11     ` Harry Putnam
  2003-02-10 21:07       ` Daniel Pfeiffer
@ 2003-02-16  1:28       ` Ilya Zakharevich
  1 sibling, 0 replies; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-16  1:28 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Harry Putnam 
<hgp@sbcglobal.net>], who wrote in article <m21y2gundb.fsf@sbcglobal.net>:
> Yup.  Diffing the cperl-mode from emacs distro which claims to be
> 4.32 agaist the 4.32 found on Ilya's page shows major diff.

Mostly backward-compatibility bruhaha, and whitespace.  I found only
one significant bug in 4.32-RMS (one with indentation of

  $a = {
      };

).

>  And the
> one from Ilya's page doesn't have a problem with the posted code just
> like Kai said.

This is due to a different default for cperl-under-as-char.  The
proper solution (one which allows customization of
cperl-under-as-char) should be using a separate syntax table during
cperl-find-pods-heres - one with "_" marked as word-character (as it
should be).

Hope this helps,
Ilya

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

* Re: Is this a bug in cperl mode
  2003-02-10 21:07       ` Daniel Pfeiffer
@ 2003-02-16  1:30         ` Ilya Zakharevich
  0 siblings, 0 replies; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-16  1:30 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Daniel Pfeiffer 
<occitan@esperanto.org>], who wrote in article <20030210220756.61d6926e.occitan@esperanto.org>:
> The version by Ilya has hairy turned on by default

This is not so.  But cperl-under-as-char is.

>, which is something RMS refuses.

Yours,
Ilya

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

* Re: Is this a bug in cperl mode
  2003-02-11 21:21   ` Daniel Pfeiffer
@ 2003-02-16  2:56     ` Ilya Zakharevich
  2003-02-17  8:04       ` Daniel Pfeiffer
  2003-02-17  7:56     ` CPerl mode v5.0 Ilya Zakharevich
  1 sibling, 1 reply; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-16  2:56 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Daniel Pfeiffer 
<occitan@esperanto.org>], who wrote in article <20030211222108.11234512.occitan@esperanto.org>:
> Here is a little snippet of (wrong!) Perl code, which shows what is needed
> to catch each of the font-lock errors:

> \$"asd"
> \$'asd'
> \$`asd`

$a = \$"->asd(\$");		# syntaxically correct

> $opt_s!asd!bsd!

This is OK with cperl-under-as-char TRUE.

> $opt::s!asd!bsd!

  $opt::s = $foo = $bar =exe;  # Warnings, but no error

> $opt{s}asd}bsd}

  $opt{s} = ({asd => 1}, {bsd => 1});

> (s => ...)=bsd=

  @a = (s => ...); $b = $bsd =exe;

> The fourth case is the one originally posted here.  Both Ilya's and Emacs'
> modes fall into precisely the same traps.

Nope, the 4th one is OK with my version.  In my experience, the others
appear much much rarer.

Ilya

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

* Re: CPerl mode v5.0
  2003-02-11 21:21   ` Daniel Pfeiffer
  2003-02-16  2:56     ` Ilya Zakharevich
@ 2003-02-17  7:56     ` Ilya Zakharevich
  2003-02-17 19:50       ` Ilya Zakharevich
  1 sibling, 1 reply; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-17  7:56 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Daniel Pfeiffer 
<occitan@esperanto.org>], who wrote in article <20030211222108.11234512.occitan@esperanto.org>:
> Here is a little snippet of (wrong!) Perl code, which shows what is needed
> to catch each of the font-lock errors:
> 
> \$"asd"
> \$'asd'
> \$`asd`

Fixed by one-byte-long edit to cperl-mode.el.

> $opt_s!asd!bsd!
> $opt::s!asd!bsd!

Each requires 3-byte-long edits to fix (at least kinda-fix; a full fix
which distinguishes : from :: takes 2 lines ;-).

Shortly: stupid me!  It turned out that all the infrastructure (the
code) was already there, all I needed to change were a couple of
tables (i.e., the data).

> $opt{s}asd}bsd}
> (s => ...)=bsd=

These (and a couple more I discovered) take around 40 LOC to handle.

CPerl-mode v5.0 should be available for download in a couple of hours
(forwarding setup should propagate first) from the temporary address

  www.ilyaz.org/software2/emacs/

v4.35 is provided too as a basis to merge3 other versions.  All the
bugs I could reproduce are fixed.  A couple of limitations remain (see
TODO).

I recommend looking for bugs ASAP; for minor matters I'm going to go
into append-to-TODO maintainace mode quite soon.

Yours,
Ilya

======================================================= CHANGES

;;;; After 4.32:
;;;  Syncronized with v1.40+recent-patch from Emacs 21.3.
;;;  Mostly docstring and formatting changes, and:

;;;  (`cperl-noscan-files-regexp'): Do not scan CVS subdirs
;;;  (`cperl-problems'):	    Note that newer XEmacsen may syntaxify too
;;;  (`imenu-example--create-perl-index'):
;;;			Renamed to `cperl-imenu--create-perl-index'
;;;  (`cperl-mode'):		Replace `make-variable-buffer-local' by `make-local-variable'
;;;  (`cperl-setup-tmp-buf'):	Likewise
;;;  (`cperl-fix-line-spacing'): Fix a misprint of "t" for "\t"
;;;  (`cperl-next-bad-style'):  Fix misprints in character literals

;;;; After 4.33:
;;;  (`cperl-font-lock-keywords'): +etc: Aliased to perl-font-lock-keywords.

;;;; After 4.34:
;;;  Further updates of whitespace and spelling w.r.t. RMS version.
;;;  (`cperl-font-lock-keywords'): +etc: Avoid warnings when aliasing.
;;;  (`cperl-mode'):		Use `normal-auto-fill-function' if present.
;;;  (`cperl-use-major-mode'):	New variable
;;;  (`cperl-can-font-lock'):	New variable; replaces `window-system'
;;;  (`cperl-tags-hier-init'):	use `display-popup-menus-p' (if present)
;;;				to choose `x-popup-menu' vs `tmm-prompt'

;;;; 4.35 has the following differences from version 1.40+ of RMS Emacs:

;;; New variables `cperl-use-major-mode', `cperl-can-font-lock';
;;; `cperl-use-major-mode' is (effectively) 'cperl-mode in RMS.
;;; `cperl-under-as-char'  is nil in RMS.
;;; Minor differences in docstrings, and `cperl-non-problems'.
;;; Backward compatibility addressed: (`); (function (lambda ...)); font-lock;
;;; (:italic t bold t) vs (:slant italic :weight bold) in faces;
;;; `normal-auto-fill-function'.
;;; RMS version has wrong logic in `cperl-calculate-indent': $a = { } is
;;; wrongly indented if the closing brace is on a separate line.
;;; Different choice of ordering if's for is-x-REx and (eq (char-after b) ?\#)
;;; in `cperl-find-pods-heres'. [Cosmetic]

;;;; After 4.35:
;;;  (`cperl-find-pods-heres'):	If no end of HERE-doc found, mark to the end
;;;				of buffer.  This enables recognition of end
;;;				of HERE-doc "as one types".
;;;				Require "\n" after trailing tag of HERE-doc.
;;;				\( made non-quoting outside of string/comment
;;;				(gdj-contributed).
;;;				Likewise for \$.
;;;				Remove `here-doc-group' text property at start
;;;				(makes this property reliable).
;;;				Text property `first-format-line' ==> t.
;;;				Do not recognize $opt_s and $opt::s as s///.
;;;  (`cperl-perldoc'):		Use case-sensitive search (contributed).
;;;  (`cperl-fix-line-spacing'): Allow "_" in $vars of foreach etc. when
;;;				underscore isn't a word char (gdj-contributed).
;;;  (`defun-prompt-regexp'):	Allow prototypes.
;;;  (`cperl-vc-header-alist'):	Extract numeric version from the Id.
;;;  Toplevel:			Put toggle-autohelp into the mode menu.
;;;				Better docs for toggle/set/unset autohelp.
;;;  (`cperl-electric-backspace-untabify'): New customization variable
;;;  (`cperl-after-expr-p'):	Works after here-docs, formats, and PODs too
;;;				(affects many electric constructs).
;;;  (`cperl-calculate-indent'): Takes into account `first-format-line' ==>
;;;				works after format.
;;;  (`cperl-short-docs'):	Make it work with ... too.
;;;				"array context" ==> "list context"
;;;  (`cperl-electric-keyword'): make $if (etc: "$@%&*") non-electric
;;;				'(' after keyword would insert a doubled paren
;;;  (`cperl-electric-paren'):	documented affected by `cperl-electric-parens'
;;;  (`cperl-electric-rparen'):	Likewise
;;;  (`cperl-build-manpage'):	New function by Nick Roberts
;;;  (`cperl-perldoc'):		Make it work in XEmacs too

;;;; After 4.36:
;;;  (`cperl-find-pods-heres'):	Recognize s => 1 and {s} (as a key or varname),
;;;				{ s:: } and { s::bar::baz } as varnames.
;;;  (`cperl-after-expr-p'):	Updates syntaxification before checks
;;;  (`cperl-calculate-indent'): Likewise
;;;				Fix wrong indent of blocks starting with POD
;;;  (`cperl-after-block-p'):	Optional argument for checking for a pre-block
;;;				Recognize `continue' blocks too.
;;;  (`cperl-electric-brace'):	use `cperl-after-block-p' for detection;
;;;				Now works for else/continue/sub blocks
;;;  (`cperl-short-docs'):	Minor edits; make messages fit 80-column screen

======================================================= TODO etc

* Fontification of arrays and hashes is overeager.

* Make cperl-fix-line-spacing work with non-CPerl whitespace styles too

* Start emacs with '-q' and probably --no-site-file (see below)
  Load this into a buffer:
  -------------------- snip, snip -----------------------
  {
    #  'next LINE;'
    #  'next PAT;
  }
  -------------------- snip, snip -----------------------

  Switch cperl-mode on
  Narrow the buffer down to the region starting with the first comment-line
  and ending with the last.
  (It now should look like this:
    #  'next LINE;'
    #  'next PAT;
  )

  Position the cursor on the beginning of the first comment-line
  Press <TAB>
  => emacs freezes; it has to be killed

* Make C-Enter do reasonable thing if after $var in 
  for $var () {}

* Make electric braces configurable depending on POD, comment, string

* my (	$var1, # comment
	$var2);
  mishighlighted.

* The generated TAGS contain package::subname, but not just subname

* Indent //x-Rexen according to REx syntax;

* # Now do the loop.  This has god a -2 comment-anti-indent.
    foreach ( @thing ) {
        print $_ . "\n";
    }

  I like the comment text to line up with the code (AS ABOVE), rather than

*
		Hello,
		Recently, a friend asked me to write him a pod only spell
checker.  I was happy to oblige; and did so.  He seemed to like it and
asked me to submit it.  If you would enjoy it, I appended it below.
                                         Have a nice evening,
                                 -Trey Belew


(defun pod-spell ()
  "A function to only check pod documentation"
  (interactive "*")
  (save-excursion
	(let ((element 0)
		    (my-list (make-pod-list)))
	    (while (< element (length my-list))
		  (setq the-first (car (nth element my-list)))
		  (setq the-second (cadr (nth element my-list)))
		  (ispell-region (car (nth element my-list)) (cadr (nth element my-list)))
		  (setq element (1+ element))))))

(defun make-pod-list ()
  "A function to make a list of syntactic elements which are pod/here documentation"
  (interactive)
  (goto-char (point-min))
  (let (
		(current 0)
		(pod-list '())
		(last-state nil)
		(done nil)
		(line 0)
		(pod-start 0))
	(while (not done)
	    (setq the-state (get-text-property current 'in-pod))
		  (cond
		      ((and (eq last-state nil) (eq the-state t))   ;; a new pod is starting
			   (setq last-state the-state)
			   (setq pod-start current))
			     ((and (eq last-state t) (eq the-state nil))   ;; the end of a pod
				  (setq last-state the-state)
				  (setq pod-list (cons (list pod-start current) pod-list)))
				    ((eq current (point-max))
					 (setq done t)))
		    (setq line (1+ line))
			  (goto-line line)
			    (setq current (point)))  ;; end of the while loop.
	(reverse pod-list)))        ;; I reversed it just to make it prettier


* Here's what I use to get xemacs to correctly parse perl errors. I'm
  self-taught in elisp so I make no claims to this being pretty or
  correct, just functional for me. - Von


  ;; <error> at <file> line <num>
  (setq perl-compilation-regexp-alist
        '(("[^\n]* at \\([^ ]+\\) line \\([0-9]+\\)" 1 2)))

  ;; XXX should make value local...
  (cond ((boundp 'compilation-error-regexp-alist-alist) ;; xemacs 20.x
         (setq compilation-error-regexp-alist-alist
               (cons (cons 'perl perl-compilation-regexp-alist)
                            compilation-error-regexp-alist-alist))
         (compilation-build-compilation-error-regexp-alist))

        ((boundp 'compilation-error-regexp-alist) ;; xmeacs 19.x
         (setq compilation-error-regexp-alist
               (cons perl-compilation-regexp-alist
                     compilation-error-regexp-alist))
         )
        )


* Problem:
    if SPACE
  at the beginning of the line.  If this indents, SPACE is not removed
  with the electric expansion.			CAN'T REPRODUCE

* C-ENTER on =item line does not move down two lines	CAN'T REPRODUCE

* =over ENTER puts cursor on the *next* line after =item	CAN'T REPRODUCE

* =over SPACE is not electric in the last line of the buffer (not in newer 21.2)

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

* Re: Is this a bug in cperl mode
  2003-02-16  2:56     ` Ilya Zakharevich
@ 2003-02-17  8:04       ` Daniel Pfeiffer
  2003-02-17 19:33         ` Ilya Zakharevich
  0 siblings, 1 reply; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-17  8:04 UTC (permalink / raw)


Ilya Zakharevich <nospam-abuse@ilyaz.org> skribis:
> [A complimentary Cc of this posting was sent to
> Daniel Pfeiffer 
> <occitan@esperanto.org>], who wrote in article <20030211222108.11234512.occitan@esperanto.org>:
> > Here is a little snippet of (wrong!) Perl code, which shows what is needed
> > to catch each of the font-lock errors:
> 
> > \$"asd"
> > \$'asd'
> > \$`asd`
> 
> $a = \$"->asd(\$");		# syntaxically correct

What are you trying to show?  Of course if by hasard the matching end
of construct is near, that corrects the situation.  But usually they
won't be near, unless it's a script written with your mode, where the
friendly programmer set things up that way.  (E.g. end of line comment
with whatever CPerl mode is expecting)

> > $opt_s!asd!bsd!
> 
> This is OK with cperl-under-as-char TRUE.

Which is otherwise undesirable, as it breaks conventions Emacs users expect.
 But your other post yesterday suggests you have a solution-idea for that.

> > $opt::s!asd!bsd!
> 
>   $opt::s = $foo = $bar =exe;  # Warnings, but no error

As above.

> > $opt{s}asd}bsd}
> 
>   $opt{s} = ({asd => 1}, {bsd => 1});

As above again.

> > (s => ...)=bsd=
> 
>   @a = (s => ...); $b = $bsd =exe;
> 
> > The fourth case is the one originally posted here.  Both Ilya's and Emacs'
> > modes fall into precisely the same traps.
> 
> Nope, the 4th one is OK with my version.

Not with SuSE 8.1's emacs -q --no-site-file (version 21.2) and M-x load-file
your cperl version.  I get the three "=" in light blue, "> ...); $b" in
light brown, "$bsd" in black and "exe" in green.  So again same as my first
remark.

> In my experience, the others
> appear much much rarer.

$opt{s} would be fairly common, and for giving it a default value @opt = (s => ...)

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: Is this a bug in cperl mode
  2003-02-17  8:04       ` Daniel Pfeiffer
@ 2003-02-17 19:33         ` Ilya Zakharevich
  0 siblings, 0 replies; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-17 19:33 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Daniel Pfeiffer 
<occitan@esperanto.org>], who wrote in article <20030217090455.2ec904d2.occitan@esperanto.org>:
> Ilya Zakharevich <nospam-abuse@ilyaz.org> skribis:
> > [A complimentary Cc of this posting was sent to
> > Daniel Pfeiffer 
> > <occitan@esperanto.org>], who wrote in article <20030211222108.11234512.occitan@esperanto.org>:
> > > Here is a little snippet of (wrong!) Perl code, which shows what is needed
> > > to catch each of the font-lock errors:
> > 
> > > \$"asd"
> > > \$'asd'
> > > \$`asd`
> > 
> > $a = \$"->asd(\$");		# syntaxically correct
> 
> What are you trying to show? 

I remove your "(wrong!)", showing how the things may appear in
real-world Perl code.

> > > $opt_s!asd!bsd!
> > 
> > This is OK with cperl-under-as-char TRUE.

> Which is otherwise undesirable, as it breaks conventions Emacs users expect.

Emacs being such a mess, there is nothing "Emacs users expect".  Perl
users expect that _ is a word char.

> >   @a = (s => ...); $b = $bsd =exe;
> > 
> > > The fourth case is the one originally posted here.  Both Ilya's and Emacs'
> > > modes fall into precisely the same traps.
> > 
> > Nope, the 4th one is OK with my version.
> 
> Not with SuSE 8.1's emacs -q --no-site-file (version 21.2) and M-x load-file
> your cperl version.  I get the three "=" in light blue

4th case (IIRC originally posted here) was with $opt_s.

Ilya

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

* Re: CPerl mode v5.0
  2003-02-17  7:56     ` CPerl mode v5.0 Ilya Zakharevich
@ 2003-02-17 19:50       ` Ilya Zakharevich
  2003-02-20  0:00         ` Daniel Pfeiffer
  0 siblings, 1 reply; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-17 19:50 UTC (permalink / raw)


I wrote in article <b2q4k4$31ke$1@agate.berkeley.edu>:

> CPerl-mode v5.0 should be available for download in a couple of hours
> (forwarding setup should propagate first) from the temporary address
> 
>   www.ilyaz.org/software2/emacs/

Stupid me forgot to click on "Confirm this change" button.  Please
wait for another 3 hours...

Embarassed,
Ilya

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

* Re: CPerl mode v5.0
  2003-02-17 19:50       ` Ilya Zakharevich
@ 2003-02-20  0:00         ` Daniel Pfeiffer
  2003-02-20 20:26           ` Ilya Zakharevich
  0 siblings, 1 reply; 19+ messages in thread
From: Daniel Pfeiffer @ 2003-02-20  0:00 UTC (permalink / raw)


Zdravstvujtie Ilya,

The source file has DOS line ends.  There are many trailing spaces.

cperl-backward-to-noncomment is indented as though the or didn't belong to
the if.  In many other places the indentation is also wrong.  What I did for
my last patch to RMS was indent-region the whole file, diff -u to the
original and manually eliminate the indentations that were purposely wrong
(like your concat strings).  Then I applied the diff.

I don't understand your comments.  You mention my patches like switching
is-x-REx and (eq (char-after b) ?\#) or (function (lambda elimination, but
they're not applied.

Apart from these, it's by far the best perl mode ever!!!  I've tried it on
many of my scripts, they look real good!  In one I even found this bummer,
which gets the s wrong but never the less falls back on it's feet -- cool:

($opt_s ? " ; $File::Find::name\n " : '')

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
 ------
  -- My other stuff here too, sawfish, make.pl...: --
   ------
    -- http://dapfy.bei.t-online.de/ --

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

* Re: CPerl mode v5.0
  2003-02-20  0:00         ` Daniel Pfeiffer
@ 2003-02-20 20:26           ` Ilya Zakharevich
  0 siblings, 0 replies; 19+ messages in thread
From: Ilya Zakharevich @ 2003-02-20 20:26 UTC (permalink / raw)


[A complimentary Cc of this posting was sent to
Daniel Pfeiffer 
<occitan@esperanto.org>], who wrote in article <20030220010041.548c3844.occitan@esperanto.org>:
> Zdravstvujtie Ilya,
> 
> The source file has DOS line ends.

Correct.

?  There are many trailing spaces.

I did not want to break compatibility with the RMS Emacs version yet.  ;-)
I think they match 1-to-1 now.  [It was silly, though.]

> cperl-backward-to-noncomment is indented as though the or didn't belong to
> the if.  In many other places the indentation is also wrong.

Thanks.

> I don't understand your comments.  You mention my patches like switching
> is-x-REx and (eq (char-after b) ?\#)

What for?  

> or (function (lambda elimination, but they're not applied.

IIRC, Function-lambda is required for older byte-compilers to compile lambdas.

> Apart from these, it's by far the best perl mode ever!!!  I've tried it on
> many of my scripts, they look real good!  In one I even found this bummer,
> which gets the s wrong but never the less falls back on it's feet -- cool:
> 
> ($opt_s ? " ; $File::Find::name\n " : '')

With a correct setting of cperl-under-is-char the highlighting should
be correct.  The syntaxification should not care about
cperl-under-is-char now...

Ilya

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

end of thread, other threads:[~2003-02-20 20:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-10  3:20 Is this a bug in cperl mode Harry Putnam
2003-02-10  9:29 ` Kai Großjohann
2003-02-10 10:14   ` Daniel Pfeiffer
2003-02-11  1:23     ` Unknown
2003-02-11  2:04       ` Unknown
2003-02-10 15:50   ` Harry Putnam
2003-02-10 16:11     ` Harry Putnam
2003-02-10 21:07       ` Daniel Pfeiffer
2003-02-16  1:30         ` Ilya Zakharevich
2003-02-16  1:28       ` Ilya Zakharevich
2003-02-10 21:26     ` Daniel Pfeiffer
2003-02-11 21:21   ` Daniel Pfeiffer
2003-02-16  2:56     ` Ilya Zakharevich
2003-02-17  8:04       ` Daniel Pfeiffer
2003-02-17 19:33         ` Ilya Zakharevich
2003-02-17  7:56     ` CPerl mode v5.0 Ilya Zakharevich
2003-02-17 19:50       ` Ilya Zakharevich
2003-02-20  0:00         ` Daniel Pfeiffer
2003-02-20 20:26           ` Ilya Zakharevich

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.