Subject: bug#26445: closed (Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 14 Apr 2017 16:08:02 +0000

Your bug report

#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
26445: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26445
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines
From: Eli Zaretskii <[email-masked]>
To: Alexander Miller <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Fri, 14 Apr 2017 19:07:32 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Alexander Miller <[email-masked]>
> Date: Fri, 14 Apr 2017 17:03:16 +0200
> 
> On 14/04/17 14:16, Eli Zaretskii wrote:
> > Once you tell Emacs to use that font for some range of characters, it
> > should choose the best size automatically.
> Not always. I did not experiment too much, but one example is ⇛ displayed
> by DejaVu Sans being slightly larger than the surrounding Fantasque Sans 
> Mono text.

I said "the best size".  That doesn't always mean "perfect", because
not every font supports all the required sizes.

> At any rate I now have all the tools I need to fix my height issue: For 
> entire character
> ranges being too large (like Font Awesome) the entire range's height can be
> changed with
> (set-fontset-font "fontset-default" '(#xf039 . #xf26e)
>                    (font-spec :size 12 :name "Font Awesome"))
> The exact range is probably not correct, I still need to look up where 
> it starts and ends.
> 
> The same solution can be used to fix the size of a single character:
> (set-fontset-font "fontset-default" '(?\⇛ . ?\⇛)
>                    (font-spec :size 12 :name "Symbola"))

This will work as long as you don't use face scaling.

> The bug can be closed now. Thanks for the help and happy easter.

Thanks, closing.

Subject: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines
From: Alexander Miller <[email-masked]>
To: [email-masked]
Date: Tue, 11 Apr 2017 18:50:55 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

This is probably a continuation of bug#25792.

The issue is that scrolling downwards with a scroll-margin
has the cursor jumping again - this time the issue is caused by 
different height
lines. This does not simply mean being inside a buffer where some lines
are fontified to use a different height attribute than others. The
stutter already occurs due to the miniscule height differences
introduced by box or over- and underline face attributes.

The following bits of code can reproduce the issue in emacs -q:

* (custom-set-faces `(button ((t (:box "#ffffff" :underline nil 
:overline nil
:background nil :foreground "#ffffff")))))
* (setq scroll-margin 10 scroll-conservatively 101)
* (defun maketext ()
(interactive)
(dotimes (i 1000)
(insert (format "\ntext %s\n" i))
(insert-text-button (format "text %s" i))))
* (maketext)

Scrolling down in this text induces the same stutter as in the previous
bug. Strangely enough the issue only occurs when the cursor is in a
column other than the very first. Only scrolling downwards is affected,
at least in a way I was able to reproduce it in emacs -q.
I also do have the same issue with upwards scrolling in org-agenda buffers
when running a heavily modified spacemacs, with a theme that makes heavy
use of boxed and different height text, so it's difficult to say where
things start exactly.

The second, maybe wholly unrelated, part is the cursor's column
movement. This time scrolling in either direction is affected. To
reproduce put the cursor at the very end of a line containing
unboxed text and scroll down or up. The cursor will move to the previous
column on every boxed line and move back again for unboxed lines.

In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.10)
of 2017-04-10 built on a-laptop
Repository revision: 3ccd0ff1064a2836c379b13c2d5f4b11c5da1f88
Windowing system distributor 'The X.Org Foundation