Another snippet from my .emacs file. The wiki engine I maintain (Oddmuse) is written in Perl. Some time ago I decided that CPerl Mode was better than Perl Mode. I don’t quite remember why.
The important part is that C-h f calls up Perl documentation instead of Emacs Lisp docs.
;;; perl (add-to-list 'auto-mode-alist '("\\.pl\\'" . cperl-mode)) (add-to-list 'auto-mode-alist '("\\.t\\'" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode)) (add-hook 'cperl-mode-hook (lambda () (local-set-key (kbd "C-h f") 'cperl-perldoc)))
I guess I still have much to learn about CPerl Mode. Maybe I should start with `(setq cperl-hairy t)`. Any other suggestions?
An alternative would be to defalias perl-mode to cperl-mode. The reason I’m not doing this is that my solution allows me to switch back to Perl Mode if the need arises. It never happened, but it’s exactly the kind of thing I like to avoid. I try to restrict my use of defalias to the creation of new symbols. No overwriting of existing stuff except for obvious things like `(defalias 'yes-or-no-p 'y-or-n-p)`.
#Emacs