Caskã¯ããå¤ããããããã¯El-Get - ãã¾ã©ãã®Emacsããã±ã¼ã¸ç®¡ç
ç§ä¼ã®ã¿ã¬ã¨ãªã£ãEmacsã®è¨å®ãgitで管理するãªã©ãã¦, è¤æ°ã®ç°å¢ã§åãè¨å®ã使ãããã«ããã®ã¯ããªãä¸è¬çã«ãªã£ã¦ãã¾ãã. ãã , 使ã£ã¦ããéæ¨æºããã±ã¼ã¸ãå«ãã¦ãã¡ãã¨ç®¡çãããã¨æãã¨ãã£ãã大å¤ã§ã. ã¨ãã«, 以ä¸ã®ãããªç¹ã¯ãã²ã¨ãå®ç¾ãããã¨ããã§ãã, (ããã¾ã§ã¯)ãªããªãé£ããé¨åãããã¾ãã.
- 使ã£ã¦ããããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ãèªååããã
- ãããããªé å¸å (GitHub, Emacs Wiki, å人Webãµã¤ã, etc.)ããã¤ã³ã¹ãã¼ã«ããã
- ãã¡ãã¨åããã¨ãããã£ã¦ããããã±ã¼ã¸ãã¼ã¸ã§ã³ã«åºå®ããã
- æ°ããããã±ã¼ã¸ãç°¡åã«è©¦ããã
- ããã±ã¼ã¸ã¨è¨å®ã®å¯¾å¿ãããããããããã
ãã®ç®çã®ããã«, æè¿ã¯Caskã使ãã®ãæµè¡ã£ã¦ããããã§ãã, ä¸ã«æãããã¤ã³ãããã¹ã¦è§£æ±ºãã¦ããããã§ã¯ããã¾ãã. çè ã®ã¾ããã§ã, Caskã使ã£ã¦ã¿ããæã£ããã¨ãã§ããªãã¦å°ã£ã, ã¨ãã話ãè¤æ°èãã¾ã. å ã ããã±ã¼ã¸ã®éçºæã«ä¾åããã±ã¼ã¸ã®ç®¡çãããããã«ä½ããããã®ã®ãããªã®ã§, ä»æ¹ãªãé¢ãããããããã¾ãã.
El-Getã¯, èªåã®Emacsã«ã¤ã³ã¹ãã¼ã«ããã¦ããããã±ã¼ã¸ã管çããç®çã§ä½ãããã ããã£ã¦ããæ¡ä»¶ãæºããã¦ããã®ã§ãã, é å¸å ã®ã¬ã·ãããã¡ãã¡æ¸ããªãã¨ãããªã(ã¨èª¤è§£ããã¦ãã), æ¸ãæ¹ããã¾ãç°¡åã«ã¯è¦ããªã, ãªã©ã®çç±ã§æ¬é ããã¦ããå°è±¡ã§ã. å ¬å¼ã¬ã·ãã«ç»é²ããã¦ããé å¸å ã, åºæ¬çã«ã¯ãã¼ã¸ã§ã³ç®¡çãããææ°ç(âéçºç)ãæå®ããããªã·ã¼ã§, å®å®çã®ã¿ã使ãããå ´åã«ã¯ãªã¼ãã¼ã¹ããã¯ã¨æããã¦ããã®ããããã¾ãã.
æè¿ã«ãªã£ã¦, (筆者によって)El-Getでも簡単な記法がサポートããã¦, ã¬ã·ãããã¡ãã¡æ¸ããã¨ããå®å ¨ã«è§£æ¾ãã, å®å®çã使ãæå®ãé常ã«ç°¡åã«ã§ããããã«ãªãã¾ãã. ããã«, (筆者による)関連ツールã使ãã°, ãã¼ã¸ã§ã³åºå®ãã³ãã³ãã©ã¤ã³ã§ã®æä½ãå¯è½ãªã°ããã, Caskãã¡ã¤ã«ããã®ã¾ã¾èªã¿è¾¼ããã¨ã¾ã§ã§ãã¾ã. æ¬ç¨¿ã§ã¯, CaskããEl-Getã«ä¹ãæããå ´åã®æ¹æ³ãå«ãã¦, El-Getã«ããããã±ã¼ã¸ç®¡çã®ãã¾ã©ãã®ããæ¹ã解説ãã¾ã.
- El-Getã¨Caskã®æ¯è¼
- El-Getã§ããã±ã¼ã¸ç®¡ç
- ããã±ã¼ã¸ç®¡çã®ã¯ã¼ã¯ããã¼
- ãã¼ã¸ã§ã³ã®åºå®
- ãã®ä»ã®Tips
- Caskã¨ãã¥ã¬ã¼ã·ã§ã³
- å©ç¨ä¾
- ãããã«
El-Getã¨Caskã®æ¯è¼
El-GetãCaskã§Emacsã®ããã±ã¼ã¸ã管çããå ´åã«é¢ãã¦, ãµãã¼ããããæ©è½ãæ´çãã¦ããã¾ã. æ¯è¼ã®ããã«Emacsã®æ¨æºããã±ã¼ã¸ç®¡çã·ã¹ãã (package.el
)ã«ã¤ãã¦ãè¼ãã¦ããã¾ã.
Emacsæ¨æº | El-Get | Cask | |
---|---|---|---|
VCSãã | Ã | â | â |
ç¹å®ãµã¤ããã | à | â | à |
ãã¼ã¸ã§ã³åºå® | à | â | â³ |
DSL | Ã | â | â |
ã³ãã³ãã©ã¤ã³ | â³ | â | â |
M-x å®è¡ |
â | â | â³ |
Emacs以å¤ã«ä¾åããªã | â | â | à |
è¨å®ç®¡ç | à | â | à |
ããã±ã¼ã¸éçºè åãæ©è½ | â³ | â³ | â |
El-Getã¯ã¾ããµãã¼ããã¦ããVCSã®ç¨®é¡ãè±å¯ã§ãã, å®éã«ã¯Caskããµãã¼ããã¦ããç¨åº¦ã§ååã§ããã. El-Getã®ããã¨ããã¨ãã¦ã¯, GitHubãGist, Emacsmirror, Emacs Wikiããã®ã¤ã³ã¹ãã¼ã«ã®å ´åã«ããç¨ã®ç°¡åãªæå®ã§æ¸ãç¹ãæãããã¾ã.
package.el
ã§ã¯ãã¼ã¸ã§ã³ãåºå®ããã¤ã³ã¹ãã¼ã«ãã§ããªããã, El-GetãCaskã§ãé
å¸å
ãELPAç³»*1ã®å ´åã¯ãã¼ã¸ã§ã³ãåºå®ã§ãã¾ãã. VCSããã®ã¤ã³ã¹ãã¼ã«ã®å ´åã¯, El-Get, Caskã¨ãã«ããã±ã¼ã¸ãã¨ã«ã²ã¨ã¤ã²ã¨ã¤ãªãã¸ã§ã³ãæå®ãããã¨ã§ãã§ãã¯ã¢ã¦ããããã¼ã¸ã§ã³ãåºå®ã§ãã¾ãã, ããã¯é常ã«é¢åã§ã. ããã«æªããã¨ã«Caskã§ã¯æ¨æºã§é¸æãããé
å¸å
ãELPAç³»ã§, VCSããã®ã¤ã³ã¹ãã¼ã«ã«ã¯ããã±ã¼ã¸ã®URLãæå®ããå¿
è¦ãããã¾ã. El-Getã¯, å
¬å¼ã¬ã·ãã®é
å¸å
ãã»ã¨ãã©ã¯VCSã«ãªã£ã¦ãããã, ãã®ç¹ã¯ãã¾ãåé¡ã«ãªãã¾ãã. ããã«, el-get-lockã¨ããããã±ã¼ã¸ã使ããã¨ã§, Rubyã®Gemfile.lock
ãPerlã®cpanfile.snapshot
ã®ãããªæè¦ã§ãã¼ã¸ã§ã³ãåºå®ãããã¨ãã§ãã¾ã. (ãã¨ã§è©³ãã解説ãã¾ã.)
Caskã§ã¯, DSLãã³ãã³ãã©ã¤ã³ã§ã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ãæå®ã§ãã¾ã. El-Getã§ã¯ããããel-get-caskã¨el-get-cliã使ãã¨åæ§ã®ãã¨ãå¯è½ã§ã. (ãã¨ã§è©³ãã解説ãã¾ã.)
El-Getã§ã¯, Emacsä¸ã§M-x command
ã§ããã±ã¼ã¸ã®è¿½å /åé¤/æ´æ°ãã§ãã¾ã. Caskã«ãã®æ©è½ã¯ããã¾ãã*2. El-Getã§ã¯M-x
ã§ã®å¯¾è©±çãªã¤ã³ã¹ãã¼ã«ã¯éåæã§å®è¡ãããã, ã¤ã³ã¹ãã¼ã«ä¸ãä½æ¥ã®æãæ¢ããå¿
è¦ãããã¾ãã.
El-Getã¯ããã±ã¼ã¸ã®é
å¸å
ã®VCSãæ±ãããã®ã³ãã³ã(git
ã³ãã³ãç)以å¤ã«å¤é¨ã³ãã³ããå¿
è¦ã¨ãã, Emacsã ãããã°æä½éåä½ãã¾ã. ãã¼ãã¹ãã©ãããEmacs Lispã§æ¸ãããã, Emacsè¨å®ãã¡ã¤ã«ãèªã¿è¾¼ãã ãã§El-Getãã®ãã®ã®ã¤ã³ã¹ãã¼ã«ã¾ã§æ¸ã¾ãããã¾ã. Caskã§ã¯ãªããããã±ã¼ã¸ç®¡çã®ã³ãã³ãã®å®è¡ã«python
ãå¿
è¦ã«ãªãã¾ã. å®éã®å¦çã¯Emacs Lispã§æ¸ããã¦ãã¾ãã, ã³ãã³ãããèµ·åããé¨åã ãPythonã§æ¸ããã¦ããã¨ããããããªè¨è¨ã§ã. ããã«æªããã¨ã«, Caskãã®ãã®ã®ã¤ã³ã¹ãã¼ã«ããã¼ãã¹ãã©ããããã¹ã¯ãªãããPythonã§æ¸ããã¦ããã®ã§, Emacsè¨å®ãã¡ã¤ã«ã§Caskã®ã¤ã³ã¹ãã¼ã«ã¾ã§å®çµãããã®ã¯å®¹æã§ã¯ããã¾ãã*3.
El-Getã¯è¨å®ãã¡ã¤ã«å ã§å¿ è¦ãªããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ã¾ã§æ示ãããã¨ãå¼·ãæèãã¦ãããã, ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¦ããã(ã¤ã³ã¹ãã¼ã«ã«æåããã)å®è¡ããè¨å®ãå®ç¾©ã§ãã¾ã. ããã¯å¥ã®ãã¡ã¤ã«ã«åé¢ãããã¨ã, ã¤ã³ã¹ãã¼ã«ã®æ示ã¨åãå ´æã«æ¸ããã¨ãã§ãã¾ã. (ãã¨ã§è©³ãã解説ãã¾ã.)
Caskã®å¯ä¸ã®å©ç¹ã¯, ããã±ã¼ã¸éçºè ãéçºä¸ã®ããã±ã¼ã¸ã®ä¾åããã±ã¼ã¸ã管çããã, (ãã¹ãçã®ããã«)ä¾åããã±ã¼ã¸ããã¼ãã§ããç¶æ ã®å®è¡ç°å¢ãæ´ãããããæ©è½ã§ããã. Caskã¯æ¬æ¥ãã®ç®çã®ããã«åå¨ãã¦ãã¾ã. ã¨ã¯ãã, Emacsã«å ããåãã£ã¦ããããã¿ã使ã£ãå®è¡ç°å¢ã®éé¢ã®æ¹æ³(ãã¨ã§è©³ãã解説ãã¾ã)ãªã©ã使ãã°ããã¦ãã®ãã¨ã¯äºè¶³ããã®ã§, Caskã«ããæ¯æ´ã¯ããã»ã©éè¦ã§ã¯ããã¾ãã. ãããEmacs Lispã«ããéçºã«Pythonãå¿ è¦ã«ãªãç¹ã¯ããã±ã¼ã¸éçºè ã¨ãã¦ã¯è¦éããã¾ãã. Emacsã§ã§ãããã¨ã¯Emacsã ãã§ããã¹ãã§ã.
El-Getã§ããã±ã¼ã¸ç®¡ç
El-Getã¯ãã ãã®ã¾ã¾ä½¿ã£ã¦ã¿ããã¨ãã§ãã¾ãã, ããã§ã¯Emacsã®è¨å®ãã¡ã¤ã«(~/.emacs.d/init.el
ãªã©)ã«è¨å®ãæ¸ãã¦, è¤æ°ã®ç°å¢ã§è¨å®å
±æããå ´åã«ã¤ãã¦ã¨ãã«è§£èª¬ãã¾ã.
åæè¨å®
Emacsã®è¨å®ãã¡ã¤ã«(~/.emacs.d/init.el
ãªã©)ã®å
é ã«ä»¥ä¸ã®ããã«æ¸ãã¾ã.
(when load-file-name (setq user-emacs-directory (file-name-directory load-file-name))) (add-to-list 'load-path (locate-user-emacs-file "el-get/el-get")) (unless (require 'el-get nil 'noerror) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el") (goto-char (point-max)) (eval-print-last-sexp)))
æåã®2è¡ã¯ãã®è¨å®ãã¡ã¤ã«ãã©ããéé¢ããããã£ã¬ã¯ããªã«ç½®ãã¦è©¦ãããå ´åã«ã対å¿ããããã®è¨å®ã§, El-Getã¨ç´æ¥ã¯é¢ä¿ãã¾ãã. ãã¨ã§è©³ãã触ãã¾ãã, ãã®è¨å®ã¯El-Getã使ããã©ããã«ããããã£ã¦ããã¹ãã§ã. ãã ã, ãã®æ¹æ³ã§ã¯Emacsè¨å®ãã¡ã¤ã«ãEmacsãã£ã¬ã¯ããªä¸ã«ç½®ãå¿
è¦ãããã®ã§~/.emacs
ã~/.emacs.el
ã¯è¨å®ãã¡ã¤ã«ã¨ãã¦ä½¿ãã¾ãã. (~/.emacs
ã ã¨ãªã«ããããã¨ãããããã§ããªãã®ã§~/.emacs.d/init.el
ã使ããã¨ããããããã¾ã.)
æ®ãã¯, El-Getãã¤ã³ã¹ãã¼ã«ããã¦ããã°ãããæå¹åã, ããã§ãªããã°GitHubãããã¦ã³ãã¼ããã¦ã¤ã³ã¹ãã¼ã«ããããã®ãã®ã§ã. El-Getãã®ãã®ãEmacsã®æ¨æºæ©è½ã®ã¿ãç¨ãã¦ã¤ã³ã¹ãã¼ã«ããã®ã§, ãããæ¸ãã¦Emacsãèµ·åããã ãã§El-Getãã¤ã³ã¹ãã¼ã«ãã使ããç¶æ ã«ãªãã¾ã.
ã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ãæå®
ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã«ã¯, Emacsè¨å®ãã¡ã¤ã«å
(ã®El-Getã®åæè¨å®ãããå¾)ã«(el-get-bundle ããã±ã¼ã¸å)
ã¨æ¸ãã¾ã. ãã¨ãã°, 以ä¸ã®ããã«æ¸ãã¨, Auto-Completeã¨Evilã®2ã¤ã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¾ã.
(el-get-bundle auto-complete) (el-get-bundle evil)
æ¢ã«ååã®å®è¡ã§ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã®å ´åã¯æ¹ãã¦ã¤ã³ã¹ãã¼ã«ããããã¯ãã¾ãã.
ã¤ã³ã¹ãã¼ã«å¯è½ãªããã±ã¼ã¸(ã¬ã·ããå®ç¾©ããã¦ããããã±ã¼ã¸)ã調ã¹ããã¨ãã¯, Emacsä¸ã§M-x el-get-list-packages
ã¨ããã¨ãªã¹ãã表示ããã¾ã*4. ããã§ãªã¹ãããã以å¤ã«ãELPAãMELPA, Emacs Wikiçã§æä¾ããã¦ããããã±ã¼ã¸ã¯, ãããã®é
å¸å
ã¿ã¤ããæå®ãããã¨ã§ã¤ã³ã¹ãã¼ã«å¯è½ã§ã.
é å¸å ãæå®ãã¦ã¤ã³ã¹ãã¼ã«
é
å¸å
ãELPAç³»ã«ãããå ´åã¯, ããã±ã¼ã¸åã®åã«elpa:
ãã¤ãã¾ã. 使ç¨ãããªãã¸ããªã¯, 主è¦ãªãã®ã¯èªåçã«è¨å®ããã¦ããã®ã§ã¨ãã«æå®ããå¿
è¦ã¯ããã¾ãã.
(el-get-bundle elpa:undo-tree)
ELPAç³»ã§é
å¸ããã¦ãããå
¬å¼ã¬ã·ãã«ããªããã®ã¯, 次ã®ç¯ã§è§¦ãã詳細ãªãã·ã§ã³ãéãã¦ç´°ããé
å¸å
ãæå®ããå¿
è¦ãããã¾ãã, ç¹å®ã®é
å¸å
ã®å ´åã¯ããç°¡åãªæå®ã§ã¤ã³ã¹ãã¼ã«å¯è½ã§ã. ãã¨ãã°, Emacs WikiãEmacsmirrorã§é
å¸ããã¦ããããã±ã¼ã¸ã¯, ããããããã±ã¼ã¸åã®åã«emacswiki:
, emacsmirror:
ãã¤ããã ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ã. ä»ã«, GitHubãGistããã®å ´åããããããªè¨æ³ã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ã.
GitHubããã¤ã³ã¹ãã¼ã«ãããå ´åã¯ææè
/ãªãã¸ããª
ãããã±ã¼ã¸åã®ä»£ããã«æå®ãã¾ã. ãã¨ãã°, tarao/el-get-lockãã¤ã³ã¹ãã¼ã«ããã«ã¯ä»¥ä¸ã®ããã«ãã¾ã.
(el-get-bundle tarao/el-get-lock)
å
é¨çãªããã±ã¼ã¸å(ãªã¹ãããã¨ããåé¤/æ´æ°ã®éã«æå®ããåå)ã¯ãªãã¸ããªåé¨åã«ãªãã¾ã. ãããªãã¸ããªåã¨ã¯å¥ã®ããã±ã¼ã¸åã«ãããå ´åã¯:name
ãªãã·ã§ã³ãã¤ãã¾ã. ãã¨ãã°, tarao/tab-group-elãtab-group
ã¨ããååã§ã¤ã³ã¹ãã¼ã«ããã«ã¯ä»¥ä¸ã®ããã«ãã¾ã.
(el-get-bundle tarao/tab-group-el :name tab-group)
Gistããã¤ã³ã¹ãã¼ã«ãããå ´åã¯gist:Gist ID:ããã±ã¼ã¸å
ãæå®ãã¾ã. ãã¨ãã°, gist:5019545ã®evil-tab-page
ãã¤ã³ã¹ãã¼ã«ããã«ã¯ä»¥ä¸ã®ããã«ãã¾ã.
(el-get-bundle gist:5019545:evil-tab-page :depends (evil elscreen))
ãã®å ´åã¯evil
ããã³elscreen
ã«ä¾åãã¦ããã®ã§:depends
ãªãã·ã§ã³ã«æå®ãã¾ã.
詳細ãªãã·ã§ã³ã¤ãã¤ã³ã¹ãã¼ã«
é
å¸å
ãä¾åããã±ã¼ã¸ãªã©ã®ç´°ããå¶å¾¡ãå¿
è¦ãªå ´åã¯è©³ç´°ãªãã·ã§ã³ã使ãã¾ã. ãªãã·ã§ã³ã¯:
ã§å§ã¾ããªãã·ã§ã³åã¨ãªãã·ã§ã³å¤ãããã±ã¼ã¸åã«ç¶ãã¦ä¸¦ã¹ããã¨ã§æå®ãã¾ã. ãã¨ãã°, :type
ãªãã·ã§ã³ã«github
, :pkgname
ãªãã·ã§ã³ã«tarao/elisp
, :features
ãªãã·ã§ã³ã«yaicomplete
ãæå®ãã¦, tarao-elisp
ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããå ´åã¯ä»¥ä¸ã®ããã«æ¸ãã¾ã.
(el-get-bundle tarao-elisp :type github :pkgname "tarao/elisp" :features yaicomplete)
使ç¨å¯è½ãªãªãã·ã§ã³ã®å®å
¨ãªãªã¹ãã¯el-get.info
ã®"Authoring Recipes"ã®ç« ãåç
§ãã¦ãã ãã(Emacsããã¯C-u M-x info RET
ã¨ãããã¨~/.emacs.d/el-get/el-get/el-get.info
ãæå®ããã¨èªãã¾ã). ããã§ã¯ãã使ããã®ã ãç´¹ä»ãã¾ã.
:type
- é
å¸å
ã®ç¨®é¡ãæå®ãã¾ã.
el-get/methods
ã«el-get-種é¡å.el
ã®ãã¡ã¤ã«ããããã®ãå©ç¨å¯è½ã§ã.:type
ãçç¥ããå ´å, åºæ¬çã«ã¯å®ç¾©æ¸ã¿ã®ã¬ã·ã(èªåã§ç¨æãã¦ããªãéãã¯å ¬å¼ã¬ã·ã)ã«å®ç¾©ãããé å¸å ã使ç¨ãã, ä»ã«æå®ãããªãã·ã§ã³ã¯å®ç¾©æ¸ã¿ã¬ã·ãã«ããæå®ãä¸æ¸ããã¾ã. éã«:type
ãæå®ããå ´åã¯å®ç¾©æ¸ã¿ã¬ã·ãããããã¨ç¡è¦ãã,:type
ã¨åæã«æå®ãããªãã·ã§ã³ã®ã¿ã使ç¨ããã¾ã.:type
ãçç¥ããå ´åã§å®ç¾©æ¸ã¿ã¬ã·ãããªãå ´åã§ãããã±ã¼ã¸åé¨åã:url
ãªãã·ã§ã³ãªã©ããé¡æ¨ã§ããå ´åã¯:type
ãèªåè¨å®ããã¾ã. :url
- é
å¸å
ã®URLãæå®ãã¾ã.
:type
ã«å¿ãã¦HTTPãGitãããã³ã«ãªã©ã®URLãæååã§(""
ã§å²ã£ã¦)æå®ãã¾ã. :pkgname
- Githubãªã©ã®é
å¸å
ã®å ´åã«, ãã®é
å¸å
ã§ã®ä½ç½®(
"ææè /ãªãã¸ããª"
ãªã©)ãæååã§(""
ã§å²ã£ã¦)æå®ãã¾ã. :depends
- ä¾åãã¦ããããã±ã¼ã¸ã®ååãæå®ãã¾ã. è¤æ°ããå ´åã¯
()
ã§å²ãã§ä¸¦ã¹ã¾ã. :features
- ããã±ã¼ã¸ã¤ã³ã¹ãã¼ã«å¾ã«
require
ããããã®ãæå®ãã¾ã. è¤æ°ããå ´åã¯()
ã§å²ãã§ä¸¦ã¹ã¾ã. :branch
- é
å¸å
ãVCSã®å ´åã«, ç¹å®ã®ãã©ã³ããé¸æãã¾ã. æååã§(
""
ã§å²ã£ã¦)æå®ãã¾ã. :checkout
- é
å¸å
ãVCSã®å ´åã«, ç¹å®ã®ã³ãããçãé¸æãã¾ã. æååã§(
""
ã§å²ã£ã¦)æå®ãã¾ã.
ããã±ã¼ã¸ã®è¨å®
El-Getãããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã©ã¨ãã¦ã®ã¿ä½¿ãããã±ã¼ã¸ã®è¨å®ã¯å¾æ¥éãã«æ¸ã, ã¨ããå ´åã¯ãã®ç¯ãèªãå¿ è¦ã¯ããã¾ãã. è¨å®ãããã±ã¼ã¸ãã¨ã«ãããããã管çãããå ´åã«åèã«ãã¦ãã ãã.
ããã±ã¼ã¸ãã¨ã®è¨å®ãããããç¬ç«ãããã¡ã¤ã«ã«æ¸ãã¦ããããå ´åã¯, el-get-user-package-directory
å¤æ°ã«è¨å®ãã¡ã¤ã«ã®ç½®ãå ´æãæå®ãã¾ã. ãã¨ãã°, ~/.emacs.d/init
ã«ç½®ãã®ã§ããã°Emacsè¨å®ãã¡ã¤ã«ã«ä»¥ä¸ã®ããã«æ¸ãã¾ã.
(setq el-get-user-package-directory (locate-user-emacs-file "init"))
ãã¨ã¯~/.emacs.d/init/init-ããã±ã¼ã¸å.el
ã¨ãããã¡ã¤ã«ãç½®ãã°, ãã®ååã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¦ããã¨ãã¯èªåçã«ãã¡ã¤ã«ãèªã¿è¾¼ã¾ãã¾ã. ãã®ãã¡ã¤ã«ã¯èªåçã«ãã¤ãã³ã³ãã¤ã«ããã¾ã.
el-get-bundle
ã«ããããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«æ示ã¨ãã£ããã«, ãã®ããã±ã¼ã¸ã®ããã®è¨å®ãæ¸ãã¦ãããã¨ãã§ãã¾ã. ãªãã·ã§ã³(空ã§ããã)ã«ç¶ãã¦ä»»æã®Lispã®å¼ãæ¸ãã¨, ãã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¦ããæã«å®è¡ããè¨å®ãå®ç¾©ã§ãã¾ã. ãã¨ãã°ä»¥ä¸ã®ä¾ã§ã¯, anything
ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«å¾ã«(ãã®ããã±ã¼ã¸ã§å®ç¾©ããã¦ãã)anything-for-files
ã¨ããã³ãã³ãã«ãã¼ãå²ãå½ã¦ã¾ã.
(el-get-bundle anything (global-set-key (kbd "C-x b") 'anything-for-files))
è¨å®é¨åã¯(ååè©ä¾¡æã«)èªåçã«ãã¤ãã³ã³ãã¤ã«ãã, æªå®ç¾©ã®å¤æ°ã¸ã®åç §ãªã©ã¯è¦åããã¾ã. ããã¯å¤æ°åãªã©ã®æ¸ãééããæ¤åºã§ãã¦é常ã«æç¨ã§ã.
ããã±ã¼ã¸ãèªåãã¼ããããããã«ãªã£ã¦ããå ´å*5ã¯, ã¤ã³ã¹ãã¼ã«ã¯å®äºãããã®ã®ã¾ã ãã¼ãããã¦ããªãã¿ã¤ãã³ã°ã§ããã±ã¼ã¸ã§å®ç¾©ãããå¤æ°ã«ã¢ã¯ã»ã¹ããã¨è¦åããã¦ãã¾ãã¾ã. ãã®ãããªå ´åã¯with-eval-after-load
ãã¯ãã使ã£ã¦, ãã®ããã±ã¼ã¸ããã¼ãããã¦ããè¨å®ãå®è¡ããããã«ãã¾ããã.
(el-get-bundle anything (global-set-key (kbd "C-x b") 'anything-for-files)) (with-eval-after-load 'anything ;; `anything-map' ã¸ã®åç §æã«ã¯ "anything.el" ããã¼ãæ¸ã¿ã§ãããã¨ãå¿ è¦ (define-key anything-map (kbd "M-n") 'anything-next-source) (define-key anything-map (kbd "M-p") 'anything-previous-source))
ãã ãããããå ´å, with-eval-after-load
å
ã¯el-get-bundle
ã®å¤ãªã®ã§, èªåçã«ãã¤ãã³ã³ãã¤ã«ãããè¦åãæ大éã«æ´»ããã¾ãã. ãã¨ãã£ã¦, with-eval-after-load
ãel-get-bundle
ã®ä¸ã«å
¥ãã¦ããã®å ´åã¯ãã¾ãããã¾ãã. ãªããã¾ããããªãã®ã, ãã¾ãããããã«ããã«ã¯ã©ããããããã®ãç¥ããããã°å¾ã®ç¯ãåç
§ãã¦ãã ãã.
ãã®ä»ã®æ§æç³è¡£
ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¤ã¤, ãã®ããã±ã¼ã¸ããããã¾ãã¼ãããã(require
ããã)ã¨ããå ´åã¯el-get-bundle!
ã使ãã¾ã.
(el-get-bundle! evil)
ä¸ã®æå®ã¯ä»¥ä¸ã¨åãæå³ã§ã.
(el-get-bundle evil :features evil)
ãã, ããã±ã¼ã¸åã¨ãã¼ãããæ©è½ã®ååãç°ãªãå ´åã¯, (el-get-bundle! æ©è½å in ããã±ã¼ã¸å)
è¨æ³ã使ããã¨ãã§ãã¾ã.
(el-get-bundle! yaicomplete in tarao/elisp)
ä¸ã®æå®ã¯ä»¥ä¸ã¨åãæå³ã§ã.
(el-get-bundle elisp :type github :pkgname "tarao/elisp" :features yaicomplete)
require
ããããã®ãè¤æ°ããå ´åã¯:features
ãªãã·ã§ã³ãç´æ¥ä½¿ã£ã¦ãã ãã.
ããã±ã¼ã¸ç®¡çã®ã¯ã¼ã¯ããã¼
ããã±ã¼ã¸ãæ°ãã試ã
æ°ã«ãªãããã±ã¼ã¸ã試ãã¦ã¿ããã¡ã°ãç°¡åãªæ¹æ³ã¯, Emacsä¸ã§M-x el-get-install
ãããã¨ã§ã. ã¬ã·ããå®ç¾©æ¸ã¿ã®ãã®ã«éããã¾ãã, ããã ãã§ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ã§ãã¾ã.
ã¬ã·ããå®ç¾©æ¸ã¿ã§ãªãå ´åã¯lisp-interaction-mode
ã«ãªã£ã¦ãããããã¡(ãã¨ãã°*scratch*
ãããã¡)ã§, el-get-bundle
ã«ããã¤ã³ã¹ãã¼ã«æå®ãæ¸ãã¦, æå®ã®æ«å°¾ã§C-x C-e
ããã¨ã¤ã³ã¹ãã¼ã«ã§ãã¾ã. ãã®ä», ã©ãããè¨å®ããããããã模索ããã¨ããåãããã«è¨å®ãæ¸ãã¦C-x C-e
ãã¦ã¿ãã¨ããã§ããã(ã¨ã©ã¼ãåºããq
ãã¼ã§ã¨ã©ã¼ãããã¡ãéãããã¨ãã§ãã¾ã).
ã²ã¨ã¨ãã試ãã¦å¸¸ç¨ãããã¨ããã£ãã, Emacsè¨å®ãã¡ã¤ã«ã«el-get-bundle
ãè¨å®ã®è¡ã追å ãã¾ããã.
ããã±ã¼ã¸ãã¢ã³ã¤ã³ã¹ãã¼ã«
試ãã¦ã¿ãã¨ãããã£ã±ãå¿
è¦ãªãã¨ããã£ãã, M-x el-get-remove
ã§ããã±ã¼ã¸ãåé¤ã§ãã¾ã. ã¢ã³ã¤ã³ã¹ãã¼ã«ãã¦ããã¡ã©èªã¿è¾¼ãã æ©è½ãå
ã«æ»ãããã§ã¯ãªãã®ã§, M-x unload-feature
ããã, Emacsãåèµ·åããããã¾ããã.
èªåçã«ã¤ã³ã¹ãã¼ã«ãããä¾åãã¡ã¤ã«ããã¡ãã¨æ¶ãããå ´åã¯, ã¤ã³ã¹ãã¼ã«ããåã«æªã¤ã³ã¹ãã¼ã«ã®ä¾åããã±ã¼ã¸ã調ã¹ã¦ããã¦, 試ããå¾ã«ãããããã£ããã«æ¶ããã¨ã«ãªãã¾ãã, é常ããã¾ã§ããå¿
è¦ã¯ããã¾ãã. ãã, el-get-bundle
ããããã®ä»¥å¤ã綺éºã«æ¶ãããå ´åã¯, ãã£ãã~/.emacs.d/el-get
ãã¾ããã¨åé¤ãã¦, Emacsãåèµ·åãã¦å
¨ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããªããã®ã確å®ã§ã. å¾ã®ç¯ã§è§¦ããç°å¢éé¢ã®æ¹æ³ã使ã£ã¦, 常ç¨ãã¦ããã®ã¨ã¯å¥ã®æ±ãã¦ããã¾ããªãç°å¢ã§è©¦ãããã«ããã®ãããã§ããã.
æ¢åã®ããã±ã¼ã¸ãæ´æ°
ããã±ã¼ã¸ã®æ´æ°ã¯M-x el-get-update
ã§ã§ãã¾ã. å
¨ããã±ã¼ã¸ãæ´æ°ããå ´åã¯M-x el-get-upadate-all
ãã¾ã.
ããã±ã¼ã¸ãªã¹ããè¦ãªããæä½
ã¤ã³ã¹ãã¼ã«/æ´æ°/åé¤ã®æä½ã¯M-x el-get-list-packages
ãã¦è¡¨ç¤ºããããªã¹ããããã§ãã¾ã. æä½ãã¼ã調ã¹ãã«ã¯ãªã¹ãã®ãããã¡ä¸ã§h
ãã¼ãæ¼ãã¾ããã.
ãã¼ã¸ã§ã³ã®åºå®
é
å¸å
ãVCSã®å ´åã¯:checkout
ãªãã·ã§ã³ã§ä»»æã®ãã¼ã¸ã§ã³ã«åºå®ãããã¨ãã§ãã¾ãã, åããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«æå®ã«ãã¡ãã¡ãã¼ã¸ã§ã³ãæ¸ãã¦ããã®ã¯ãã¾ãã«ããã¸ãã§ã.
ãããã, ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ãåºå®ãããçç±ã¯, ãã¡ãã¨åããã¨ãããã£ã¦ãããã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ããã, åæã«ææ°çã«ãªããã¨ã§ããã±ã¼ã¸ããã³è¨å®éã®äºææ§ãå´©ãã¦åããªããªãã®ãé¿ããã, ã¨ãããã¨ã ã¨ãããã¾ã. ã¤ã¾ã, æ¬å½ã«å¿ è¦ãªã®ã¯æå®ãããã¼ã¸ã§ã³ã«åºå®ãããã¨ã§ã¯ãªã, ãã¡ãã¨åããã¨ã確ãããã¨ãã®ã¹ãããã·ã§ãããåããã¨ã®ã¯ãã§ã.
el-get-lockã使ãã¨, ã¤ã³ã¹ãã¼ã«ããã¦ããããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ã~/.emacs.d/el-get.lock
ã«æ¸ãåºã, ãã®æ
å ±ãå
ã«ã¤ã³ã¹ãã¼ã«ããããã¼ã¸ã§ã³ãå¶éã§ãã¾ã. ãã®ãã¡ã¤ã«ã®ããã¯ã¢ãããã¨ããã¨ã§ã¹ãããã·ã§ããã¨ãã¦ã®å½¹å²ãæããããã§ã.
è¨å®
ãã¼ã¸ã§ã³åºå®ãæå¹ã«ããã«ã¯Emacsè¨å®ãã¡ã¤ã«ã«ä»¥ä¸ã®ããã«æ¸ãã¾ã.
(el-get-bundle tarao/el-get-lock) (el-get-lock)
ç¹å®ã®ããã±ã¼ã¸ã ãåºå®ã®å¯¾è±¡ã«ããã«ã¯, el-get-lock
ã«è¤æ°ã®å¼æ°ãä¸ãã¦, åºå®ããããã±ã¼ã¸ãæå®ãã¾ã(å¼åºããã®ãã®ãè¤æ°åã«åãã¦ãæ§ãã¾ãã).
(el-get-lock 'evil 'anything) (el-get-lock 'magit)
éã«, ç¹å®ã®ããã±ã¼ã¸ã®ã¿åºå®ã®å¯¾è±¡ããå¤ãã«ã¯, ãã£ããç¡å¼æ°ã®el-get-lock
ã§å
¨ããã±ã¼ã¸ã対象ã«ãããã¨, å¤ãããã±ã¼ã¸ãel-get-lock-unlock
ã§æå®ãã¾ã.
(el-get-lock) (el-get-lock-unlock 'undo-tree)
ããã¯ãã¡ã¤ã«ã®çæ
ãã¼ã¸ã§ã³åºå®ã®å¯¾è±¡ã¨ãªã£ãããã±ã¼ã¸ãæ°è¦ã«ã¤ã³ã¹ãã¼ã«ãããã¨, ~/.emacs.d/el-get.lock
ã«ã¤ã³ã¹ãã¼ã«ããããã¼ã¸ã§ã³ãæ¸ãåºãã, 以éã®åã¤ã³ã¹ãã¼ã«æã«ã¯ãã®ãã¼ã¸ã§ã³ã«åºå®ããã¾ã. ããæ¢ã«el-get-bundle
(ãããã¯ä»ã®El-Getã«ããã¤ã³ã¹ãã¼ã«æ¹æ³)ã使ç¨ãã¦ãã¦, ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ããã±ã¼ã¸ãããå ´åã¯, ãã¼ã¸ã§ã³ãæ¸ãåºãããã«ãã£ããã¤ã³ã¹ãã¼ã«ããªããå¿
è¦ãããã¾ã. M-x el-get-reinstall
ãM-x el-get-update
(1ã¤ã®ããã±ã¼ã¸ã®ã¿ã対象ã¨ããå ´å), ãããã¯M-x el-get-update-all
(å
¨ããã±ã¼ã¸ã対象ã¨ããå ´å)ããã¨ããã§ããã.
æ¸ãåºãããel-get.lock
ã¯, ~/.emacs.d/init.el
ãªã©ã¨ã¨ãã«VCSã§ç®¡çãã¦ãããã¨ããããããã¾ã. ãã¨ãã°Gitã§ç®¡çããå ´åã§ããã°, 以ä¸ã®ããã«ãã¦ããã¾ã.
cd ~/.emacs.d/ git add el-get.lock git commit -m 'Add el-get lock file.'
åºå®ããããã¼ã¸ã§ã³ãå¥ç°å¢ã§ã¤ã³ã¹ãã¼ã«
~/.emacs.d
ãã®ãã®ãVCSã§ç®¡çãããªã©ãã¦, å¥ç°å¢ã«æã¡åºããå ´åã¯, æ°ãã«El-Getã§ç°å¢æ§ç¯ããéã«èªåçã«ãã¼ã¸ã§ã³åºå®ããã¾ã. ã¤ã¾ãEmacsãèµ·åããã ãã§ãã¾ãããã¾ã.
æ¢ã«El-Getã使ã£ã¦ããå¥ç°å¢ã«el-get-lock
ã®è¨å®ã¨el-get.lock
ãæ°ãã«æã¡è¾¼ãã å ´åã¯, M-x el-get-lock-checkout
(ããã±ã¼ã¸ãæå®ããã«ãã®ã¾ã¾ç¢ºå®)ã§å
¨ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ãåºå®ãã¦ã¤ã³ã¹ãã¼ã«ããªãããã¨ãã§ãã¾ã.
ææ°çã«æ´æ°
ãã¼ã¸ã§ã³ãåºå®ãããããã±ã¼ã¸ãææ°ãã¼ã¸ã§ã³ã«æ´æ°ããå ´åã¯, åã«M-x el-get-update
ããã ãã§ã. æ´æ°ãããã¨el-get.lock
ã®è©²å½ããã±ã¼ã¸ã®ç®æãå¤æ´ããã¦ããã®ã§, æ´æ°ããããã±ã¼ã¸ããã¡ãã¨åä½ãã¦ããããªãã¨ã確èªããã®ã¡, VCSã«åæ ãã¦ããã¾ããã. 以ä¸ã¯Gitã®ä¾ã§ã.
cd ~/.emacs.d/ git add el-get.lcok git commit -m 'Update some packages.'
æ´æ°ãå ã«æ»ã
ããã±ã¼ã¸ãæ´æ°ãã¦ã¿ããæ¢åã®è¨å®ãå£ãã¦ãã¾ããã¨ãããã£ãã¨ãã¾ããã. å ã«æ»ãã«ã¯æ¬¡ã®ããã«ãã¾ã.
el-get.lock
ã«è¨è¼ããã¦ãããã¼ã¸ã§ã³ãåãã¦ããã¨ãã®ãã®ã«æ»ãM-x el-get-lock-checkout
ã§è©²å½ããããã±ã¼ã¸ãel-get.lock
ã®ãã¼ã¸ã§ã³ã«æ»ã
ãã¨ãã°, el-get.lock
ãGitã§ç®¡çãã¦ãã¦, ææ°ã³ããããåãã¦ããã¨ãã®ãã¼ã¸ã§ã³ã«ãªã£ã¦ããå ´åã¯, 以ä¸ã®ããã«ãããã¨ã§el-get.lock
ãå
ã«æ»ãã¾ã.
cd ~/.emacs.d/ git checkout el-get.lock
ãã ã, ãã®ããæ¹ã¯el-get.lock
ã®ãã¹ã¦ã®å¤æ´ãå
ã«æ»ãã¦ãã¾ãã®ã§, è¤æ°ã®ããã±ã¼ã¸ããã¡ã©ã«æ´æ°ããå ´åã¯å·®åãè¦ãªããæåã§el-get.lock
ãç·¨éããå¿
è¦ãããããããã¾ãã.
el-get.lock
ããå
ã«æ»ãã°, ãã¨ã¯M-x el-get-lock-checkout
ã§ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ãæ»ãã¾ã.
ãµãã¼ããããé å¸å
el-get-lockã¯ãã¹ã¦ã®é å¸å ã®ãã¼ã¸ã§ã³åºå®ããµãã¼ããã¦ããããã§ã¯ããã¾ãã. ãã¼ã¸ã§ã³ã®æ¦å¿µã®ãªãé å¸å ã, åã®ãã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ããæ¹æ³ãæä¾ããã¦ããªãå ´åã¯åºå®ãããã¨ãã§ãã¾ãã.
- å®å
¨ãµãã¼ã
git
,github
,emacsmirror
,hg
- ãããã®é å¸å ã®ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ã¯åºå®, æ´æ°ã§ã, å ã«æ»ãã¾ã.
- é¨åãµãã¼ã
http
,ftp
,emacswiki
- ãããã®é
å¸å
ã®ããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ã¯åºå®, æ´æ°ã§ãã¾ãã, å
ã«æ»ããã¨ã¯ã§ãã¾ãã. ããããã¯ãã¡ã¤ã«ãå©ç¨ããæ°è¦ã¤ã³ã¹ãã¼ã«æã«ããæ°ãããã¼ã¸ã§ã³ãããªãã£ãå ´åã¯ã¨ã©ã¼ã«ãªãã¾ã. ãã®å ´åã¯
M-x el-get-reinstall
ã§ãã®ããã±ã¼ã¸ãå¼·å¶çã«ææ°ãã¼ã¸ã§ã³ã«åºå®ããªããããããã¾ãã.
ELPAç³»ã¯, package.el
ã®ããã¿ä¸ãã¼ã¸ã§ã³ãæ»ããªãã®ã§, VCSã§é
å¸ããã¦ããããã±ã¼ã¸ã¯VCSã§ã¤ã³ã¹ãã¼ã«ãããã¨ãå¼·ããããããã¾ã. å®å®çã使ãããã¨ããå ´åã§ã, é
å¸å
ãå®å®çã®ãã©ã³ã(ãããã¯ã¿ã°)ãç¨æãã¦ããã°ããã:branch
ãªãã·ã§ã³ã§æå®ããã®ãããã§ããã.
ãã®ä»ã®Tips
éé¢ãããç°å¢ã«ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«
El-Getã®å°å ¥ã®ç¯ã§è§¦ããããã«, Emacsè¨å®ãã¡ã¤ã«ãé©åã«æ¸ãã¦ããã¨, ã¤ã³ã¹ãã¼ã«ãããããã±ã¼ã¸ãå«ãEmacsã®å ¨è¨å®ãç¹å®ã®ãã£ã¬ã¯ããªä¸ã«éé¢ã§ãã¾ã.
(when load-file-name (setq user-emacs-directory (file-name-directory load-file-name)))
å
é ã«ãã®ããã«è¨è¿°ããEmacsè¨å®ãã¡ã¤ã«ã, ãã¨ãã°~/path/to/somewhere/init.el
ã«ä¿åããã¨ããã¨, 以ä¸ã®ããã«ãã¦ãã¹ã¦~/path/to/somewhere
å
ã§å®çµããç¶æ
ã®Emacsãèµ·åã§ãã¾ã*6.
emacs -q -l ~/path/to/somewhere/init.el
ãããããã¨ã§, æ¢åã®è¨å®ã«å¹²æ¸ãããã¨ãªã, æ°ããããã±ã¼ã¸ããã®è¨å®ãã¯ãªã¼ã³ãªç°å¢ã§è©¦ããã¨ãã§ãã¾ã. ãã®ããã«è¨è¿°ãããEmacsè¨å®ãã¡ã¤ã«ãåºã¾ãã°, ä»ã®äººã®è¨å®ã試ãã«ä½¿ã£ã¦ã¿ãã®ãé常ã«ããããã«ãªãã¾ã.
ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«å ãEmacsãã¼ã¸ã§ã³ã«ãã£ã¦å¤ãã
ã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ã¯é常ãã¤ãã³ã³ãã¤ã«ããã¾ãã, ç°ãªããã¼ã¸ã§ã³ã®Emacsã§ã³ã³ãã¤ã«ããããã¤ãã³ã¼ãã¯åºæ¬çã«äºææ§ãããã¾ãã*7. ããè¤æ°ã®ãã¼ã¸ã§ã³ã®Emacsã§è¨å®ãã¡ã¤ã«ãå ±æãããå ´åã«ã¯, ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãããã£ã¬ã¯ããªãEmacsã®ãã¼ã¸ã§ã³ãã¨ã«å¥ã ã«ããã¨ããã§ããã.
El-Getã§ã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ã¯, ELPAç³»ãé¤ãã¦ããã©ã«ãã§ã¯~/.emacs.d/el-get
以ä¸ã«, ELPAç³»ã¯package.el
ã«ãã£ã¦ã¤ã³ã¹ãã¼ã«ãã, ããã©ã«ãã§ã¯~/.emacs.d/elpa
ã«ä¿åããã¾ã. ããããel-get-dir
ã¨package-user-dir
ã§å¤æ´å¯è½ã§ã. Emacsã®ãã¼ã¸ã§ã³æååã¯emacs-version
å¤æ°ã«å
¥ã£ã¦ããã®ã§, ãã®æååã§ãã£ã¬ã¯ããªãä½ãã¨ããã§ããã.
ãã¨ãã°, Emacsã®ãã¼ã¸ã§ã³ã24.4.1
ã®å ´å, 以ä¸ã®ããã«ããã¨ãããã~/.emacs.d/24.4.1/el-get
, ~/.emacs.d/24.4.1/elpa
ã«ã¤ã³ã¹ãã¼ã«ãããããã«ãªãã¾ã.
(let ((versioned-dir (locate-user-emacs-file emacs-version))) (setq el-get-dir (expand-file-name "el-get" versioned-dir) package-user-dir (expand-file-name "elpa" versioned-dir)))
ãã®è¨å®ã¯, user-emacs-directory
ã®è¨å®ãããå¾, El-Getãã®ãã®ã®ã¤ã³ã¹ãã¼ã«ãããåã®ä½ç½®ã«æ¸ãå¿
è¦ãããã¾ã.
è¨å®ã®ãã¤ãã³ã³ãã¤ã«
次ã®ä¾ã§, anything-map
ã¯anything.el
ã§å®ç¾©ããã¦ãã, anything.el
ã¯èªåãã¼ããããããã«ãªã£ã¦ããã¨ãã¾ããã.
(el-get-bundle anything (global-set-key (kbd "C-x b") 'anything-for-files) (with-eval-after-load 'anything (define-key anything-map (kbd "M-n") 'anything-next-source) (define-key anything-map (kbd "M-p") 'anything-previous-source)))
el-get-bundle
ã®ä¸ã®è¨å®ã¯, anything.el
ãã¤ã³ã¹ãã¼ã«ãããä¸ã§å®è¡ããããã¨ã¯ä¿è¨¼ããã¾ãã, ãã®è¨å®ãå®è¡ãããã¨ãã«ã¯ã¾ã anything.el
ã¯ãã¼ãããã¦ãã¾ãã. ãããã£ã¦, anything-map
ã¯æªå®ç¾©ã®å¤æ°ã¨ãããã¨ã«ãªã, è¨å®é¨åã®ã³ã³ãã¤ã«æã«è¦åãåºã¾ã.
...init-1_anything.el:5:15:Warning: reference to free variable `anything-map'
ã§ã¯, anything-map
ãåç
§ããåã«require
ãããã©ãã§ãããã?
(el-get-bundle anything (global-set-key (kbd "C-x b") 'anything-for-files) (require 'anything) ; 常ã«anythingããã¼ã (with-eval-after-load 'anything (define-key anything-map (kbd "M-n") 'anything-next-source) (define-key anything-map (kbd "M-p") 'anything-previous-source)))
ãããã«ããã§è¦åã¯åºãªããªãã¾ãã, anything
ã常ã«ãã¼ãããã¦ãã¾ãã¾ã. ãã£ããèªåãã¼ããè¨å®ããã¦ããã®ã ãã, å¿
è¦ã«ãªãã¾ã§ãã¼ããé
ããã¦Emacsã®èµ·åãéããããã¨ããã§ã.
ã³ã³ãã¤ã«æã«ã¯å¤æ°ã®åç
§ãæ£ãããã©ãã調ã¹ãããã«anything
ããã¼ãããã¦ããå¿
è¦ãããã®ã§, æåã®ä¸åã®require
ã¯ã©ããã¦ãå¿
è¦ã§ã. ãããä¸åº¦ã³ã³ãã¤ã«ãããã¨ã¯with-eval-after-load
ã«ãã£ã¦anything
ã®èªã¿è¾¼ã¿å¾ã«å®è¡ããããã¨ãä¿è¨¼ããã¦, ã³ã³ãã¤ã«å¦çãèµ°ããªãã®ã§å¤æ°ã®åç
§ã¯ãã§ãã¯ããã¾ãã(ãã§ãã¯æ¸ã¿ã¨ããæ±ãã§ã). ã¤ã¾ãæ¢ã«ã³ã³ãã¤ã«æ¸ã¿ã ã£ããrequire
ããªãããã«ã§ããã°ããããã§ã.
å®ã¯ã¾ãã«ããããã£ã¦ãããããã±ã¼ã¸ãåå¨ãã¾ã*8. tarao/with-eval-after-load-feature-elã§ã.
(el-get-bundle tarao/with-eval-after-load-feature-el) (el-get-bundle anything (global-set-key (kbd "C-x b") 'anything-for-files) (with-eval-after-load-feature 'anything (define-key anything-map (kbd "M-n") 'anything-next-source) (define-key anything-map (kbd "M-p") 'anything-previous-source)))
with-eval-after-load-feature
ã¯, ã³ã³ãã¤ã«æã«ã¯æå®ãããããã±ã¼ã¸ãrequire
ãã¦ããä¸èº«ãã³ã³ãã¤ã«, å®è¡æã¯with-eval-after-load
ã¨åãããã«æ¯ãèãã¨ãããã¨ããã¦ããã¾ã.
Caskã¨ãã¥ã¬ã¼ã·ã§ã³
ãã§ã«è¦ãããã«, Caskã®æ©è½ã®ãã¡èªåã®Emacsã§ä½¿ãããã±ã¼ã¸ã管çããããã®ããã¿ã¯, ã»ã¼El-Getã«ãã£ã¦ç¶²ç¾ ããã¦ããã¨è¨ã£ã¦ããã¤ããããã¾ãã*9. ãã®ç¯ã§ã¯ããä¸æ©è¸ã¿è¾¼ãã§, Caskã使ã£ã¦ããã¦ã¼ã¶ãã¹ã ã¼ãºã«El-Getã«ç§»è¡ããããã®æ¹æ³ãç´¹ä»ãã¾ã.
Caskãã¡ã¤ã«ãEl-Getå½¢å¼ã«æ¸ãæã
ããã¾ã§ã®èª¬æãèªãã§ããã°Cask
ãã¡ã¤ã«ãEl-Getç¨ã«æ¸ãæããã®ã¯ããããã§ããã. ã¨ãã«ãªãã·ã§ã³ã®ãªãdepends-on
ã¯, ããã±ã¼ã¸åã®åã«elpa:
ãã¤ããel-get-bundle
ã«, :git
ã®ãããªæå®ã¯:type
ã¨:url
ã¤ãã®ãã®ã«ç½®ãæããã ãã§ã.
ãã¨ãã°, id:naoyaããã®Cask - naoyaのはてなダイアリーã®è¨äºã«è¼ã£ã¦ããCask
ãã¡ã¤ã«ã®å ´åã¯, 以ä¸ã®ããã«æ¸ãæãããã¨ã§å
¨ãåãããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ã§ãã¾ã.
(el-get-bundle elpa:ag) (el-get-bundle elpa:anything) (el-get-bundle elpa:auto-complete) (el-get-bundle elpa:browse-kill-ring) (el-get-bundle elpa:color-theme) (el-get-bundle elscreen :type git :url "[email protected]:knu/elscreen.git") (el-get-bundle elpa:flycheck) (el-get-bundle elpa:git-gutter) (el-get-bundle elpa:pbcopy) (el-get-bundle elpa:popup) (el-get-bundle elpa:popwin) (el-get-bundle elpa:powerline) (el-get-bundle elpa:quickrun) (el-get-bundle elpa:recentf-ext) (el-get-bundle elpa:zlc) ;; prog modes (el-get-bundle elpa:coffee-mode) (el-get-bundle elpa:go-mode) (el-get-bundle elpa:js2-mode) (el-get-bundle elpa:json-mode) (el-get-bundle elpa:less-css-mode) (el-get-bundle elpa:motion-mode) (el-get-bundle elpa:puppet-mode) (el-get-bundle elpa:rhtml-mode) (el-get-bundle elpa:ruby-mode) (el-get-bundle elpa:sass-mode) (el-get-bundle elpa:slim-mode) (el-get-bundle elpa:rubocop) (el-get-bundle elpa:ruby-block) (el-get-bundle elpa:ruby-electric) (el-get-bundle elpa:ruby-end) (el-get-bundle elpa:go-autocomplete)
ããããã¨ãã°Cask2ElGet
ã¨ãããã¡ã¤ã«åã§ä¿åãã¦, El-Getã®åæè¨å®ã®å¾ã«ä»¥ä¸ã®ããã«æ¸ãã°ã§ãä¸ããã§ã.
(load (locate-emacs-file "Cask2ElGet"))
é常ã«ããããããã§ãã, ä¸ã¤è½ã¨ãç©´ãããã¾ã. El-Getã¯ELPAç³»ã§ã¯ãªãVCSããã®ã¤ã³ã¹ãã¼ã«ãåºæ¬ã¨ãã¦ãã¦, ä¾åãã¡ã¤ã«ã¯ã¬ã·ãã§ãã¡ãã¨æå®ããã®ãååã®ãã, ãã®ã¾ã¾ã§ã¯ã¤ã³ã¹ãã¼ã«ãããããã±ã¼ã¸ã®ä¾åããã±ã¼ã¸(ã®ãã¡ä¸ã«åæããã¦ããªããã®)ãæ£å¸¸ã«èªã¿è¾¼ãã¾ãã(ã¤ã³ã¹ãã¼ã«èªä½ã¯ããã¾ã).
ãã, ELPAç³»ã®å®å®çã«ãã ãããªããªã, ä¸è¨ããelpa:
ãé¤ãããã®ãç¨ããã¨ææ°çããã¡ãã¨ã¤ã³ã¹ãã¼ã«ãã, ä¾åããã±ã¼ã¸ãåé¡ãªãèªã¿è¾¼ãã¾ã. å
¬å¼ã¬ã·ãã®ã¿ã§è¶³ããã®ã§èªåã§ã¬ã·ããå®ç¾©ããå¿
è¦ãããã¾ãã.
(el-get-bundle ag) (el-get-bundle anything) (el-get-bundle auto-complete) (el-get-bundle browse-kill-ring) (el-get-bundle color-theme) (el-get-bundle elscreen :type git :url "[email protected]:knu/elscreen.git") (el-get-bundle flycheck) (el-get-bundle git-gutter) (el-get-bundle pbcopy) (el-get-bundle popup) (el-get-bundle popwin) (el-get-bundle powerline) (el-get-bundle quickrun) (el-get-bundle recentf-ext) (el-get-bundle zlc) ;; prog modes (el-get-bundle coffee-mode) (el-get-bundle go-mode) (el-get-bundle js2-mode) (el-get-bundle json-mode) (el-get-bundle less-css-mode) (el-get-bundle motion-mode) (el-get-bundle puppet-mode) (el-get-bundle rhtml-mode) (el-get-bundle ruby-mode) (el-get-bundle sass-mode) (el-get-bundle slim-mode) (el-get-bundle rubocop) (el-get-bundle ruby-block) (el-get-bundle ruby-electric) (el-get-bundle ruby-end) (el-get-bundle go-autocomplete)
å®å®çã«å¯¾ãããã ããã¨ããç¹ã«é¢ãã¦ã¯, å人çã«ã¯ãã¾ããã¾ãèãã ã¨ã¯æãã¾ãã. ELPAç³»ã§æä¾ããããã®ã§ãã£ã¦ããªãã¸ããªã«ãã£ã¦ã¯å®å®çãæä¾ãã¦ããã¨ãéãã, ã¾ã, ããã±ã¼ã¸æä¾å ã®èãããå®å®çãããã, èªåã®Emacs(ã¨ãã®è¨å®)ã§ãã¡ãã¨åããã¨ãããã£ã¦ãããã¼ã¸ã§ã³ã使ããã¨ã®æ¹ãéè¦ã ã¨æãããã§ã.
ã¨ã¯ãã, ãããCaskããEl-Getã¸ã®ã¹ã ã¼ãºãªç§»è¡ã¨è¨ãã«ã¯ç¡çãããããããã¾ãã. ããã§, Cask
ãã¡ã¤ã«ããã®ã¾ã¾El-Getã§èªããããã«ããæ¹æ³ãç¨æãã¾ãã.
Caskãã¡ã¤ã«ããã®ã¾ã¾èªã
tarao/el-get-caskã使ãã¨, Cask
ãã¡ã¤ã«ããã®ã¾ã¾El-Getã§ä½¿ãã¦, ããã©ã«ãã§ã¯ELPAç³»ã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããä¾åããã±ã¼ã¸ã®èªã¿è¾¼ã¿ã解決ããã¾ã. (ãã¡ããCaskã®ã¤ã³ã¹ãã¼ã«ã¯å¿
è¦ããã¾ãã.)
使ãæ¹ãããã£ã¦ããããã§, El-Getã®åæè¨å®ã®å¾ã«ä»¥ä¸ã®ããã«æ¸ãã ãã§ã.
(el-get-bundle tarao/el-get-cask) (el-get-cask-load)
ããã«, Cask
ãã¡ã¤ã«ä¸ã«ä»¥ä¸ã®ããã«æ¸ãã¦ããã¨, ELPAç³»ã§ã¯ãªãEl-Getã®ã¬ã·ããåªå
ããããã«ãªãã¾ã.
(source el-get)
ããããã°ç¥ããªããã¡ã«El-Getæµã®ããæ¹ã«ç½®ãæãã£ã¦ããã¨ããããã§ã.
å®ã¯el-get-caskã§ã¯depends-on
ã¯el-get-bundle
ã®å¥åã®ããã«è§£éãããã®ã§, el-get-bundle
ã§ã®é
å¸å
ã®ç°¡æè¨æ³ã, El-Getã®ãã¹ã¦ã®è©³ç´°ãªãã·ã§ã³ããµãã¼ãããã¾ã.
ã³ãã³ãã©ã¤ã³
Caskã¯ã³ãã³ãã©ã¤ã³ã§ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ãã§ããç¹ãå¬ããã£ã, ã¨ãã人ã«ã¯tarao/el-get-cliããããããã¾ã. è¨å®ãã¡ã¤ã«(~/.emacs.d/init.el
)ããã¼ãããEmacsããããã¢ã¼ãã§èµ·åãã¦El-Getã®ã³ãã³ããå®è¡ããã¨ããåç´ãªä½ãã§å®ç¾ãã¦ããã®ã§, åºæ¬çã«M-x
ã§El-Getã®ã³ãã³ããå®è¡ããã®ã¨åæ§ã«ä½¿ãã¾ã.
å©ç¨ä¾
El-Getãå®éã«ä½¿ã£ã¦ããè¨å®ãã¡ã¤ã«ã®ä¾ã¨ãã¦, çè ã®Emacsè¨å®ãã¡ã¤ã«ãæãã¦ããã¾ã.
ãã®è¨å®ã§ã¯, el-get-bundle
ã®å¥åã¨ãã¦å®ç¾©ããbundle
ã¨ãããã¯ã*10ã使ã£ã¦, ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ã¨ãã®è¨å®ãåãç®æã«æ¸ãããã«ãã¦ãã¾ã. è¨å®ãã¡ã¤ã«ã¯内容ごとに適度にファイルに分割したものãシンボリックリンクで順序づけã¦, init-loaderã§èªã¿è¾¼ãããã«ãªã£ã¦ãã¾ã. å
¬å¼ã¬ã·ã以å¤ã«自分で定義したレシピã使っています.
ãããã«
El-Getã¯, èªåã®Emacsã§ä½¿ãããã±ã¼ã¸ã管çããæ©è½ã¨ãã¦ã¯package.el
ãCaskã®æ©è½ãä¸åããã®ã ã¨ãããã¨ãç´¹ä»ãã¾ãã. å®ã¯El-Getã®æ¹ãCaskããæ´å²ãå¤ããããªã®ã§ããã¾ã§ã®èç©ã«ãããã®ã¨ãè¨ãã¾ãã, El-Getã®æ¹ãEmacsæ¬æ¥ã®ããæ¹ã«æ²¿ã£ã¦å®è£
ããã¦ãã¦ä»ã®éçºè
ãå ãã£ã¦æ¡å¼µãã¦ãããããã¨ããã®ãããããããã¾ãã.
è¬è¾
Caskã«å¯¾ããä¸æºãå ±æãã¦ãããååã®id:shiba_yu36ããã¨id:mechairoiããã«æè¬ãã¾ã. å½¼ãã®è©±ããã®è¨äºãæ¸ãç´æ¥ã®ãã£ããã¨ãªãã¾ãã.
*1:ELPA(Emacså ¬å¼)ã®ä»ã«MELPA, marmalade, SCãªã©ãããã¾ã.
*2:Palletã¨ããããã±ã¼ã¸ã使ãã¨ã§ãã¾ããæä½éã®ã³ãã³ããããªã, ãã¨ãã°ããã±ã¼ã¸ã®åé¤ã¯ã§ãã¾ãã.
*3:å®éã«ã¯git cloneããã ãã§ãããããªã®ã§å ¨ãä¸å¯è½ãªããã§ã¯ããã¾ããã, ä¸è¦ªåãªãã¨ã¯ééãããã¾ãã.
*4:package.elã«ãããpackage-list-packagesã®ãããªãã®ã§ã.
*5:ãªã«ãã®ã³ãã³ããå®éã«ä½¿ãã¨ãã¾ã§ãã®ããã±ã¼ã¸ã使ãå¿ è¦ããªã(æåããæå¹ã«ãã¦å¸¸ã«ä½ãã表示/å®è¡ãã¦ãããããªé¡ã®ãã®ä»¥å¤ã®)å ´åã¯å¸¸ã«ãããªã£ã¦ããã¹ãã§ã.
*6:ç¨ã«ãã®è¨å®ãç¡è¦ãã¦~/.emacs.dã«æ±ºãæã¡ãã¦åä½ããè¡åã®æªãããã±ã¼ã¸ãåå¨ãã¾ãã, ãã®ãããªæåã¯ãã°ã¨è¨ã£ã¦ããã®ã§ããã±ã¼ã¸éçºè ã«æå¥ãè¨ãã¾ããã.
*7:"In general, any version of Emacs can run byte-compiled code produced by recent earlier versions of Emacs, but the reverse is not true. "
*8:ãã®ç®çã®ããã«çè ãä½ãã¾ãã.
*9:ããã±ã¼ã¸éçºè åãã®æ©è½ã¯ãã®éãã§ã¯ããã¾ãã.
*10:æ¬æ¥ã¯ããããªãªã¸ãã«ã§, el-get-bundleã¯ãã®ãã¯ããæ¬å®¶El-Getã«åãè¾¼ã¾ãããã®ã§ã.