(Ilya?) cperl-mode.el and strings like ||""$foo""|| *within a string*?

D

David Combs

subject: (Ilya?) cperl-mode.el and strings like ||"\"$foo\""|| *within a string*?



The following lines, to me, seem absolutely identical.

But stick them into a file foo.pl, with cperl-mode, and I find
here on my computer that although when you put the cursor
on the right-paren just before the semicolon, it will
(a) (properly) turn both it and the matching left-paren green,
(b) except not on the sixth one (and beyond).

| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");
| print("\$aryOfAliasObjRefs[\$numAliases]->{name} is \"");


But what's different between the 5th and 6th line? I say nothing is
different between them.

Likewise, ediff-buffers agrees (when I take the two lines and put them
into two files, one line each).

I HAVE NO CLUE AS TO WHAT IS HAPPENING!

Does anyone?

Thanks!

David

PS: Anyone knonw how to find out what version of eg cperl-mode
a buffer is using? Or where the .el-file was actually found?

(No, I don't mean to just look at .../lisp/cperl-mode.el --
suppose you've also done a M-x load-file for one located in eg your
own directory -- and you aren't sure just where the one
actually being used came from, and want to find out precisely.)
 
D

David Combs

[A complimentary Cc of this posting was sent to
David Combs
subject: (Ilya?) cperl-mode.el and strings like ||"\"$foo\""|| *within a string*?



The following lines, to me, seem absolutely identical.

But stick them into a file foo.pl, with cperl-mode, and I find
here on my computer that although when you put the cursor
on the right-paren just before the semicolon, it will
(a) (properly) turn both it and the matching left-paren green,
(b) except not on the sixth one (and beyond).

What happens if you explicitly do M-C-b? [I do not have auto-match
set on, so I can't check your symptoms; I do not see anything strange
here, with 21.2.1 and my CPerl.]
PS: Anyone knonw how to find out what version of eg cperl-mode
a buffer is using? Or where the .el-file was actually found?

Look in the CPerl menu (but I'm not sure that Emacs maintainers bother
to change it). locate-library.

The first thing to check is whether the errors persist with my version
of cperl-mode ($CPAN/emacs or some such).

Hope this helps,
Ilya

Well, that program-piece I posted was full of syntax (and semantic!) errors.

Anyway, I do tend to find that "\" within strings sometimes confuse
cperl-mode.

Ditto for within qq!...! strings.

But then sometimes it works fine!

Maybe totally *my* fault, or maybe some once-in-a-while glitches
in cperl-mode.

Here's something from my .emacs:

(if (y-or-n-p "Load in /dkcjunk/cperl-mode.el?")
(progn
(load-file "/dkcjunk/cperl-mode.el")
(setq have-returned-from-loading-file-dkcjunk--cperl-mode-el 1)))

I just checked (C-h v) on that "have-returned..." variable, shows "1").

Again, would be nice if your (well, all!) versions of cperl-mode had
a setq-variable that showed the version-number (and last-modified-date?)
for the version.

Nifty function you mentioned: locate-library.

Unfortunately, it's independent of how the various libraries
were *actually* loaded.

What would be nice would be a (optional?) feature that,
for *every* library loaded-in, would remember *the actual
command that read it in*. (And it'd have to be a list for
each one, since a *later* load-library (or whatever other
mechanism) *overrode* that prior one!)


---

<rant on need for macros>

For debugging something I'm writing (perl), I often have
lots of statements like:

print("value of \$myVar1 is \"$myVar1\".\n");
print("value of \$myVar2 is \"$myVar2\".\n");
print("value of \$myVar3 is \"$myVar1\".\n");
...
...

God!, if we had macros (built-into perl), doing that
would be *so* simple -- via eg showval($myVar1), etc,
with all the backslashes and quotes etc generated by
the MACRO!

Why the perl-honchos so *hate* macros is a real puzzle
to me!

Alas!

</rant on need for macros>


Thanks for the reply, Ilya!

David
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
David Combs
Anyway, I do tend to find that "\" within strings sometimes confuse
cperl-mode.

Care for an example?

Yours,
Ilya
 
R

Radomir Hejl

Again, would be nice if your (well, all!) versions of cperl-mode had
a setq-variable that showed the version-number (and last-modified-date?)
for the version.

Type C-h v cperl-mode, at least for my GNU emacs 21.3.1 on windows.
Or through menu Perl/Micro-docs/CPerl version.

Radek H.
 
D

David Combs

Type C-h v cperl-mode, at least for my GNU emacs 21.3.1 on windows.
Or through menu Perl/Micro-docs/CPerl version.

Radek H.

Thanks!



I do that, and get these 4 possible completions (to cperl-mode-)
cperl-mode-{abbrev-table,map,hook,syntax-table} --
nothing for just plain cperl-mode.

For those four, C-h v finds nothing like a version-number -- just
that I can customize it, etc.

David
 
R

Radomir Hejl

Type C-h v cperl-mode, at least for my GNU emacs 21.3.1 on windows.
Thanks!



I do that, and get these 4 possible completions (to cperl-mode-)
cperl-mode-{abbrev-table,map,hook,syntax-table} --
nothing for just plain cperl-mode.

For those four, C-h v finds nothing like a version-number -- just
that I can customize it, etc.

David
Sorry for misleading, it should've read C-h v cperl-version.
Radek H.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top