Emacs 下的 Aspell - 多个词典

发布于 2024-09-27 04:33:20 字数 315 浏览 9 评论 0原文

我使用 Aspell 作为 Emacs 的拼写检查器。 我知道,作为独立的 aspell 可以处理多个字典(使用 extra-dicts 参数),但是如何在 Emacs 下配置它?

我对 emacs lisp 知之甚少...我可以在 .emacs 文件中提供一些“ispell extra-args”吗?那行得通吗?如果是这样,我真的很欣赏简单的例子 - 我对 lisp 语法和它处理的绝对/相对路径知之甚少。

我需要这个的原因是我有时用波兰语写一些带有英语单词的文档。这使得拼写检查区域的吸引力远低于在文件中使用单一语言的任务。

提前致谢!

I'm using Aspell as a spelling checker for Emacs.
I know that, as a standalone, aspell can handle multpiple dictionaries (using extra-dicts param), but how to configure it under Emacs?

I know very little of emacs lisp... Could I provide some "ispell extra-args" in .emacs file? Would that work? If so I'd really appreciate simple example - I know very little of lisp syntax and absolute/relative paths it handles and etc.

The reason why I need this is that I sometimes write some documentation in Polish with English words in it. That makes spell-check-region much less attractive task than it is using single language in a file.

Thanks in advance!

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

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

发布评论

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

评论(1

血之狂魔 2024-10-04 04:33:20

我假设 aspell 设置为您的 ispell-program-name (您可以在自定义中执行此操作)。

(将这些添加到您的 .emacs.emacs.d/init.el 中)

您可以将多个词典添加到 ispell-dictionary-alist (语法有点复杂,请在 Emacs 帮助中获取更多信息:Ch v ispell-dictionary-alist

示例。

 '(ispell-dictionary-alist (quote (
       ("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
       ("polish" "[A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "[^A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "" nil ("-d" "polish") nil iso-8859-2)
       ))
  )

您还可以将字典交换绑定到键盘。

例如

    (global-set-key (kbd "M-8") 
            (lambda () 
              (interactive) 
              (ispell-change-dictionary "american" nil))) ; "british" and "english" are also valid.

I'm assuming that aspell is set as your ispell-program-name (you can do this in customize).

( Add these to your .emacs or .emacs.d/init.el )

You can add multiple dictionaries to the ispell-dictionary-alist (syntax is a bit complex, get more info in Emacs help with: C-h v ispell-dictionary-alist)

Example.

 '(ispell-dictionary-alist (quote (
       ("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
       ("polish" "[A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "[^A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "" nil ("-d" "polish") nil iso-8859-2)
       ))
  )

You could also bind dictionary swapping to the keyboard.

e.g.

    (global-set-key (kbd "M-8") 
            (lambda () 
              (interactive) 
              (ispell-change-dictionary "american" nil))) ; "british" and "english" are also valid.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文