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

My cperl-mode used to be awesome, until a feature was added, that introduced a behavior that is extremely undesirable to me. I am referring to expansion of a word (such as "if"), into a full blown statement. It would have been acceptable, if it was used for typing new code, as opposed to editing old code. As it stands, if I replace, say, "else" with "elsif", suddenly elsif is expanded to elsif( ) { } and it becomes a total mess. In short, I want to disable any expansion in cperl-mode, or perhaps just get a better mode. I spent at least 30 hours googling and setting cperl-electric-keywords and related variables, to NO avail. Any idea? How can I disable expansion in cperl-mode? Thank you!!!!!!!!!!!1
  • Comment on Emacs: How to disable expansion of cperl-mode ?

Replies are listed 'Best First'.
Re: Emacs: How to disable expansion of cperl-mode ? (EMACS)
by LanX (Saint) on Oct 11, 2010 at 22:08 UTC
    did you activate cperl-hairy?

    try C-h v cperl-hairy to check the variable, for me it's nil (deactivated)

    cperl-hairy is a variable defined in `cperl-mode.el'. Its value is nil Documentation: *Not-nil means most of the bells and whistles are enabled in CPerl. Affects: ... `cperl-electric-keywords' ...

    alternatively you could switch off "abbrev-mode"!

    Uses `abbrev-mode' to do the expansion.

    UPDATE:

    Interactively M-x cperl-toggle-abbrev should always do and is also accessible via clicking the menu Perl / Toggle / Electric Keywords or by shortcut C-c C-k!

    Cheers Rolf

      Could you give some feedback?

      Thank you!!!!!!!!!!!1

      Cheers Rolf

Re: Emacs: How to disable expansion of cperl-mode ?
by bluescreen (Friar) on Oct 11, 2010 at 20:14 UTC

    I think the problem is not cperl-mode, it looks more like you have yasnippet installed and binded to the TAB key, try disabling yasnippet ( or even uninstalling it ). With M-x yas/minor-mode-off

      bluescreen, I do not have yasnippet or any function starting with yas*.