0

我正在按照这些说明在 Ubuntu 12 上安装 haskell-mode。但是,当我要打字时M-x customize-option RET pac,Emacs 会说:不匹配!所有可自定义的变量如下图所示。

知道出了什么问题吗?

在此处输入图像描述

4

2 回答 2

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仅与更高版本捆绑在一起。如果您使用的是旧版本,则可能必须手动安装该软件包。

于 2015-07-05T16:39:51.450 回答
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.

于 2016-11-29T02:11:56.720 回答