Emacs Scrolling Error on OS X

Update

This issue disappeared after upgrading from Mountain Lion to Mavericks, as well as upgrading Emacs from 23.4 to 24.3.

End update

With a .emacs file containing

(set-foreground-color "white") (set-background-color "black") (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil))) (setq mouse-wheel-progressive-speed nil) 

when I scroll up or down with a reduced step, I see strange patterns

vertical lines

An increase in one of the patterns shows

magnified one vertical line

This issue is present in Emacs 22, 23 and now 24 for several versions of OSX-up and including Mountain Lion. Is this a known rendering error? Is there a fix?

No suggestion to change the framework and linum works for me. Where else can I look?

If I use the default white background and black foreground, these lines are either not displayed or are invisible (for me).

The most annoying thing about this problem is that redrawing (Cl) does not produce clear text.

+4
source share
1 answer

The problem is the interaction between OS X LCD Font Smoothing and the algorithm that emacs uses to implement scrolling.

The figure below shows that font smoothing is turned off (left) and turned on (right). You will find this parameter in the section "System Preferences \ General". In both cases, I scrolled the program one line. When OS X draws โ€œ@โ€ with font smoothing turned on, it uses not only pixels intended for โ€œ@โ€, but also uses blue pixels of an adjacent (empty) character.

When emacs scrolls, it only modifies the characters that, in his opinion, should be changed. If the symbol is empty and after scrolling remains empty, it will not change it. This optimization remains valid in 2013. In other words, checking that two characters are blank is still cheaper than drawing a single character. But today, this optimization is hardly needed, and this leads to display errors.

If the above hypothesis contains the following question, is it possible to disable optimization. Is it possible to ask emacs to redraw the full screen in each scroll, or at least redraw the characters that remain empty if they are adjacent to a non-empty character.

Font smoothing off (left) and on (right)

You can, of course, just turn off font smoothing. An enlarged image may even suggest that an image without anti-aliasing is better. In practice, when fonts appear in their natural (unrecognizable) size, anti-aliasing makes characters clearer, eliminating the need for large fonts.

Sample on either side of "c ();" in the image below corresponds to an error. OS X uses blue pixels on the left and red / tan pixels on the right (perhaps this is due to the RGB pattern on the display). The vertical lines left during scrolling are either blue or red / brown / bricks, depending on whether they fell on the left or right side of the scrolled characters.

blue hints on the left; red hints on the right

Update

Now the problem is solved this night . Increased c(); created by Emacs 24.3.50.1 shows that font smoothing remains identical to the smoothing released by Emacs 24.3.1. But the output is not identical. There is at least one additional horizontal line of pixels between two lines of text.

+1
source

Source: https://habr.com/ru/post/1480379/


All Articles