emacs 标准/缓冲区显示表更改(音译实验)
我改编了 cyril-util.el 来音译格鲁吉亚语的 Mkhedruli 文字。一个非常快速和肮脏的黑客,但它引导我尝试了解显示表。函数 standard-display-mkhedruli-translit 通过更改缓冲区显示表或创建一个新的表来在格鲁吉亚语和拉丁字母之间翻转(使用缓冲区本地变量)。我将其发布在这里: https://gist.github.com/1253614
除此之外,我还更改了.emacs 中的标准显示表可以消除换行 eol 字符,并使 tty 上的分割窗口使用更好的(unicode)字符,如下所示:
(set-display-table-slot standard-display-table 'wrap ?\ )
(set-display-table-slot standard-display-table 'vertical-border ?│)
现在的问题是,尽管音译工作正常,我最终 失去我的标准显示表调整。有什么想法如何将所有这些无缝地结合在一起吗?我不想在我的 mkhedruli 函数中也进行这些调整...
(当然还有一些缺陷,例如粗糙(重绘显示),出于某种原因我需要这样做)。
I adapted cyril-util.el for having transliteration of the Mkhedruli script of Georgian language. A very quick and dirty hack, but it led me to trying to learn about display-tables. The function standard-display-mkhedruli-translit flips (using a buffer-local variable) between Georgian and latin alphabet by altering the buffer-display-table, or creating a new fresh one. I posted it here: https://gist.github.com/1253614
In addition to this, I alter the standard-display-table in .emacs to eliminate line-wrapping eol char, and making split windows on tty use a nicer (unicode) character, like this:
(set-display-table-slot standard-display-table 'wrap ?\ )
(set-display-table-slot standard-display-table 'vertical-border ?│)
The problem now is that, though transliteration works all right, I end up
losing my standard-display-table adjustments. Any ideas how to bring all this together seamlessly? I wouldn't want to have these adjustments also in my mkhedruli-function...
(There are certainly a few more flaws, such as the rough (redraw-display), which I for some reason needed to do).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在新创建的表上使用
(set-char-table-parentstandard-display-table)
。当我在这里时:您可以使用
define-minor-mode
来简化代码。其他类型的简化:
变成
哪个可以变成
你可能更喜欢切换两者:
甚至完全摆脱
mkhedruli-language
,因为你只测试它是否nil
,您可以测试mkhedruli-active
来获取相同的信息。You can use
(set-char-table-parent <newtable> standard-display-table)
on the newly created table.While I'm here: you can simplify your code by using
define-minor-mode
.Other kinds of simplifications:
turns into
which can turn into
tho you may prefer to just switch the two:
and even get rid of
mkhedruli-language
altogether since you only test if it'snil
, and you can testmkhedruli-active
instead to get the same information.