简体   繁体   English

如何在OS X上的emacs 23中安装新模式?

[英]How to install new modes in emacs 23 on OS X?

I just downloaded the Haskell and J modes off of SourceForge, and I'm having trouble figuring out how to make them interface with emacs 23. Google searches yield detailed instructions for emacs 22, but it looks like changes have been made that make it hard to figure out where I'm supposed to stick the source files. 我刚刚从SourceForge上下载了Haskell和J模式,我无法弄清楚如何使它们与emacs 23进行交互。谷歌搜索会产生emacs 22的详细说明,但看​​起来已做出改变以使其难以实现找出我应该坚持源文件的位置。 The internal documentation seems to assume more experience with emacs internals than I currently have, and the problem has resisted solution for several days. 内部文档似乎假设有更多使用emacs内部的经验,而且这个问题已经抵抗了几天的解决方案。 Does anyone know how to get these modes up and running? 有谁知道如何启动和运行这些模式?

EDIT: Thanks to Untwisted for supplying the answer. 编辑:感谢Untwisted提供答案。 Ultimately, my real problems were these: 最终,我真正的问题是:

1) I didn't know that .emacs was invisible to the OSX finder but was visible through the terminal. 1)我不知道.emacs对于OSX查找器是不可见的,但是通过终端可见。

2) It never occurred to me that I could modify .emacs while an instance of emacs was running. 2)当我运行emacs实例时,我从未想过可以修改.emacs。

Once I realized that those were my problems, I used Cx Cf to open ~/.emacs, copied the text of Untwisted's fix, and modified it to reflect my personal file paths. 一旦我意识到这些是我的问题,我使用Cx Cf打开〜/ .emacs,复制了Untwisted修复的文本,并修改它以反映我的个人文件路径。 After that, everything worked. 之后,一切正常。

Basically you need to put the .el files somewhere (I keep mine in ~/.emacs_extras/haskell-mode/ ), and edit your ~/.emacs file to load Haskell mode when appropriate. 基本上你需要把.el文件放在某个地方(我把它保存在〜/ .emacs_extras / haskell-mode /中),编辑你的〜/ .emacs文件以在适当的时候加载Haskell模式。 Example of a ~/.emacs file: 〜/ .emacs文件的示例:

(load "~/.emacs_addons/haskell-mode/haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)

That should make Haskell mode work. 这应该使Haskell模式工作。 For more details, other options, etc: http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs 有关更多详细信息,其他选项等: http//www.haskell.org/haskellwiki/Haskell_mode_for_Emacs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM