首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在tex文件上运行ispell时,Symbol变量的值为void: debian-emacs-ispell

在tex文件上运行ispell时,Symbol变量的值为void: debian-emacs-ispell
EN

Stack Overflow用户
提问于 2011-09-06 01:45:00
回答 2查看 1.2K关注 0票数 0

当我尝试运行ispell时,我一直收到这个错误。我不确定这个问题是从哪里来的,但我最近(在Ubuntu 10.04上)从23.1更新到了最新的emacs 23.3。我只是将emacs-goodies el从debian包维护程序复制到我的site-lisp中,并将其放在我的主文件夹中。如果我从没有在旧版本中编辑的文件开始,或者创建新文件,它似乎运行得很好。如果我打开之前正在编辑的tex文件,它会将其抛出。然后,我尝试打开的任何文件都会出现以下相同的错误。在我的另一台具有类似设置的计算机上,我用相同的.emacs做了同样的事情,没有任何问题。我可以很好地打开这些tex文件。是否有像这样的信息存储在某个地方,或者建议在哪里查找。如果我打开一个新文件,它会显示:

代码语言:javascript
复制
Enabling Flyspell mode gave an error

然后运行M-x ispell得到:

代码语言:javascript
复制
not: Symbol's value as variable is void: debian-emacs-flavor

这就是错误。现在奇怪的是,flyspell/ispell在我之前遇到问题的文件中运行得很好,但如果我创建新文件,它似乎就不能工作了。如果我创建的新文件不是在tex模式下,我似乎没有问题。另外,我应该注意到,当我在latex/tex上工作时,我通常会运行emacs -q --load ~\.emacstex。我有一种感觉,也许这个变量是在default.el中设置的(不确定)??下面是错误:

代码语言:javascript
复制
Debugger entered--Lisp error: (void-variable debian-emacs-flavor)
  (member debian-emacs-flavor (quote (emacs20 emacs21)))
  (not (member debian-emacs-flavor (quote ...)))
  (if (not (member debian-emacs-flavor ...)) (delete-process ispell-process) (process-send-eof ispell-process) (if (eq ... ...) (ispell-accept-output 1)) (if (eq ... ...) (kill-process ispell-process)) (while (not ...) (if ... ... ...)))
  ispell-delete-ispell-process()
  (if ispell-async-processp (ispell-delete-ispell-process) (ispell-send-string "\n") (kill-buffer ispell-output-buffer) (kill-buffer ispell-session-buffer) (setq ispell-output-buffer nil ispell-session-buffer nil))
  (if (not (and ispell-process ...)) (or no-error (error "There is no ispell process running!")) (if ispell-async-processp (ispell-delete-ispell-process) (ispell-send-string "\n") (kill-buffer ispell-output-buffer) (kill-buffer ispell-session-buffer) (setq ispell-output-buffer nil ispell-session-buffer nil)) (setq ispell-process nil) (message "Ispell process killed") nil)
  ispell-kill-ispell(t)
  (if (and ispell-buffer-local-name (not ...)) (ispell-kill-ispell t))
  ispell-buffer-local-words()
  ispell-accept-buffer-local-defs()
  (if (not recheckp) (ispell-accept-buffer-local-defs))
  ispell-region(1 24)
  ispell-buffer()
  (if (and (boundp ...) transient-mark-mode (boundp ...) mark-active) (ispell-region (region-beginning) (region-end)) (ispell-buffer))
  ispell()
  call-interactively(ispell t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)
EN

回答 2

Stack Overflow用户

发布于 2011-09-06 10:08:30

debian-emacs-flavor显然是一个由Debian package maintainers设置的变量,它不会存在于其他Emacs发行版中,但我从您的错误中假定emacs-goodies.el中的某些内容需要它。两种解决方案:丑陋的技巧是将以下内容添加到.emacs中以提供变量。

代码语言:javascript
复制
 (defconst debian-emacs-flavor 'emacs23
   "A symbol representing the particular debian flavor of emacs running.
 Something like 'emacs20, 'xemacs20, etc.")

这可能会解决眼前的问题,同时冒着在emacs-goodies.el包的其他部分引入新问题的风险。

更好的解决方案是不要混用Ubuntu和Debian软件包,只需从Ubuntu存储库或上游源安装所需的软件包即可。更多的工作,但不太可能在未来引起类似的冲突。

票数 2
EN

Stack Overflow用户

发布于 2011-09-06 14:32:09

几乎可以肯定,缺少debian-emacs-flavor变量的定义是由于在启动时使用emacs -q造成的。避免加载不必要的繁琐代码的常用方法是在.emacs中创建有条件的东西,也许就像这样;

代码语言:javascript
复制
(eval-after-load 'tex-mode '(load-file (expand-file-name "~/.emacstex")))

这样,只有在TeX模式(或派生模式……)下打开文件时,才会加载这些定制。我想)。当您确实想要编辑TeX文件时,您必须做一些补充工作,以避免从.emacs加载不必要的内容。(无论如何都不建议退出并重新启动Emacs,因为您会丢失kill ring历史记录等。)

更多关于https://bugs.launchpad.net/ubuntu/+source/dictionaries-common/+bug/619015如何与Ubuntu集成的背景信息,请参阅Flyspell。

编辑:仔细阅读您的问题后进行主要重构。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7311268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档