jrockway / cperl-mode

cperl-mode with 5.10 fixes, mx-declare support, perl6 support, etc.
102 stars 33 forks source link

M-x cperl-etags is broken: (wrong-type-argument stringp cperl-sub-regexp) #56

Closed HaraldJoerg closed 4 years ago

HaraldJoerg commented 4 years ago

Just open a Perl source in Emacs with cperl-mode and try to create tags with M-x cperl-etags, and you get the error (wrong-type-argument stringp cperl-sub-regexp).

Looking at the source code reveals: In this particular case, "sub" can't be replaced by inserting cperl-sub-regexp: 1) the list as a whole is quoted, so the symbol is passed "as is" to call-process (causing the error), and 2) unlike with other occurrences of cperl-sub-regexp, the regexp here isn't concatenated from components, so the argument list to etags would be invalid anyway.

That piece of code has also been already merged into the master branch of emacs (so also broken there). Do you synchronize with patches over there - or is it the other way around?

renormalist commented 4 years ago

Can you please provide it as patch? I'm happy to merge here but don't have resources to work on it on my own. And @jrockway isn't active on it either.

There is no sync from "master" into here as I and others never found out where "master" actually is. Some people were even under the impression this here would be it. :-)

HaraldJoerg commented 4 years ago

cperl-mode comes with emacs, so the master I'm talking about is in the Emacs Git repository. Stefan @monnier, who is one of the maintainers, wrote about it here.

The Emacs maintainers have done quite some work on cperl-mode with adaption to newer Emacs versions, eliminating deprecated stuff and warnings, and bug fixing which is missing in this repository. So, I switched over to their repository for my further work. Anyway, I've prepared a PR.

choroba commented 4 years ago

@HaraldJoerg I'm confused. Should I use your GitHub repo for PRs and issues, or just send bugs to the Emacs bug tracker with the cperl-mode mentioned somewhere in the Subject?

monnier commented 4 years ago

@HaraldJoerg I'm confused. Should I use your GitHub repo for PRs and issues, or just send bugs to the Emacs bug tracker with the cperl-mode mentioned somewhere in the Subject?

If you use Emacs's own cperl-mode, then M-x report-emacs-bug RET is the right way to report bugs, request enhancements, and submit patches.

    Stefan
renormalist commented 4 years ago

Yes, let's move over to @monnier 's repo at savannah.

HaraldJoerg commented 4 years ago

I agree with @monnier and will update my repository's README.md accordingly. I consider my repository for "experimental" stuff - preparing the way to support Perl features which haven't even been agreed upon (in particular, Cor).

choroba commented 4 years ago

Sorry to hijack this issue to discuss this, but... The official cperl-mode seems to behave quite differently. For example, compare the faces of the following simple statement:

HaraldJoerg commented 4 years ago

I can confirm this.

This came with a fairly recent change d0ad6306727 in the Emacs repository, intended to fix bug#22867.

Are there more differences (except from the same issue with hashes)? In that particular case, a comment in Emacs' bug tracker would be the way to go.

HaraldJoerg commented 4 years ago

The issue with misleading fontification of array and hash declarations has now been fixed in the Gnu Emacs repository. It is still different from the old version because %d is not (and should not) be fontified in e.g. printf ("%d", $$).

choroba commented 4 years ago

Thanks for the information. I'm switching my local cperl-mode to the Gnu version.