Using Emacs 22 with CPerl mode and using cperl-hairy, with electric parentheses, after typing "if ", rather than this:

if () { }

I want to get this:

if ( ) { }

That is, I want extra space around whatever I put in the parens (with the point placed between the two spaces). Would be nice to get the same sort of behaviour for brackets and curlies (braces) too. Does anyone know how to get cperl mode to do that? I checked the CPerlMode page on the Emacswiki but didn't see anything that specific.

Seems like not having the extra space in there is too cramped, but might have to just get used to it because typing "Space Space C-b" all the time is beginning to wear on me. :)


In reply to Emacs CPerl mode electric parentheses: get extra space in there? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.