开发者

Set default Language Enviroment in Emacs

I am writing a Perl program in GNU emacs without the file extension .pl or .pm. Is there a way I can set the language environment to Perl without having to开发者_如何学Python change the file extension?


Put the comment

# -*- perl -*-

in the first (or second if you have the interpreter in the first line) line of your file. If you do so it will open in perl mode next time you open it.


You can with the following,


  (setq auto-mode-alist
        (append '(("\\.pl$"       . perl-mode)
                  ("\\.pm$"       . perl-mode)) auto-mode-alist))


You can set the mode:

M-x perl-mode
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜