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

I recently have started using emacs and cperl-mode in it. I have electric parens enabled. My question is how does one get to the right of the last paren easily after typing the text inside of the parens? I know about C-c C-j for going to the next line but I just want to move to the right of the last paren.

I've been using C-e (or C-f) but thought there must be a better way.

Thanks.

  • Comment on Emacs, cperl and electric parens question

Replies are listed 'Best First'.
Re: Emacs, cperl and electric parens question
by igelkott (Priest) on Dec 11, 2007 at 22:19 UTC
    Getting outside of the "last" parenthesis would probably take some lisp code but getting outside the current parenthetical enclosure is forward-list, which is normally bound to C-M-n (Control Meta n).

    I guess the lisp code to get to the last (enclosing) parenthesis wouldn't be too difficult (for a lisp programmer ... which I am not). I'd probably try a recursive call to forward-list + forward-char until forward-char fails.

    As an extra pointer, you might get something from "paredit" of Lisp mode. There are a few other parenthesis functions like M-) and Esc-) but they've never worked as I'd expect.