1. .elc 是 .el的编译文件,运行速度更快. Elisp source code can be byte-compile.
php-mode.el >> php mode.elc
2. 加载方式
a. 半路加载: M-x load file >> your file >> M-x php-mode
b. 启动就自动加载
If you want emacs to load the file when it starts,
(1) put the file in the dir ~/.emacs.d/lisp/
, (create that directory if it doesn‘t exist.)
(2) then put the following in your emacs init file:(.emacs)
;; Tell emacs where is your personal elisp lib dir (add-to-list ‘load-path "~/.emacs.d/lisp/") ;; load the packaged named php-mode. (load "php-mode") ;; best not to include the ending “.el” or “.elc”
3. 当打开文件自动激活模式: Auto-Activation of Mode When Opening File
;; setup files ending in “.js” to open in js2-mode (add-to-list ‘auto-mode-alist ‘("\\.js\\‘" . js2-mode)) --------------------------------------------------
What is the Purpose of 〔~/.emacs.d/〕 Path?
By convention, the ~/.emacs.d/
is a dir for all your personal emacs files. It is the default value of the variable user-emacs-directory. On Windows, the path is %HOMEPATH%/.emacs.d/
. 〔? Windows Environment Variables Basic Tutorial〕 Emacs 23 should have created this dir for you. If it‘s not there, you can just create it yourself.
By convention, the dir ~/.emacs.d/lisp/
is for packages you manually installed. (ELPA packages are installed at ~/.emacs.d/elpa/
)
-----------------------------------------------------