emacs cask

emacs cask 是 emacs 的一個(gè)包管理工具,他的描述文件是 Cask . 他主要的開發(fā)語言是 python 。

我的emacs配置地址: https://github.com/cnsworder/crossemacs

安裝

安裝方法有三種,分別是:

直接下載安裝腳本

$ curl -fsSkL https://raw.github.com/cask/cask/master/go | python

github clone安裝

$ git clone https://github.com/cask/cask.git ~/.cask

Mac OS 上 homebrew 管理器安裝

$ brew install cask

如果 cask 不在你的命令路徑下,需要添加到 PATH 中。

$ export PATH="/path/to/code/cask/bin:$PATH"

升級(jí) cask

$ cask upgrade-cask

使用

初始化

在cask使用前需要一個(gè) Cask 文件來描述emacs使用的包,這個(gè)文件可以用下面的指令來生成:

$ cask init [--dev]

emacs 在使用了 cask 后會(huì)從 ~/.emacs.d 目錄下找 Cask 文件和 .cask 目錄,所以把 Cask 文件放到 ~/.emacs.d 目錄下。

--dev 表示是否開發(fā)模式

安裝插件包

$ cask install

它會(huì)根據(jù) Cask 文件定義將依賴包下載到 .cask/${VERSION}目錄下,其中 ${VERSION} 是當(dāng)前使用 emacs 的版本號(hào)。

$ EMACS="$(evm bin emacs-24.1)" cask

當(dāng)然也可以直接指定版本。

emacs 配置

將下面的代碼放到 .emacs

(require 'cask "~/.cask/cask.el")
(cask-initialize)

升級(jí)插件

$ cask upgrade

其他指令

幫助

$ cask help

執(zhí)行emacs命令

$ cask exec echo foo
$ cask exec ecukes --script --reporter gangsta
$ cask exec ert-runner --pattern performance

插件列表

$ cask list

Cask 配置文件選項(xiàng)

source

定義包管理源

(source ALIAS)
(source NAME URL)

如:

(source melpa)
(source "melpa" "http://melpa.milkbox.net/packages/")

package

開發(fā)模式下,定義一個(gè)包

(package NAME VERSION DESCRIPTION)

package-file

(package-file FILENAME)

depends-on

添加依賴,這是重點(diǎn)使用到的

(depends-on NAME [ARGS])

使用實(shí)例:

(depends-on "ecukes")
(depends-on "magit" "0.8.1")
(depends-on "magit" :git "https://github.com/magit/magit.git")
(depends-on "magit" :git "https://github.com/magit/magit.git" :ref "7j3bj4d")
(depends-on "magit" :git "https://github.com/magit/magit.git" :branch "next")
(depends-on "magit" :git "https://github.com/magit/magit.git" :files ("*.el" (:exclude "magit-svn.el")))

development

開發(fā)模式的定義.

(development [DEPENDENCIES])

例子:

(development
 (depends-on "ecukes")
 (depends-on "ert-runner"))

files

加載文件

(files [FILES])

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容