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

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

问题描述

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





如果我从屏幕上滚动撕裂的行号并重新进入,问题就会消失。 p>

解决方案

我遇到了同样的问题,花费了很多时间来解决它。图形错误是linum模式与边缘渲染之间的冲突的结果。不幸的是,我无法解决linum.el中的问题,边缘显示代码是C-source的一部分。



仍然可以完成!解决问题的最简单方法是关闭边缘。

  Mx条纹模式RET无RET 

为了使边缘永久停留,我建议使用 Mx自定义组合RET边缘自定义设置因为某些编译版本的Emacs for Mac OS X具有自己的边缘设置,可以覆盖您的.emacs文件的部分。



真的需要那些线条指示器,所以没有边缘不会打扰我。但是,我错过了行号和缓冲区文本之间的轻微分隔。我按照Emacs Wiki上的一个帖子的建议,以获得间距。在版本0.9x的linum中,从

 (setq width(max width(length str)))更改行160)

to

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

更改在这里: http://www.emacswiki.org/emacs/LineNumbers



源链接上有参数来设置 linum-format 变量,而不是修改linum.el。虽然我明白他们来自哪里,但是大多数色彩主题现在都会为额外的空间着色,而不是提供我正在寻找的东西(分开一个空白的背景颜色)。如果您编辑linum.el,请确保运行

  Mx 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天全站免登陆