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

发布于 2024-12-03 07:38:07 字数 2328 浏览 3 评论 0原文

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

Enabling Flyspell mode gave an error

然后运行 ​​Mx ispell 给出:

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

这是错误。现在奇怪的是,flyspell/ispell 在我之前遇到问题的文件中运行良好,但如果我创建新文件,它似乎不起作用。如果我不在 tex 模式下创建新文件,我似乎没有问题。另外我应该注意,当我在 Latex/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)

I keep getting this error when I try to run ispell. I'm not sure where the issue comes from but I recently updated (on Ubuntu 10.04) to the newest emacs 23.3 from 23.1. I just copied over emacs-goodies-el from the debian package maintainer to my site-lisp that I put in my home folder. It seems to run completely fine if I start off with files that weren't edited in the old version or create new files. If I open the tex files I was editing previously that throws it off. Then any file I try to open after has the same errors below. On my other computer with similar setup I have done the same thing with same .emacs and it has no issues. I can open these same tex files just fine. Is there somewhere some information like this is stored or suggestions on where to look. If I open a new file it says:

Enabling Flyspell mode gave an error

Then running M-x ispell gives:

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

Here is the error. What is weird now flyspell/ispell runs fine in the file I was having issues before but if I create new files it doesn't seem to work. If I make new files not in tex mode I seem to have no issues. Also I should note that when I work on latex/tex I usually run emacs -q --load ~\.emacstex. I have a feeling maybe this variable is set in default.el (not sure on this)?? Here is the error:

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原来分手还会想你 2024-12-10 07:38:07

debian-emacs-flavor 显然是由 Debian 软件包维护者 它不会存在于其他 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 存储库或上游源安装您需要的软件包。更多的工作,但不太可能在未来引起类似的冲突。

debian-emacs-flavor is apparently a variable set by the Debian package maintainers It won't exist on other Emacs distributions, but I would assume from your error that something in the emacs-goodies.el requires it. Two solutions: the ugly hack would be to add the following to your .emacs to supply the variable.

 (defconst debian-emacs-flavor 'emacs23
   "A symbol representing the particular debian flavor of emacs running.
 Something like 'emacs20, 'xemacs20, etc.")

This may solve the immediate problem, while risking introducing new problems with other parts of the emacs-goodies.el package.

The better solution would be to not mix Ubuntu and Debian packages, and just install the packages you need from Ubuntu repositories or from the upstream source. More work, but less likely to cause similar conflicts in future.

帅冕 2024-12-10 07:38:07

缺少 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 集成。

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

The lack of a definition for the debian-emacs-flavor variable is almost certainly caused by your use of emacs -q when starting up. The customary way to avoid loading unnecessary cruft is to make stuff in your .emacs conditional, perhaps like this;

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

That way, those customizations will only be loaded when you actually open a file in TeX mode (or a derived mode ... I think). You'd have to do something complementary to avoid loading unnecessary stuff from your .emacs when you do want to edit TeX files. (Quitting and restarting Emacs is not recommended anyhow, as you lose kill ring history etc.)

See also https://bugs.launchpad.net/ubuntu/+source/dictionaries-common/+bug/619015 for some additional background on how Flyspell is integrated with Ubuntu's Emacs.

Edit: Major refactoring upon closer reading of your questions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文