符号值作为变量为空:在tex文件上运行ispell时为debian-emacs-flavor

问题描述 投票:0回答:2

当我尝试运行ispell时,我不断收到此错误。我不确定问题的根源,但最近(在Ubuntu 10.04上)我将其更新为23.1的最新emacs 23.3。我只是通过emacs-goodies-el从debian软件包维护者复制到了我的home-lisp中,并将其放入主文件夹中。如果我从未在旧版本中编辑过的文件开始或创建新文件,这似乎运行得很好。如果打开以前正在编辑的tex文件,则会将其丢弃。然后,我尝试打开后的任何文件都具有以下相同错误。在另一台具有类似设置的计算机上,我使用相同的.emacs执行了相同的操作,并且没有问题。我可以打开这些相同的tex文件。是否在某处存储了诸如此类的信息或关于查找位置的建议。如果我打开一个新文件,它说:

Enabling Flyspell mode gave an error

然后运行M-x ispell给出:

not: Symbol's value as variable is void: debian-emacs-flavor

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

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)
ubuntu emacs debian latex
2个回答
2
投票

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

 (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存储库或上游源安装所需的软件包。工作更多,但将来不太可能引起类似的冲突。


1
投票

debian-emacs-flavor变量缺少定义几乎可以肯定是由您在启动时使用emacs -q引起的。避免加载不必要的杂项的惯用方法是使.emacs中的内容成为有条件的,也许是这样;

(eval-after-load 'tex-mode '(load-file (expand-file-name "~/.emacstex")))

这样,只有在您实际上以TeX模式(或派生模式...打开文件)时,才会加载这些自定义设置。当您要编辑TeX文件时,必须做一些补充工作,以避免从.emacs中加载不必要的内容。 (无论如何,不​​建议退出并重新启动Emacs,因为这样会丢失终止记录的历史记录等。)

另请参阅https://bugs.launchpad.net/ubuntu/+source/dictionaries-common/+bug/619015,了解有关Flyspell如何与Ubuntu的Emacs集成的其他背景。

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

© www.soinside.com 2019 - 2024. All rights reserved.