Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

c-perl mode on Emacs

by why_bird (Pilgrim)
on Oct 24, 2008 at 08:50 UTC ( [id://719289]=perlquestion: print w/replies, xml ) Need Help??

why_bird has asked for the wisdom of the Perl Monks concerning the following question:

I've been using Emacs for a while now, and I currently use perl-mode for all my perl syntax highlighting needs. I've been looking for a way to change the default indentation of perl-mode, and nearly all the documentation I could find online said very little about perl-mode, and just said (I'm paraphrasing) "perl-mode screws up perl highlighting, cperl-mode is MUCH better, everyone sensible uses cperl-mode"

So I think to myself 'well, you're a sensible person on occaision, why not give this "cperl-mode" another go?' I've looked at it briefly before but it was so alien (not to mention ugly) that I discarded it there and then. One of the major reasons I discarded it before was that I don't seem to have any problems with perl-mode. This almost certainly reflects my non-advanced perl code. But it does make me wonder:

  • What is so great about c-perl mode?
  • What is so backwards and stupid about perl-mode? What does it struggle with?
  • Why doesn't cperl-mode highlight variables in for loops, subroutine calls (with the &sub(arg) syntax), and why are 'my' and 'our' the same colour as if, for, while etc.?
  • I like (or rather I am used to) perl-mode highlighting and I think cperl-mode is ugly!

I know this last point is shallow, but I find the array and hash highlighting distracting, and the variable highlighting within comments annoying. I've managed to change some of these things in the customisation buffer, but by no means all of them. I don't mind fiddling around to make things prettier, but I want to know it's going to be worth it!

This wasn't meant to be quite so much of a rant..! If cperl-mode is so good, I want to be able to like it, and use it without it frustrating me.. so if anyone has any answers to these questions or any resources I can use to help me fiddle with it (I am VERY lisp ignorant but willing to learn, though don't seem to have any luck with getting hold of a working interpreter) then I'd be grateful. So here is chance for any cperl-mode fanatics out there to convert me :)
why_bird
........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......

Replies are listed 'Best First'.
Re: c-perl mode on Emacs
by MidLifeXis (Monsignor) on Oct 24, 2008 at 14:24 UTC

    Out of the box, cperl-mode seems to fit my indentation style much more closely. Fewer customizations means lessfewer things to synchronize across more machines.

    Poor reason, I know, but it is what it is :-)

    --MidLifeXis

      Yes, mine too actually. Perhaps I will yet become a convert..
      ........
      Those are my principles. If you don't like them I have others.
      -- Groucho Marx
      .......
Re: c-perl mode on Emacs
by Anonymous Monk on Oct 24, 2008 at 10:07 UTC

      I too can google!
      a) that was pretty much the entire documentation I managed to find on perl-mode
      b) for a lot of unsubstantiated claims like 'cperl-mode is so much better than perl-mode, tbh I was expecting worse problems, and ones that couldn't be fixed, albeit with a slightly unsightly hack...

      ........
      Those are my principles. If you don't like them I have others.
      -- Groucho Marx
      .......
        ...ones that couldn't be fixed, albeit with a slightly unsightly hack...
        What could be more moronic than writing useless comments just so your retarded syntax-highlighter doesn't break? I don't want to break my hammer, so I'm using this here screwdriver for my nails.
Re: c-perl mode on Emacs
by LanX (Saint) on Nov 16, 2008 at 14:15 UTC
    hmm I don't know if this thread is already dead ...

    I aggree that the default highlighting faces of cperl-mode are not the best and needs adjustment.

    Anyway cperl-mode offers plenty of "IDE-like" extras, I have not found in perl-mode. Just have a look at the extra "Perl" menu. Furthermore you will IMHO find lots more of support and compatible minor-modes AND even alternative highlighting-configs in the web, since it's based on c-mode.

    Cheers LanX

    - - - - - Which song???

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://719289]
Approved by ccn
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found