开发者

Set default Language Enviroment in Emacs

开发者 https://www.devze.com 2023-03-28 16:06 出处:网络
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

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

精彩评论

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