Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Xemacs color code

by Win (Novice)
on Nov 05, 2003 at 11:39 UTC ( #304693=perlquestion: print w/replies, xml ) Need Help??

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

Dear monks,

How do I colourise perl script in Xemacs?

Replies are listed 'Best First'.
Re: Xemacs color code
by EvdB (Deacon) on Nov 05, 2003 at 11:43 UTC
    First put xemacs into perl mode
    ^M x perl-mode
    and then switch on the syntax highlighting
    ^M x font-lock-fontify-buffer
    You can do this from the menus at the top too using: Options -> Syntax Highlighting -> Least.

    ^M x means 'meta-key' + 'x' key at the same time.

    --tidiness is the memory loss of environmental mnemonics

      Personally I prefer cperl-mode over the (IIRC) older perl-mode.

      Place the following in your ~/.emacs or ~/.xemacs/init.el file to have (X)Emacs automatically turn on cperl mode for perl scripts:

      ;; Use cperl-mode instead of the default perl-mode (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-m +ode)) (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))

      You might also want to put

      ;; Turn on paren matching and font-lock for all modes (global-font-lock-mode t) (show-paren-mode t)
      In your .emacs too.

      If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
      That way everyone learns.

Re: Xemacs color code
by batkins (Chaplain) on Nov 05, 2003 at 17:09 UTC
    XEmacs automatically puts Perl scripts into cperl-mode. To enable text-coloring universally, just use font-lock-mode. You could even put it in ~/.xemacs/init.el.
    Are you sure it was a book? Are you sure it wasn't.....nothing?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://304693]
Approved by EvdB
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-08-21 10:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found