简体   繁体   English

在emacs / w32上启用flyspell模式?

[英]Enabling flyspell mode on emacs/w32?

I need to install/run flyspell mode on emacs/w32. 我需要在emacs / w32上安装/运行flyspell模式。

I installed ispell for windows from this site , and then I followed the procedure written in here . 我从这个站点安装了ispell for windows,然后我按照这里写的程序。

  1. I downloaded the flyspell-1.7a.el to rename it as flyspell.el, and copied it to the load-path directory. 我下载了flyspell-1.7a.el,将其重命名为flyspell.el,并将其复制到load-path目录。
  2. I modified the .emacs 我修改了.emacs
;;; http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html
;;; flyspell mode
  (require 'flyspell)
  (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
  (autoload 'flyspell-delay-command "flyspell" "Delay on command." t) (autoload 'tex-mode-flyspell-verify "flyspell" "" t) 
)

But, when I run emacs with flymode, I got the following error. 但是,当我使用flymode运行emacs时,我收到以下错误。

(error "Autoloading failed to define function turn-on-flyspell")

What might be wrong? 可能有什么问题?

SOLUTION with ISPELL 与ISPELL解决方案

It was ispell for win32's problem, one should use the one that works with emacs/win32 as is explained in the book of emacs . 这是win32的问题,应该使用与emacs / win32一起使用的问题,正如emacs一书中所解释的那样。

  1. Download ispell.zip from one of the site . 从该网站之一下载ispell.zip。
  2. Copy the ispell.exe to the PATH directory, and copy the English dictionary to the home directory. 将ispell.exe复制到PATH目录,并将英语字典复制到主目录。

SOLUTION with ASPELL ASPELL的解决方案

vedang gave a better answer with aspell at this post . 在这篇文章中, vedang给了aspell一个更好的答案。

It has windows installer, dictionary install in here . 它有Windows安装程序,字典安装在这里 And adding the following line in .emacs works fine with me. 在.emacs中添加以下行可以和我一起使用。

(custom-set-variables
    '(ispell-dictionary "british")
    '(ispell-program-name "H:\\bin\\aspell\\bin\\aspell.exe"))

It makes little sense to both require flyspell (which will load the library), and then also declare autoload s for two of its functions (the purpose of which is to avoid loading the library in advance of those functions being called. 两者都require flyspell(它将加载库),然后为其两个函数声明autoload (其目的是避免在被调用的函数之前加载库)。

I don't know if this is causing the error (possibly the subsequent autoloads clobber the real definitions?), but there's definitely no need for both. 我不知道这是否会导致错误(可能是后续的autoloads破坏了真正的定义?),但绝对不需要两者。

In fact, on Emacs 23.2.1 (if not much earlier), flyspell.el declares its own autoloads (as do all built-in libraries, I believe), so you really shouldn't have to do any of that at all if you are running a sufficiently up to date version. 实际上,在Emacs 23.2.1上(如果不是更早),flyspell.el声明了它自己的自动加载(我相信所有的内置库都是如此),所以你真的不应该做任何事情。你正在运行一个足够的最新版本。 Which version of Emacs are we talking about? 我们在谈论哪个版本的Emacs?

edit: in fact flyspell-delay-command is not autoloaded by default in 23.2.1, so you might want to retain that line if you decide to remove the require. 编辑:事实上,默认情况下,在23.2.1中, flyspell-delay-command不会自动加载,因此如果您决定删除require,则可能需要保留该行。

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

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