我正在按照these说明在Ubuntu 12上安装haskell-mode。但是当我到达键入M-x customize-option RET pac
时,Emacs说:没有匹配!所有可自定义的变量如下图所示。
知道出了什么问题吗?
答案 0 :(得分:2)
转到您的init.el
文件(~/.emacs.d/init.el
)并将其放在那里:
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("original" . "http://tromey.com/elpa/")
("org" . "http://orgmode.org/elpa/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
然后执行M-x package-refresh-contents
,您可以从那里安装haskell-mode
。另外,请确保您的Emacs版本为> = 24,因为package.el
仅与更高版本捆绑在一起。如果您使用的是旧版本,则可能必须手动安装该软件包。
答案 1 :(得分:0)
这需要emacs24
或更新。
MELPA
:sudo emacs /etc/emacs/site-start.el
粘贴此代码:(来自https://melpa.org/#/getting-started)
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
保存并退出。
haskell-mode
要获得haskell漂亮的打印和缩进,请执行此操作以安装haskell-mode:
emacs
M-x package-list-packages RET (Type meta-key and S, then type package-list-packages and hit return)
C-s haskell-mode RET (Type control-S to search, type nginx and hit return to find the haskell-mode package)
i (to mark it to install)
x (to execute installation of marked packages)
haskell-mode
Haskell模式将自动加载haskell文件。如果您想手动加载,可以使用M-x haskell-mode
切换到haskell模式。