From unknown Wed Jun 18 23:18:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#26445 <26445@debbugs.gnu.org> To: bug#26445 <26445@debbugs.gnu.org> Subject: Status: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines Reply-To: bug#26445 <26445@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:18:34 +0000 retitle 26445 26.0.50; Scroll margin and cursor movement working incorrectl= y when scrolling over different height lines reassign 26445 emacs submitter 26445 Alexander Miller severity 26445 minor tag 26445 confirmed notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 11 12:51:14 2017 Received: (at submit) by debbugs.gnu.org; 11 Apr 2017 16:51:14 +0000 Received: from localhost ([127.0.0.1]:43187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxz0c-0004NB-0X for submit@debbugs.gnu.org; Tue, 11 Apr 2017 12:51:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxz0b-0004Mx-77 for submit@debbugs.gnu.org; Tue, 11 Apr 2017 12:51:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxz0V-0002qf-0a for submit@debbugs.gnu.org; Tue, 11 Apr 2017 12:51:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cxz0U-0002qZ-TY for submit@debbugs.gnu.org; Tue, 11 Apr 2017 12:51:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxz0T-0004mY-EQ for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 12:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxz0O-0002nW-Jm for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 12:51:05 -0400 Received: from mout.web.de ([212.227.17.11]:57965) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxz0O-0002mY-68 for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 12:51:00 -0400 Received: from [192.168.1.5] ([134.3.25.9]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lx7Ab-1c0YmX2wsD-016fOE for ; Tue, 11 Apr 2017 18:50:56 +0200 To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines From: Alexander Miller Message-ID: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> Date: Tue, 11 Apr 2017 18:50:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:D8sbPdX4GUvYMdRlJMDMcXYS8D2m1m+jVj47PTQBUhC0ACQnfEp BeHLsxglhXatb9uzDy2IyCFqgRrSiMMIAPgk6TSXoagNT4VhGdiBBQPml2aSsW4tWCJv5FE TIQFA17wgVZQxQokedbimSOFfp77dvAA6WMNysmsGN7pBtx0yFmf4vc/OIJp5qnx27LcBOn a8M8jjUHp4tTOJLBOyU7Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:i8/QMND0fbc=:DV9FtqQ8QShaib7D03L4sq BydaP62SkMAa3YHMI54/URcMF0fWjaT5OX2/AMUk62YlMoa/NYwJ+gzWQ9n/AJKChXwiT+yKe DBhDmgqa2PmwtifhbsauuNS2wgm0vr/3IB/F0jQWH56MJG2JRlniMyyvZpVpqxT1nTUE6Uu6V /yFmLoVggGiVBeGRPl7tKR40ENzpVCc1LtEgm7GlHCREaHM3ErqzPNKFKaV16W1jYL3fIWmyz EL+OL3q4c8EfjuC08tF2SbBHhLitOLEleBT+WdG3aMN0V1D6DxYQdPkPimwhbnjNxnh3rKYe+ 9TOuahvdMHClvZ0o6SKAdLY2UMXtIodIaYboAkSsDff9M8o7WiXafh1WHN14KuTvl+CpE/z1K Bx+K1LGqN+15dz2kucMLh1svFNVVFyknKId6zpC84+NkoJvOTKUZS/SgZjR0Z6pvQrqhJlqAV ynEAxHamka1zATyUtmO8+QQYqTyN0zb9WEq8ZUXbL1SGSTp8WgtOV9J+MZzm51bNVdll10Nsb 6JLz3MuznwpVICR/1rRE+DXHyMZROJJocMc76WTCIQVwnTZb7NysmL4CqEL9u1NmHTxGCE7yl tCAC7nHY3+9uiEO7f/4QT7dlxqsLHPcIinkrfrkjDhRF3eWVTG9FSqaedMBQ2QDmRfW0mHVE9 6EXrv9LqQzxZqutDZzoJ+5TpGwMnGUAvjfcP65r471luO5WRecCsJmd19dqpSB2+DuWWRXcMb f6TszvtKdlUOpQ1gVbzE5Fv+09eLCuu91SPeI2VHNSOj42CnMEyf/yMSYr6agUQH5WXbBs8KN 6A6vkAm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 13 15:09:22 2017 Received: (at 26445) by debbugs.gnu.org; 13 Apr 2017 19:09:22 +0000 Received: from localhost ([127.0.0.1]:46013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyk7N-0001RP-QD for submit@debbugs.gnu.org; Thu, 13 Apr 2017 15:09:21 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:34286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyk7M-0001R8-GP for 26445@debbugs.gnu.org; Thu, 13 Apr 2017 15:09:20 -0400 Received: by mail-oi0-f49.google.com with SMTP id g204so75474908oib.1 for <26445@debbugs.gnu.org>; Thu, 13 Apr 2017 12:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/gDDfQb2tAKg1Y1P6X8DO40hb6EZQyZ8qKIdhhJe5ug=; b=EXDJF7r7CjBokkFP3hptVzOOuZCHsfYeInF8yxSh8rfciC7U54Ei24wAAwNBQWRe6A 1OiaCMjPQmh2i6T0u0jzbvijEfc9q3mDLWWGeJPiLuImQ92M9hodP2mjF5XL5Igvlg+n ZLC8bHDoC46mWTCgd8iYqv0kr+HgxrYZ/MoYNJgg3LCTCZs6IMJ1ci7kAVEPj0js1bJM sq81YeEMPNz4dy8Lun+uWH49FNwqIPzEf9e0QBDVw7+tbXbb/DkLaC+BVFXdeHZK+w6b nKbWSVyqXcA+PSQp7QzTTQPu88+PpspHp5gXrYjg7uTD4ty8iYiaqIkmqTnQpugQlKOp IAwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/gDDfQb2tAKg1Y1P6X8DO40hb6EZQyZ8qKIdhhJe5ug=; b=TI/pkiHSvqCk39Qwvb2N5wXABaYRzUeKC1AFfLA1Q5zi2nGyeh6S8Qu7vTNxh4JzRq hKcxC4HdX200fuZRIfqD/KHOmuJWNBu166kmqL+W0+SCxkz1uu1GFaJc65cYzPCMioY9 tpjTKieVekX98vz5MvcbixFFrvzj7q6v50/jsNaum86wfvzm8xZ9n8JdXffFax5ZLP6u b+42RS6By675SkyWhZ4Qi9z00gEGHiBAq1WxTvdVAAR2bNf/Bm12XWGT31aDrKN2RW7R O+rAXDTUA6IoHoLSW847MERHIkVnp3mP6+jq4BvjhcbgqKHT56r+dqKbmUUbajQQt3hA wBRw== X-Gm-Message-State: AN3rC/5S6uss8I+/hwc4nZcunwa1LyPubHW/upL5As/6otTQc0H1/E6E G+U6SMV4TRYJ0jiHC6d4G5Ohzhl/og== X-Received: by 10.157.43.35 with SMTP id o32mr3372011otb.79.1492110554718; Thu, 13 Apr 2017 12:09:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.9.178 with HTTP; Thu, 13 Apr 2017 12:09:14 -0700 (PDT) In-Reply-To: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> From: Noam Postavsky Date: Thu, 13 Apr 2017 15:09:14 -0400 X-Google-Sender-Auth: NsmDmZgOFC0d2bN9ZU7su5zmedE Message-ID: Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines To: Alexander Miller Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) found 26445 24.5 tag 26445 confirmed severity 26445 minor quit On Tue, Apr 11, 2017 at 12:50 PM, Alexander Miller wrote: > This is probably a continuation of bug#25792. The symptoms are similar, but this one seems to be a long-standing bug, I get the same behaviour in 24.5 (haven't tested earlier versions, but I wouldn't expect anything different). This code in `try_cursor_movement' is what's different for scrolling vs non-scrolling lines. /* If within the scroll margin, scroll. Note that MATRIX_ROW_BOTTOM_Y gives the pixel position at which the next line would be drawn, and that this_scroll_margin can be zero. */ if (MATRIX_ROW_BOTTOM_Y (row) > last_y || PT > MATRIX_ROW_END_CHARPOS (row) /* Line is completely visible last line in window and PT is to be set in the next line. */ || (MATRIX_ROW_BOTTOM_Y (row) == last_y && PT == MATRIX_ROW_END_CHARPOS (row) && !row->ends_at_zv_p && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) scroll_p = true; I think the root issue might be that scroll-margin is given in lines, and then it's translated to pixels under the assumption that lines are all using the default height. Although my initial attempt to make window_scroll_margin take different line heights into account doesn't seem to have any effect. AFAICT, the next test, PT > MATRIX_ROW_END_CHARPOS (row), just triggers instead. modified src/window.c @@ -4820,10 +4820,17 @@ window_scroll_margin (struct window *window, enum margin_unit unit) } int max_margin = min ((window_lines - 1)/2, (int) (window_lines * ratio)); - int margin = clip_to_bounds (0, scroll_margin, max_margin); - return (unit == MARGIN_IN_PIXELS) - ? margin * frame_line_height - : margin; + int margin_lines = clip_to_bounds (0, scroll_margin, max_margin); + if (unit == MARGIN_IN_LINES) + return margin_lines; + else + { + struct it it; + init_iterator (&it, window, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); + move_it_to (&it, -1, -1, it.last_visible_y, -1, MOVE_TO_Y); + move_it_by_lines (&it, -margin_lines); + return it.last_visible_y - it.current_y; + } } else return 0; From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 13 15:39:35 2017 Received: (at 26445) by debbugs.gnu.org; 13 Apr 2017 19:39:35 +0000 Received: from localhost ([127.0.0.1]:46067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cykac-0005mZ-Rk for submit@debbugs.gnu.org; Thu, 13 Apr 2017 15:39:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cykab-0005mN-Bp for 26445@debbugs.gnu.org; Thu, 13 Apr 2017 15:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cykaS-0003Ci-PU for 26445@debbugs.gnu.org; Thu, 13 Apr 2017 15:39:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cykaS-0003Cd-LT; Thu, 13 Apr 2017 15:39:24 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4917 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cykaR-0001Mo-94; Thu, 13 Apr 2017 15:39:24 -0400 Date: Thu, 13 Apr 2017 22:39:40 +0300 Message-Id: <83wpaogkqr.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: (message from Noam Postavsky on Thu, 13 Apr 2017 15:09:14 -0400) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445 Cc: alexanderm@web.de, 26445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Noam Postavsky > Date: Thu, 13 Apr 2017 15:09:14 -0400 > Cc: 26445@debbugs.gnu.org > > This code in `try_cursor_movement' is what's different for scrolling > vs non-scrolling lines. > > /* If within the scroll margin, scroll. Note that > MATRIX_ROW_BOTTOM_Y gives the pixel position at which > the next line would be drawn, and that > this_scroll_margin can be zero. */ > if (MATRIX_ROW_BOTTOM_Y (row) > last_y > || PT > MATRIX_ROW_END_CHARPOS (row) > /* Line is completely visible last line in window > and PT is to be set in the next line. */ > || (MATRIX_ROW_BOTTOM_Y (row) == last_y > && PT == MATRIX_ROW_END_CHARPOS (row) > && !row->ends_at_zv_p > && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) > scroll_p = true; Not sure what you are saying: do you see some problem in the above code? If so, where do you see a potential problem. > I think the root issue might be that scroll-margin is given in lines, > and then it's translated to pixels under the assumption that lines are > all using the default height. If that's the problem, I see no good solutions here, because scroll-conservatively > 100 explicitly requests to position point as close to the window edge as possible, and the alternating lines of different height in the recipe of this bug report force us to stop one line earlier every other scroll. Am I missing something? > Although my initial attempt to make > window_scroll_margin take different line heights into account doesn't > seem to have any effect. AFAICT, the next test, PT > > MATRIX_ROW_END_CHARPOS (row), just triggers instead. Not sure how to interpret what you say here. If point is beyond MATRIX_ROW_END_CHARPOS of a row, it means point is not in this row, because MATRIX_ROW_END_CHARPOS gives the buffer position of the first character in the next row. There are no coordinates, pixel or otherwise, involved here. > modified src/window.c > @@ -4820,10 +4820,17 @@ window_scroll_margin (struct window *window, > enum margin_unit unit) > } > int max_margin = min ((window_lines - 1)/2, > (int) (window_lines * ratio)); > - int margin = clip_to_bounds (0, scroll_margin, max_margin); > - return (unit == MARGIN_IN_PIXELS) > - ? margin * frame_line_height > - : margin; > + int margin_lines = clip_to_bounds (0, scroll_margin, max_margin); > + if (unit == MARGIN_IN_LINES) > + return margin_lines; > + else > + { > + struct it it; > + init_iterator (&it, window, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); > + move_it_to (&it, -1, -1, it.last_visible_y, -1, MOVE_TO_Y); > + move_it_by_lines (&it, -margin_lines); > + return it.last_visible_y - it.current_y; > + } Is this a suggested patch? If so, how can it fix the issue? When a line is taller than the canonical height, positioning point on it might enter the scroll-margin, and we still need to back up, don't we? IOW, the above code still move "by lines", and will "stutter" if lines are intermittently of different height. What possible solution could we come up with in such situations? It seems to me that the user gets what they asked for. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 13 16:05:39 2017 Received: (at 26445) by debbugs.gnu.org; 13 Apr 2017 20:05:39 +0000 Received: from localhost ([127.0.0.1]:46095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cykzq-0006Pm-Vj for submit@debbugs.gnu.org; Thu, 13 Apr 2017 16:05:39 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:35520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cykzp-0006PT-Ds for 26445@debbugs.gnu.org; Thu, 13 Apr 2017 16:05:37 -0400 Received: by mail-oi0-f48.google.com with SMTP id f22so76726892oib.2 for <26445@debbugs.gnu.org>; Thu, 13 Apr 2017 13:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Yfgp8pc3HpAjlVV5DikikfuOUnBecZ80NZFqWZgDrDc=; b=lsPGdjnPHKz275IDHmkXsO1KE+aJbMrLjlyStR+ybfV+IoutdNayqRVpy1LHDSJdXY umJsnuVZ76SZMYDw/waYh3tsjCuWhEmS57cePyEUzXlTfB7KWtPQQOH2WSw7fuXON+La EEQ+Dzv609LPZxWMHdx5ogvYGawnKc+OKNMezYkrbf1K6DQKSXG1DDeM9rn73QlemHBQ c941nLX1rcL0d7RLNeN71yJKy+/UxH911sM64Dd6G9GkyBnzxVbbWqBnAdaDMOKxwkE0 /Lvp/q+5T/lSW+OB6Y0v7kPep3ZIrqX5AzWFUqe/eldMso0WnzZ3TKyS9z22EiT+baoC 00BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Yfgp8pc3HpAjlVV5DikikfuOUnBecZ80NZFqWZgDrDc=; b=hPVjvMu7hUtMuHBeERKrVXrdfmXkvCB6q/lZOsIP/8mSkvKobtmwodUYHCZW2GfmAF M3kLdqimAFGunLxt80aBWR+Aw413cKBcMUo4TZZJkPhvaUfdywvWx7LQArs7TMvgEjpq HrNd8ICS3k/d1TiCZs+3/oQh3r6AIlGbPVqwekzUJfy4B24mKjkQqOuLFWqrrIGIlrdP byC4LMGU4XH7s8N9Ec9WLScTZb9GiUs0AZiImCLWBpNrbazxTNwMZIUa5tfIsR0DSWvW Pee2JDj9JocTbktSM3MEplO45YPtNy+ke+nCORdy0N6KYGE/7in59o5yzPPHOnvX47Ra u83Q== X-Gm-Message-State: AN3rC/4MgoPVNcOMW0gSDknPqaIsE585vpOeW0h/YzWzGk8cjm1CP2h8 ze6o59TMsjOJ7qoPaUmmC3QFQ/ee9A== X-Received: by 10.202.89.139 with SMTP id n133mr2905183oib.70.1492113931793; Thu, 13 Apr 2017 13:05:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.9.178 with HTTP; Thu, 13 Apr 2017 13:05:31 -0700 (PDT) In-Reply-To: <83wpaogkqr.fsf@gnu.org> References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> From: Noam Postavsky Date: Thu, 13 Apr 2017 16:05:31 -0400 X-Google-Sender-Auth: CC708jxtgRqa3nE6LrTLp7BkvAc Message-ID: Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines To: Eli Zaretskii Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 26445 Cc: Alexander Miller , 26445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Thu, Apr 13, 2017 at 3:39 PM, Eli Zaretskii wrote: >> From: Noam Postavsky >> Date: Thu, 13 Apr 2017 15:09:14 -0400 >> Cc: 26445@debbugs.gnu.org >> >> This code in `try_cursor_movement' is what's different for scrolling >> vs non-scrolling lines. >> >> /* If within the scroll margin, scroll. Note that >> MATRIX_ROW_BOTTOM_Y gives the pixel position at which >> the next line would be drawn, and that >> this_scroll_margin can be zero. */ >> if (MATRIX_ROW_BOTTOM_Y (row) > last_y >> || PT > MATRIX_ROW_END_CHARPOS (row) >> /* Line is completely visible last line in window >> and PT is to be set in the next line. */ >> || (MATRIX_ROW_BOTTOM_Y (row) == last_y >> && PT == MATRIX_ROW_END_CHARPOS (row) >> && !row->ends_at_zv_p >> && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) >> scroll_p = true; > > Not sure what you are saying: do you see some problem in the above > code? If so, where do you see a potential problem. Just noting that this appears to be where the difference between scrolling and not scrolling on the alternating lines in the recipe is decided. Specifically the first test: MATRIX_ROW_BOTTOM_Y (row) > last_y. > >> I think the root issue might be that scroll-margin is given in lines, >> and then it's translated to pixels under the assumption that lines are >> all using the default height. > > If that's the problem, I see no good solutions here, because > scroll-conservatively > 100 explicitly requests to position point as > close to the window edge as possible, and the alternating lines of > different height in the recipe of this bug report force us to stop one > line earlier every other scroll. Am I missing something? I would have to sketch this out on paper to be sure, but you're probably right. > >> Although my initial attempt to make >> window_scroll_margin take different line heights into account doesn't >> seem to have any effect. AFAICT, the next test, PT > >> MATRIX_ROW_END_CHARPOS (row), just triggers instead. > > Not sure how to interpret what you say here. Just that the debugger seemed to be showing me that the divergence between the scrolling and non-scrolling is at the 2nd test after applying the patch below. > If point is beyond > MATRIX_ROW_END_CHARPOS of a row, it means point is not in this row, > because MATRIX_ROW_END_CHARPOS gives the buffer position of the first > character in the next row. There are no coordinates, pixel or > otherwise, involved here. >> modified src/window.c >> @@ -4820,10 +4820,17 @@ window_scroll_margin (struct window *window, >> enum margin_unit unit) >> } >> int max_margin = min ((window_lines - 1)/2, >> (int) (window_lines * ratio)); >> - int margin = clip_to_bounds (0, scroll_margin, max_margin); >> - return (unit == MARGIN_IN_PIXELS) >> - ? margin * frame_line_height >> - : margin; >> + int margin_lines = clip_to_bounds (0, scroll_margin, max_margin); >> + if (unit == MARGIN_IN_LINES) >> + return margin_lines; >> + else >> + { >> + struct it it; >> + init_iterator (&it, window, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); >> + move_it_to (&it, -1, -1, it.last_visible_y, -1, MOVE_TO_Y); >> + move_it_by_lines (&it, -margin_lines); >> + return it.last_visible_y - it.current_y; >> + } > > Is this a suggested patch? If so, how can it fix the issue? It's not, because it doesn't :) I'm just noting what fails to fix this, for future reference. > When a > line is taller than the canonical height, positioning point on it > might enter the scroll-margin, and we still need to back up, don't we? > IOW, the above code still move "by lines", and will "stutter" if lines > are intermittently of different height. What possible solution could > we come up with in such situations? It seems to me that the user gets > what they asked for. Yes, maybe the answer to this bug is just not to set scroll-conservatively so high then. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 13 17:08:15 2017 Received: (at 26445) by debbugs.gnu.org; 13 Apr 2017 21:08:16 +0000 Received: from localhost ([127.0.0.1]:46139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cylyQ-0007rp-Fa for submit@debbugs.gnu.org; Thu, 13 Apr 2017 17:08:15 -0400 Received: from mout.web.de ([212.227.17.12]:51473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cylyM-0007rZ-9z for 26445@debbugs.gnu.org; Thu, 13 Apr 2017 17:08:11 -0400 Received: from [192.168.1.5] ([134.3.25.9]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M5Oct-1c83pK1A35-00zTaK; Thu, 13 Apr 2017 23:07:49 +0200 Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines To: Noam Postavsky , Eli Zaretskii References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> From: Alexander Miller Message-ID: <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> Date: Thu, 13 Apr 2017 23:07:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:8VwbODzvq1CmSIlz7bubnHKl3Wh7mlmvPa4zpGoj3FAZvBxUEce 9agrf276KG/A1sJshTspPUNSBbY7PFaF6AvjjXJBHDvgFrv+keqpsJ4FAzgnmMInMaI8Jh2 o9Ch1m/o68gkJ+E1M+Ki0NB2lePTNkLzQbKsTvrnECIBfwKAgJgF8YSU/f6p0kuLnmGHNPx retzUPnPB+oginExIDSMg== X-UI-Out-Filterresults: notjunk:1;V01:K0:wgvzk2L84tU=:onOOtUKii73lAcYFQqZZk2 P5mvnaC35D6nisC7FTnzOxEyFZGjWyNTAu7akdm/G15FEfDRxHwY2jTti49OPi97O9PswoU4t wIM6qBJxnzUtEI5ZOr4BydhIGVGfWngFJct50bNSU1rSGaVmxJynCl/Asp7BqaNw/tS0Ikp2y H6stw+NCNPQJfb5dTAAbTDcTW8weuGtUNpvXZ/bLwJAN/ydeJP7OnyqFoHpud8l1T6tZSPswZ LNnllPOGRBa0UeuG7ilDKF3rYbox7tyMb3iQNazZcEe+ekssu6mMYdhz1TDJGxQ2mWM5WXpQ8 cOSirrPcQ1aoaNlfSJWLYsURb0A3L+QYt5wxe1JIKU6tsOJ7A0ZipekeTZUSjQiQhujFTvuGH 7sJLWfoh8XLQn4zDFqwYUVI/ZZ+B3uuoNMUGt7Zov+zgmPcc/mW3ImWxkl3WsT2OWyiWryY5d RoHPVncJJKknkcEARIIlncbRaisxbCf528nBuLtt8+YvrJadLW7ne+06YAP7ZWN0KKVJYZ7zD UyieBP60IkG/KGNApJD50kHLaV8f1KE4pNpOmy61viSSND/ngSHmRrka7zRUphkbA7fPiekhg bZXMwyhgwOVYCw7FpLO/trwoo6IWzgFUmOBiHgwHoXEljEFENhJFcIz7sqmpkDFei13EzXfqb r0lqHow660nwcQCnHw27P58RjqTEEeMIe/BLfCiJGraMwz/PzKXrLYiqrcLjidfzstbGO8qiL hZ2vjv/KFHcVzIoxht4Skd4/wcakxkx47IGkBNPvSorsKO/l5X+ZM+k6IfAWepfUxS7mFIpx1 jAbLhQ6 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 13/04/17 22:05, Noam Postavsky wrote: > Yes, maybe the answer to this bug is just not to set > scroll-conservatively so high then. That does help with the height difference introduced by thinly boxed text. Unfortunately there are still other cases where where a scroll stutter still remains, caused by unicode symbols. For example using prettify-symbols-mode to replace -> with ⭢ or configs for programs like polybar which naturally contain a host of characters like    🔇 ⏭. I guess if you guys say it cannot be reasonably done I'll consider getting rid of my margin altogether, though I'm still curious why there's no problem when the cursor is at the very start of the line. Then there's also the second part the bug report - the cursor switching columns when scrolling. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 02:50:47 2017 Received: (at 26445) by debbugs.gnu.org; 14 Apr 2017 06:50:47 +0000 Received: from localhost ([127.0.0.1]:46368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyv4B-0006YJ-8y for submit@debbugs.gnu.org; Fri, 14 Apr 2017 02:50:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyv49-0006Y6-LC for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 02:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyv40-0006o0-BN for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 02:50:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyv40-0006nv-4V; Fri, 14 Apr 2017 02:50:36 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1657 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cyv3z-0006a5-Bg; Fri, 14 Apr 2017 02:50:35 -0400 Date: Fri, 14 Apr 2017 09:50:58 +0300 Message-Id: <83vaq7h48d.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: (message from Noam Postavsky on Thu, 13 Apr 2017 16:05:31 -0400) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445 Cc: alexanderm@web.de, 26445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Noam Postavsky > Date: Thu, 13 Apr 2017 16:05:31 -0400 > Cc: Alexander Miller , 26445@debbugs.gnu.org > > >> I think the root issue might be that scroll-margin is given in lines, > >> and then it's translated to pixels under the assumption that lines are > >> all using the default height. > > > > If that's the problem, I see no good solutions here, because > > scroll-conservatively > 100 explicitly requests to position point as > > close to the window edge as possible, and the alternating lines of > > different height in the recipe of this bug report force us to stop one > > line earlier every other scroll. Am I missing something? > > I would have to sketch this out on paper to be sure, but you're probably right. The only solution I see is to use window-vscroll to position point more accurately one line before scroll-margin. That sounds gross to me, though, and will cause a similar "stutter" on the first screen line of the window, so someone else in some other use case will probably complain. If we do want to make such changes, the place to make them is in line-move and line-move-partial, not in xdisp.c. > > When a > > line is taller than the canonical height, positioning point on it > > might enter the scroll-margin, and we still need to back up, don't we? > > IOW, the above code still move "by lines", and will "stutter" if lines > > are intermittently of different height. What possible solution could > > we come up with in such situations? It seems to me that the user gets > > what they asked for. > > Yes, maybe the answer to this bug is just not to set > scroll-conservatively so high then. Or accept the consequences of it being high. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 03:06:28 2017 Received: (at 26445) by debbugs.gnu.org; 14 Apr 2017 07:06:28 +0000 Received: from localhost ([127.0.0.1]:46372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyvJM-0006uw-MG for submit@debbugs.gnu.org; Fri, 14 Apr 2017 03:06:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyvJL-0006uj-Ak for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 03:06:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyvJC-00064V-OW for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 03:06:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyvJC-00064O-Lc; Fri, 14 Apr 2017 03:06:18 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1671 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cyvJB-0000v5-T0; Fri, 14 Apr 2017 03:06:18 -0400 Date: Fri, 14 Apr 2017 10:06:41 +0300 Message-Id: <83tw5rh3i6.fsf@gnu.org> From: Eli Zaretskii To: Alexander Miller In-reply-to: <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> (message from Alexander Miller on Thu, 13 Apr 2017 23:07:48 +0200) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Cc: 26445@debbugs.gnu.org > From: Alexander Miller > Date: Thu, 13 Apr 2017 23:07:48 +0200 > > On 13/04/17 22:05, Noam Postavsky wrote: > > Yes, maybe the answer to this bug is just not to set > > scroll-conservatively so high then. > That does help with the height difference introduced by thinly boxed > text. Unfortunately there are > still other cases where where a scroll stutter still remains, caused by > unicode symbols. > For example using prettify-symbols-mode to replace -> with ⭢ or configs > for programs like > polybar which naturally contain a host of characters like    🔇 ⏭. That depends on what font you have installed that's used to display those characters. It is best to have fonts of approximately the same height. > I guess if you guys say it cannot be reasonably done I'll consider > getting rid of my margin altogether, There's no need to get rid of margins, as I think the problem you describe is purely aesthetic, and quite expected when you have lines of different height. Why does it bother you so much? > though I'm still curious why there's no problem when the cursor is at > the very start of the line. Because the window layout begins at the first screen line, and the y-coordinate of a screen line is its top edge. So the display engine can always position the first screen line exactly, whereas where the last screen line ends depends on what is in-between, and the scroll margin at the end of the window forces the last pixel of the point's line to be above the margin. I also think that if you produce text where lines have more than just 2 different heights, you will see a similar problem while scrolling up as well. > Then there's also the second part the bug report - the cursor switching > columns when scrolling. That's not a bug: the button-face line is slightly longer than the lines in the default face, and scrolling attempts to preserve the x-coordinate of point, not the column (because the same column could be at very different x-coordinate due to fonts, faces, inline images, etc.). You can see what's going on if you put the cursor on a boxed-text line, then scroll: you will see a small jitter of the cursor in the horizontal direction. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 03:46:52 2017 Received: (at 26445) by debbugs.gnu.org; 14 Apr 2017 07:46:52 +0000 Received: from localhost ([127.0.0.1]:46399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyvwS-0007sh-5C for submit@debbugs.gnu.org; Fri, 14 Apr 2017 03:46:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyvwQ-0007sO-SU for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 03:46:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyvwG-0004iT-Jx for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 03:46:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyvw1-0004aK-UL; Fri, 14 Apr 2017 03:46:25 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1731 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cyvw0-0001eY-Vx; Fri, 14 Apr 2017 03:46:25 -0400 Date: Fri, 14 Apr 2017 10:46:49 +0300 Message-Id: <83lgr3h1na.fsf@gnu.org> From: Eli Zaretskii To: alexanderm@web.de In-reply-to: <83tw5rh3i6.fsf@gnu.org> (message from Eli Zaretskii on Fri, 14 Apr 2017 10:06:41 +0300) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> <83tw5rh3i6.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Fri, 14 Apr 2017 10:06:41 +0300 > From: Eli Zaretskii > Cc: 26445@debbugs.gnu.org, npostavs@users.sourceforge.net > > > For example using prettify-symbols-mode to replace -> with ⭢ or configs > > for programs like > > polybar which naturally contain a host of characters like    🔇 ⏭. > > That depends on what font you have installed that's used to display > those characters. It is best to have fonts of approximately the same > height. Btw, , , and  are private-use area (PUA) characters, so I'm not sure what you expected from Emacs to do with them. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 06:56:57 2017 Received: (at 26445) by debbugs.gnu.org; 14 Apr 2017 10:56:57 +0000 Received: from localhost ([127.0.0.1]:46535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyyuO-0004F3-QZ for submit@debbugs.gnu.org; Fri, 14 Apr 2017 06:56:56 -0400 Received: from mout.web.de ([212.227.15.4]:49213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyyuM-0004Eq-6u for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 06:56:54 -0400 Received: from [192.168.1.5] ([134.3.25.9]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lir9R-1cTDWX482H-00culd; Fri, 14 Apr 2017 12:56:33 +0200 Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines To: Eli Zaretskii References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> <83tw5rh3i6.fsf@gnu.org> From: Alexander Miller Message-ID: Date: Fri, 14 Apr 2017 12:56:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <83tw5rh3i6.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:ZCH9+a+Vzuj69u9+6YIOIgM0bDwTa2Een0R4L958oFbiYsUHgak YQ3/mph5r2TjY5lyG7HHSHXjQ1qeRzBPN/LfkZXbCrRasNWRCNtVJbKMdQeFswElSoP4iub Ogxo+vY/g9ip8kskYV64//dlbYGcv+7Vh3EeXv69WIzKinCeIjEbzKTrTReh0xiwBV/FEV0 T96+WTNUlSvP7xPD2GbEg== X-UI-Out-Filterresults: notjunk:1;V01:K0:+vDc5L+JFD8=:29tIR4hczCjbkTvbalHJE7 v2qWJA1m95UMmac+JA/y7fbHghujdSQ5p99gC1G/9Xy4wYzFcLumSQUFSzp7ub7TTlS4ddRMX NEi2NIf5GHpvs0b98W6bYeyis7b+D42+Jt92hrcDwArErA4JIgsCvKcEOmmVIn7xdBp5J1BuR LpSrpwvvEd69VMDH7kKP+CF8b/FlcRPekas/V2S+k0l/cycdCLni0/iUZrhJO86OHhnbTsp36 ekGgpE9r04KyZZ67cDjdAqP+h5xJRlONXzeYxMW4XVKUsqwFgdXdZGAiffIPCtX3WD4LvEP4Y f5EndpUyOFU4g+dDKhA9xbSxLw0dmhRFHYrwAHVlO2Q9arcB0CMLacVjRVKshn/cuNpOto8Sp s46Y6iWUFc/bte36u6mXRUJlwWD5bmt8X34hXCb1cgC5IFtVLC2th/j/oXCPxDZr7gwX3Ova0 g3E1nZwYQsK+c+BVbSPDd+mdmHGYcbJWiBrsAaMiYfajRrkEWj+W15Y/F7RF19SD66I8F8UGo JJNYmhRdg4FSOEX9a8jHrLbGNpNZf0AnXph4oHVAe1NZZSjDL5c5q8SzwWfNRAiU49lYpEwhH q7eNw8kLLb6RW/0TjqsIY2LwOteAQ1eLhmO1fTGTqGFtr+kAUuzg7XTautrnCXqyARsUOlwJw d5tlqkHvMIQkDYh9RZqN+9hu7CYkp/SIktmLVRJ17qXAmTRwkeC+h+gKhUxJuZyXdL20Gn0mV nFZWtwLc8f1SJLCpi0MyTpscJtyR+EArK0XGNQWEFNKNsRsRusxuv8dmEELgZnGyRM/Xizt8G r/Exmk7 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 14/04/17 09:06, Eli Zaretskii wrote: > That depends on what font you have installed that's used to display > those characters. It is best to have fonts of approximately the same > height. How would I go about finding out which fonts have which height and how to make emacs use them? Looking up font size and height just turns up a bunch of pages about css. For emacs I found I could do something like (set-fontset-font "fontset-default" nil (font-spec :size 1 :name "Symbola")) but that doesn't seem to do anything. > There's no need to get rid of margins, as I think the problem you > describe is purely aesthetic, and quite expected when you have lines > of different height. Why does it bother you so much? I just don't like the inconsistency. The scroll stutter happens when I'm quickly scrolling through a buffer and suddenly see my cursor change position for seemingly no reason. To me it just plain looks like something that is not supposed to happen. I certainly wouldn't have bothered with the bug report if there was a clear and visibly text height difference, but the issue already appears when the height difference cannot be seen with the naked eye. > Btw, , , and  are private-use area (PUA) characters, so I'm not > sure what you expected from Emacs to do with them. I've picked those up from Font Awesome, which brings us back to my previous question. Is it possible to tell emacs that Font Awesome Icons should have the same size as my default text font, and if yes how do I do it? From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 08:16:05 2017 Received: (at 26445) by debbugs.gnu.org; 14 Apr 2017 12:16:05 +0000 Received: from localhost ([127.0.0.1]:46582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz08x-0007n7-WF for submit@debbugs.gnu.org; Fri, 14 Apr 2017 08:16:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz08v-0007mP-ON for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 08:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cz08l-0007HU-Kh for 26445@debbugs.gnu.org; Fri, 14 Apr 2017 08:15:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cz08l-0007HP-HI; Fri, 14 Apr 2017 08:15:51 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2380 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cz08k-0002JO-OV; Fri, 14 Apr 2017 08:15:51 -0400 Date: Fri, 14 Apr 2017 15:16:14 +0300 Message-Id: <83k26ngp69.fsf@gnu.org> From: Eli Zaretskii To: Alexander Miller In-reply-to: (message from Alexander Miller on Fri, 14 Apr 2017 12:56:30 +0200) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> <83tw5rh3i6.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445 Cc: 26445@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Cc: npostavs@users.sourceforge.net, 26445@debbugs.gnu.org > From: Alexander Miller > Date: Fri, 14 Apr 2017 12:56:30 +0200 > > On 14/04/17 09:06, Eli Zaretskii wrote: > > That depends on what font you have installed that's used to display > > those characters. It is best to have fonts of approximately the same > > height. > How would I go about finding out which fonts have which height I don't know any way except by trying, sorry. Perhaps some font expert could offer a more useful method. > and how to make emacs use them? You do that by customizing the default fontset. There are examples in the Emacs manual, and you can see more examples in fontset.el which comes with Emacs. > For emacs I found I could do something like > (set-fontset-font "fontset-default" nil (font-spec :size 1 :name "Symbola")) > but that doesn't seem to do anything. If you have Symbola installed, Emacs will already use it by default. You can see which font is used for a character by invoking "C-u C-x =" at that character's position. If Symbola is not used for some characters, you could customize your default fontset so that it is. > > There's no need to get rid of margins, as I think the problem you > > describe is purely aesthetic, and quite expected when you have lines > > of different height. Why does it bother you so much? > I just don't like the inconsistency. The scroll stutter happens when I'm > quickly scrolling through a buffer and suddenly see my cursor change > position for seemingly no reason. There's no way around that when screen lines have different height. The most you can do is make sure (most of) your fonts are of the same height. FWIW, the characters you mentioned in your email are displayed on my system using Symbola, and the height of the line is the same as for the surrounding text. So perhaps you should just make sure your Emacs uses Symbola for them? > > Btw, , , and  are private-use area (PUA) characters, so I'm not > > sure what you expected from Emacs to do with them. > I've picked those up from Font Awesome, which brings us back to my > previous question. I tried to answer it above. > Is it possible to tell emacs that Font Awesome Icons should have the > same size as my default text font, and if yes how do I do it? Once you tell Emacs to use that font for some range of characters, it should choose the best size automatically. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 12:07:35 2017 Received: (at 26445-done) by debbugs.gnu.org; 14 Apr 2017 16:07:35 +0000 Received: from localhost ([127.0.0.1]:47372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz3l1-0006jk-Do for submit@debbugs.gnu.org; Fri, 14 Apr 2017 12:07:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz3kz-0006jY-RD for 26445-done@debbugs.gnu.org; Fri, 14 Apr 2017 12:07:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cz3kp-00048C-Mb for 26445-done@debbugs.gnu.org; Fri, 14 Apr 2017 12:07:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cz3ka-0003z5-Rs; Fri, 14 Apr 2017 12:07:08 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2943 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cz3ka-0000Fc-94; Fri, 14 Apr 2017 12:07:08 -0400 Date: Fri, 14 Apr 2017 19:07:32 +0300 Message-Id: <83h91rgegr.fsf@gnu.org> From: Eli Zaretskii To: Alexander Miller In-reply-to: (message from Alexander Miller on Fri, 14 Apr 2017 17:03:16 +0200) Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> <83tw5rh3i6.fsf@gnu.org> <83k26ngp69.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26445-done Cc: 26445-done@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alexander Miller > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 12:24:37 2017 Received: (at control) by debbugs.gnu.org; 14 Apr 2017 16:24:37 +0000 Received: from localhost ([127.0.0.1]:47390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz41U-00078I-Pb for submit@debbugs.gnu.org; Fri, 14 Apr 2017 12:24:36 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:35552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cz41S-000784-Hf for control@debbugs.gnu.org; Fri, 14 Apr 2017 12:24:34 -0400 Received: by mail-oi0-f53.google.com with SMTP id f22so96084272oib.2 for ; Fri, 14 Apr 2017 09:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-transfer-encoding; bh=lRe3IvbJrZG0SvW1RSUQlA18L5QZB12E0ZreWl0zNi0=; b=FYpExfwHbOyh9ONcZAuMyb1rUBl848qXcHamHPVwNSAr59ZR9mGKI2Awlz0hbxE8cN nJLToZoYueDJf1gIg6dUP1zsQTVgtyIuBvqePxyBvwqxMwnPnM3FatRsQCR14j1keBE5 VZ3FEjlN+ejxLPs0vi1wHTUwzlIFQEsBDYdGZxWQ5tW2aW6PnHQpFGsqXFcCZgRfDsiD jRvgAzO0nbCEESI0Rk4MkW4TsdOuaoiQaYukEGb++cFhYsGWUtYODK43x4B5fMb4OwMn qFe3dso4hqCd5lPBvHVMT3aD23PD+C+GLEyiaVGqb8JIx6aoJw0AXvM206UJ8WUfh//r qzrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-transfer-encoding; bh=lRe3IvbJrZG0SvW1RSUQlA18L5QZB12E0ZreWl0zNi0=; b=NTLhjyQBiDEVQBGQUTZXtKMKe+bc6jV6Lw/Pb6far++6Ri75xolly6Q4ei5zgCpkE+ PiSlHm6plWNzz+9Bhjk7gvBTmDC0qP8uUq38NnLgTO/W5sM2bpRFjhNjNsX6OiPcs6zi +doxsPKnfiAB8kmruLt0N5yASZIThPhhENoWT9C6//j6C+IX+FKrVqKrKmS2Tu7rbsBk 9lMBSg1I77QdHNexGKUMW3ErlDah3RXZbYlO031nt9b9RV4LTQVYKzRNYiUElS5M8UOb +5RVIY5AF8Eki0bd4bcyGNllyjZN/+5BGQk+VdSfgzGAY5nKkKrdGgsktLlncxHZjNsB 8KJQ== X-Gm-Message-State: AN3rC/74YTAZqvYnuQab3JQbiT5jR9/QWM1p8KeUzABps3OydYr6juey qTbiaBzqPtIBDS2qS5hCmKlRNqcYIg== X-Received: by 10.157.43.35 with SMTP id o32mr6529976otb.79.1492187068614; Fri, 14 Apr 2017 09:24:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.9.178 with HTTP; Fri, 14 Apr 2017 09:24:28 -0700 (PDT) In-Reply-To: <83h91rgegr.fsf@gnu.org> References: <624e8d20-8e9f-f164-d9e8-b81659eec2f7@web.de> <83wpaogkqr.fsf@gnu.org> <858e2c55-9e4c-2293-3070-c091372bb8b2@web.de> <83tw5rh3i6.fsf@gnu.org> <83k26ngp69.fsf@gnu.org> <83h91rgegr.fsf@gnu.org> From: Noam Postavsky Date: Fri, 14 Apr 2017 12:24:28 -0400 X-Google-Sender-Auth: AO34KaLZcG3Rhh_fNmGDxRTHxaQ Message-ID: Subject: Re: bug#26445: 26.0.50; Scroll margin and cursor movement working incorrectly when scrolling over different height lines To: GNU bug tracker automated control server Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) # nothing to fix on Emacs side really tag 26445 notabug quit On Fri, Apr 14, 2017 at 12:07 PM, Eli Zaretskii wrote: >> From: Alexander Miller >> 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 =E2=87=9B = 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" '(?\=E2=87=9B . ?\=E2=87=9B) >> (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. From unknown Wed Jun 18 23:18:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 13 May 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator