是什么导致在 OS X 上使用 linum 模式的 emacs 中出现此图形错误? [英] What causes this graphical error in emacs with linum-mode on OS X?

查看:23
本文介绍了是什么导致在 OS X 上使用 linum 模式的 emacs 中出现此图形错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Emacs 中使用 linum-mode 遇到此图形错误.我尝试从 23 升级到 24(通过 git),我已经尝试过使用各种在线提供的二进制文件和我的家庭编译版本.我真正感兴趣的是从哪里开始诊断问题.

如果我将撕裂的行号滚动到屏幕外然后再滚动回来,问题就会消失.

解决方案

我遇到了同样的问题,并花了很多时间试图解决它.图形错误是由于 linum 模式与边缘渲染方式之间的冲突造成的.不幸的是,我无法解决 linum.el 中的问题,边缘显示代码是 C 源代码的一部分.

还是可以的!修复它的最简单方法是关闭边缘.

M-x 边缘模式 RET 无 RET

为了使边缘永久关闭,我建议使用 Mx定制组 RET 边缘自定义设置,因为一些用于 Mac OS X 的 Emacs 编译版本有自己的边缘设置,可以覆盖部分您的 .emacs 文件.

我真的不需要那些换行指示符,所以没有刘海并不会打扰我.但是,我确实错过了行号和缓冲区文本之间的轻微分离.我遵循了 Emacs Wiki 上一篇帖子的建议,以恢复该间距.在 0.9x 版本的 linum 中,将第 160 行从

(setq width (max width (length str)))

(setq width (max width (+ (length str) 1)))

此更改的灵感来自于:http://www.emacswiki.org/emacs/LineNumbers>

源链接中有参数可以设置 linum-format 变量而不是修改 linum.el.虽然我知道它们来自哪里,但现在大多数颜色主题都会为额外的空间着色,而不是提供我正在寻找的东西(大约作为背景颜色的空间的分离).如果您确实编辑了 linum.el,请确保运行

M-x emacs-lisp-byte-compile-and-load

使更改持久化.您可以通过查看此处找到的图片中光标前的空间来查看此结果:http://i.stack.imgur.com/TxyMr.png(我没有足够的声誉来嵌入图像).

不再有图形工件!

I get this graphical error with linum-mode in my Emacs. I tried upgrading from 23 to 24 (via git) and I've tried both with various supplied binaries online and with my home-compiled version. What I'm really interested in is where to start diagnosing the problem.

The problem goes away if I scroll the torn line numbers off screen and back in.

解决方案

I have experienced the same problem and spent quite some time trying to resolve it. The graphical error is a result of a clash between linum-mode and how the fringe is rendered. Unfortunately, I was unable to resolve the problem in linum.el, and the fringe display code is part of the C-source.

It can still be done! The easiest way to fix it is to just turn off the fringe.

M-x fringe-mode RET none RET

To make the fringe permanently stay off, I recommend customizing the settings with M-x customize-group RET fringe because some compiled versions of Emacs for Mac OS X have their own fringe settings that can override parts of your .emacs file.

I don't really need those line wrap indicators, so not having a fringe doesn't bother me. However, I did miss a slight separation between the line numbers and the buffer text. I followed the advice of a post on the Emacs Wiki to get that spacing back. In version 0.9x of linum, change line 160 from

(setq width (max width (length str)))

to

(setq width (max width (+ (length str) 1)))

The inspiration for this change is here: http://www.emacswiki.org/emacs/LineNumbers

There are arguments at the source link to set the linum-format variable instead of modifying linum.el. While I understand where they are coming from, most color-themes these days would color the extra space and not provide what I am looking for (a separation of about a space that is the background color). If you do edit linum.el, make sure to run

M-x emacs-lisp-byte-compile-and-load

to make the changes persistent. You can see the result of this by looking at the space before the cursor in the picture found here: http://i.stack.imgur.com/TxyMr.png (I don't have enough reputation to embed images).

No more graphical artifacts!

这篇关于是什么导致在 OS X 上使用 linum 模式的 emacs 中出现此图形错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆