Questions tagged [cperl-mode]

`cperl-mode` is an Emacs mode for editing Perl that expands on the functionality of `perl-mode` and provides a variety of IDE-like editing, reference, and navigation functions.

cperl-mode is an Emacs mode for editing Perl that expands on the functionality of perl-mode and provides a variety of IDE-like editing, reference, and navigation functions.

cperl-mode offers:

  • Access to local perldoc-format documentation
  • Improved syntax highlighting vs. basic perl-mode
  • A wider variety of formatting options for Perl code
  • Automatic expansions of common constructs such as if, else, and while
  • Better integration of POD documentation in Perl modules
26 questions
9
votes
4 answers

Can I use cperl-mode with perl-mode colorization?

The Emacs cperl-mode seems to get confused less than perl-mode, but the Skittles effect makes the thing unusable for me. Does anyone have or know of an example of a .emacs block that causes cperl-mode to use the colorization from perl-mode, ideally…
Zed
  • 3,457
  • 3
  • 20
  • 21
8
votes
3 answers

How can I make emacs' cperl-mode indent all statement continuations by only one level?

In emacs' cperl-mode, lines that continute a statement from a previous line are indented by one level: my $var = (1+1) * (2+2) / (3+3); However, if the statement does not begin at zero indentation because it is inside a block, then if you…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
8
votes
1 answer

Emacs cperl - indentation in constant block

I'm running Aquamacs 3.0a based on GNU Emacs 24.3.50.2. cperl-version is 6.2. When I edit a Perl constant block I get extra indentation that I don't want:- use constant { ONE => 1, TWO => 2, THREE => 3, }; What I want is…
kbro
  • 4,754
  • 7
  • 29
  • 40
6
votes
1 answer

How do I adjust cperl mode indentation in Emacs to match Moose examples?

How can I set up cperl mode in Emacs so that the indentation after brackets, e.g. has 'name' => ( is => 'rw', isa => 'Str', required => 1, ); (default indentation)…
user181548
6
votes
2 answers

Can I customize the indentation of ternary operators in emacs' cperl-mode?

In emacs cperl-mode, ternary operators are not treated specially. If you break them over multiple lines, cperl-mode simply indents each line the same way it indents any continued statement, like this: $result = ($foo == $bar) ? 'result1' : …
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
5
votes
1 answer

Is it possible to highlight interpolated perl variables in emacs?

Recently I've started using emacs and after overcoming a number of hurdles in making cperl-mode operate in a way that is agreeable I've become stumped by this problem. Currently I have all scalars in regular use being highlighted except for where…
Errorific
  • 53
  • 3
4
votes
3 answers

ISO Emacs [C]Perl-mode colorize hash references like hashes

I still use Perl, some new code, and maintaining old code. I use emacs and cperl-mode. I like syntax coloring. At first (many years ago) I disliked cperl-mode's special coloring of arrays and hashes, but it has grown on me. To the point where I…
Krazy Glew
  • 7,210
  • 2
  • 49
  • 62
4
votes
3 answers

Turn off auto-indent in perl-mode emacs

When I use Emacs, I turn of any auto indentation and use a custom indentation scheme (keep indentation of previous line, only using spaces). In c-mode I just used C-c C-l to turn off electric mode. But in perl-mode I'm not sure how to achieve the…
rhlee
  • 3,857
  • 5
  • 33
  • 38
4
votes
2 answers

Syntax highlight for perl in Emacs is broken, is there a fix?

I'm a perl programmer and a new emacs user. I'm under Windows, using cperl-mode for editing perl. Emacs version is 24.2.1. Here's a screenshot with some sample code: (source: breqwas.net) Obvious bug: it highlights arrays, hashes and non-quoted…
Artyom V. Kireev
  • 588
  • 4
  • 12
3
votes
1 answer

How do I keep braces from moving in Emacs cperl mode?

I'm using GNU Emacs 22.2.1 and cperl 5.23. I have perl code like this: sub foo { if($x) { print "x"; } else { print "y"; } } I'd like to reindent the code to a 2-space indent. But when I run cperl-indent-region…
bstpierre
  • 30,042
  • 15
  • 70
  • 103
3
votes
1 answer

Document mutually exclusive defines

I'm writing a small program in C and I want to document it so others could change some details. I wrote a config.h file with #defines that enable some operation or not, some of them are mutually exclusive, others aren't. Example of not mutually…
andyinno
  • 1,021
  • 2
  • 9
  • 24
2
votes
2 answers

associating cperl-mode with Perl code in emacs

I am trying to associate CPerl mode with Perl source files in emacs (23.1.1 on CentOS 6). If I include the following line in my .emacs (defalias 'perl-mode 'cperl-mode) then CPerl mode will be loaded when a Perl source file is opened. However, the…
roadrider
  • 339
  • 3
  • 7
2
votes
2 answers

Emacs Pretty Symbols in cperl mode: :: must be surrounded my spaces

I'm using Emacs with PDE and cperl-mode. I really want prettify-symbols-mode to work with it. When just using perl-mode this happens: Mod::thing->new( {c => 'sea'} ); becomes Mod∷thing→new( {c ⇒ 'sea'} ); however when using cperl same expression…
CharJe
  • 41
  • 6
1
vote
1 answer

Emacs use inside qq in cperl-mode

I am using qq function to store my SQL requests in Perl. Like this: qq{ SELECT table1.name, table1.description FROM table1 WHERE table1.id=? } But in Emacs cperl-mode…
user4035
  • 22,508
  • 11
  • 59
  • 94
1
vote
5 answers

How do I stop auto-formatting in emacs cperl mode?

When I do indent-region in cperl-mode if ($x) { next; } Emacs reformats it to: if ($x) { next; } How can I make it stop doing that? Note: the question originally said that this reformatting happens when yanking. I have yank setup to…
mmccoo
  • 8,386
  • 5
  • 41
  • 60
1
2