5

In cperl-mode I am able to change the array and hash faces with M-x customize-group RET cperl-faces RET, and change Cperl Hash Face and Cperl Hash Face. But I can not see any option for changing the scalar variables color.

I have tried to change font-lock-variable-name-face both inside the code or from Cperl Ps Print Face Properties (where I really want to change the color is in the print) but It does not work. I have tried several cperl-modes from 4.32 to the rockway-perl6-branch.

Also I would like not to have the $ colored in the variables, therefore the sigil would stand out better in the printouts (this was asked already here but not resolved).

could someone provide me any hints?

Community
  • 1
  • 1
Pablo Marin-Garcia
  • 4,151
  • 2
  • 32
  • 50
  • 3
    Emacs - when you want to have an excuse to hack on settings, read your e-mail, browse the web, or do fun LISP hacking, instead of actually coding your project :) – DVK Dec 13 '10 at 16:46
  • Emacs would be a great OS if only it had a usable text editor. :) (I kid. I love Emacs.) – friedo Dec 13 '10 at 17:01

2 Answers2

2

Well, first you'd have to modify cperl-mode to fontify scalar variables. It only highlights arrays and hashes. It doesn't apply any face to scalars, except in certain constructs like my.

cjm
  • 61,471
  • 9
  • 126
  • 175
  • Well, this is where I headed for, but I didn't find a trivial place to patch. My hope was that options like `Highlight Variables Indiscriminately` are working on scalar variables: `Currently only changes how scalar variables are highlighted. Note that that variable is only read at initialization time for the variable `perl-font-lock-keywords-2'`. But I don't know which part of cperl-mode should I modify. – Pablo Marin-Garcia Dec 13 '10 at 21:59
0

I know the question is old but as I searched for this too I want to post my solution: either run M-x customoize-group and set cperl-highlight-variables-indiscriminately to t or just edit your .emacs manually.

Thaodan
  • 107
  • 1
  • 3
  • 10