【问题标题】:Installing haskell-mode into Emacs on Ubuntu 12在 Ubuntu 12 上将 haskell-mode 安装到 Emacs
【发布时间】:2015-07-05 15:16:19
【问题描述】:

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

知道出了什么问题吗?

【问题讨论】:

    标签: haskell emacs haskell-mode


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      这需要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-mode。

      【讨论】:

        猜你喜欢
        • 2022-07-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-29
        • 2014-03-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多