From unknown Mon Jun 23 18:30:57 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#38717 <38717@debbugs.gnu.org> To: bug#38717 <38717@debbugs.gnu.org> Subject: Status: display-line-numbers set to relative Reply-To: bug#38717 <38717@debbugs.gnu.org> Date: Tue, 24 Jun 2025 01:30:57 +0000 retitle 38717 display-line-numbers set to relative reassign 38717 emacs submitter 38717 "Franco A. Cortesi" severity 38717 minor tag 38717 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 22 23:02:54 2019 Received: (at submit) by debbugs.gnu.org; 23 Dec 2019 04:02:54 +0000 Received: from localhost ([127.0.0.1]:50457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijEvl-0006l8-UR for submit@debbugs.gnu.org; Sun, 22 Dec 2019 23:02:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:36325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijEjM-0006R1-Lq for submit@debbugs.gnu.org; Sun, 22 Dec 2019 22:50:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47448) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijEjL-00059O-7R for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 22:50:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijEjJ-0002QJ-SP for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 22:50:02 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:42928) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ijEjI-0002Gf-UL for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 22:50:01 -0500 Received: by mail-wr1-x433.google.com with SMTP id q6so15187272wro.9 for ; Sun, 22 Dec 2019 19:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6CUUPScNZIV8l6/E+mxIUvQfzoZQg6I4R1mtxVzPE50=; b=mQf1u2dnByXTxxm7cYi6X9TTMT+cBzqWPo5laBZ+42oW1vZXqt8SmibO9bLOPUgQcM 4Ds5M16wMCPRGT/aQXeZiAofG25xgny9ZTWkHMlaue7l+JmRYY9I1kmZ+/GDymYCJrxi Ie0KkApMBfuqMQmLoTJY6MxwBdMEL0ephM0MaRF6CRIBBz3S2qPHwB/ihMmGLKcDfVWq 1WBeoXHukj5+UtPj2gA/3hikh0mcWSRD+Y7tXIuWbiAjVJyppgCTQ/kAPlYQfcktnaFr aRAHGg5Xy25nBZEoqQUBmDU+VwjHm3NR/hyHhK4WUsLOae5ZC+HhAaQVoxJ5PFrBhbB0 mLOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6CUUPScNZIV8l6/E+mxIUvQfzoZQg6I4R1mtxVzPE50=; b=GX3Ap+RvfPdRaT0HJAhRm8fZWgCfX0n5v7kIjw48FEbVpsktsGy34EidLZ7ueARz00 kfHaAdG55EO7J6IbDXeXxvEH5tocj4PgHig1hgSmpeyvPosL+c9nowU1xXUK++fiWVed kvlSc4Fo5CJ6evChCON8nOnPa3pPUpItiNIj8XrqXqKY+8tpgry+TGcPKl2KbqoNAQuM L+14Z2u0eikfH8pagbqb+w+RjdxOqp2ppq2Y1mm/KezkpIBiX5Z5RBHWDNEkTpTrSvij wTjva5nBkLisPn7PCgoLr5skE8pwOhT1iB+isPUVN13xw45gYtF72vtTnJ79WrhAYpkp ArYA== X-Gm-Message-State: APjAAAUbAdwU1KuQqAcIEsScwetZcQ+kFmquQZ8QZ7NlVScFDsYZop7v WhwG0iZyNVBdMgm1kBNQeYaqym6xDbziVTWK/ETXnnZ8f3M= X-Google-Smtp-Source: APXvYqypsVh077a2of3ZvC9p0jnS/eh4XvbuDqu4vDEFETVeeLu8bG5sfy04mvc2wg15BD4aVSRY8W9nkmzZutkWAM4= X-Received: by 2002:adf:e2cf:: with SMTP id d15mr27393306wrj.225.1577072998749; Sun, 22 Dec 2019 19:49:58 -0800 (PST) MIME-Version: 1.0 From: "Franco A. Cortesi" Date: Mon, 23 Dec 2019 00:49:47 -0300 Message-ID: Subject: display-line-numbers set to relative To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000e01ce6059a56eb9b" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 22 Dec 2019 23:02:52 -0500 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 (--) --000000000000e01ce6059a56eb9b Content-Type: text/plain; charset="UTF-8" When display-line-numbers is set to 'relative', the number of spaces before the digits starts growing (to two) when the current line hits 43 in my case. Of course, no other line has more than two digits as the screen only has 56 lines in total so the growing of spaces (and columns) is not needed at all and of course is undesired. This behavior seems to be correctly implemented but for absolute line numbers, where hitting line 43 means the bottom line is close to start showing numbers with three digits. The current line always showing the absolute line number is another big problem as it will make the number of columns to grow and srink anyway. This growing and shrinking could be totally prevented if users were able to remove or configure the contents of the current line indicator. If configurable, a custom face would be also very good. For example a colored "-" indicating the current line would be nice for many users. Lastly and less important, it would be great to be able to remove the space before the first numeric character! To make line-numbers-mode as less invasive and noticeable as possible. This feature (relative line numbers) is AWESOME, especially when used with evil-mode as it allows to navigate the code VERY fast by prefixing next/previous-line commands with exact numbers. No "fast mental math" (when using absolute line-numbers) or inaccurate guessings are needed, only correct information. But I think the first two issues should be addresed to make relative line-numbers really usable without drawbacks. Thank you for reading. --000000000000e01ce6059a56eb9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When display-line-numbers is set to 'relative', th= e number of spaces before the digits starts growing (to two) when the curre= nt line hits 43 in my case. Of course, no other line has more than two digi= ts as the screen only has 56 lines in total so the growing of spaces (and c= olumns) is not needed at all and of course is undesired. This behavior seem= s to be correctly implemented but for absolute line numbers, where hitting = line 43 means the bottom line is close to start showing numbers with three = digits.

The current line always showing the absolute line number is = another big problem as it will make the number of columns to grow and srink= anyway. This growing and shrinking could be totally prevented if users wer= e able to remove or configure the contents of the current line indicator. I= f configurable, a custom face would be also very good. For example a colore= d "-" indicating the current line would be nice for many users.
Lastly and less important, it would be great to be able to remove the= space before the first numeric character! To make line-numbers-mode as les= s invasive and noticeable as possible.


This feature (relative li= ne numbers) is AWESOME, especially when used with evil-mode as it allows to= navigate the code VERY fast by prefixing next/previous-line commands with = exact numbers. No "fast mental math" (when using absolute line-nu= mbers) or inaccurate guessings are needed, only correct information. But I = think the first two issues should be addresed to make relative line-numbers= really usable without drawbacks.

Thank you for reading.
--000000000000e01ce6059a56eb9b-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 01:43:43 2019 Received: (at submit) by debbugs.gnu.org; 23 Dec 2019 06:43:43 +0000 Received: from localhost ([127.0.0.1]:50503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijHRO-0002UT-Ms for submit@debbugs.gnu.org; Mon, 23 Dec 2019 01:43:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:38199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijFS1-0007cG-CT for submit@debbugs.gnu.org; Sun, 22 Dec 2019 23:36:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijFRz-0006pM-T1 for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 23:36:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijFRx-0008MV-C5 for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 23:36:10 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:35427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ijFRx-0008Bf-1i for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 23:36:09 -0500 Received: by mail-wm1-x32d.google.com with SMTP id p17so14997800wmb.0 for ; Sun, 22 Dec 2019 20:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qnqdXMkzZ8T/JLFU2wGVISmEKnZY6dUkzd8YTbWZZnY=; b=FxKJUheMwTbGIzit4yR+GoJCX8YU/cI63/JXaGR8Z+XQYEu01uat7+asSt7v0MuiFd iDYVA39mndBuKTETo45HefIbR6grPQh4EpK2A4dTwSemnUQE7Q57AoZzv6bfBD0RMMUV 6eZN4Dzcie4vEpJ7joYuyi5vsaCFP6OxU1IpNTGAiXEiHoA0DlHI2wlEr978cTWJZPyf EGNzDm8ETkuXP97NROaOEngN6TK+SCBhNXo3c5JUw8wzvguEa4PqZqLgVNfi/Skzjg+w Z3Jy3woGC3uqu9Hh0mBf1S6a6MMHM3VaMz4Qp3/Wobkrr8cFvqkcf7Yna+MqDXGW4Xgf SISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qnqdXMkzZ8T/JLFU2wGVISmEKnZY6dUkzd8YTbWZZnY=; b=Io3CBpPFbejWP88vITABjoKcSsndczBIHeGsTiMF00VcnXBahMdUXvgcxi/foHtPT3 tQCeyM6t6XH8Ubed4fWLDK2ccD0ppkT+u3MAQgsD4i4ScWHzpDyj9mx1jRkcaiRNPLya 6oN6nialFRGSM9dB2YN1I0E+0O8kQ90yEh+5YMYoWVLhS1Jo+wWUBuUfKiOiTh2JlJHm iZdwbrTzGVMKDNPR3We5brRO/81+B4r+F2mQ6P0M5Q5wMIBbvSHBJg5N/r8sejWUdzCC 4nAm5t2rBQbcmTpjl6QV2S3KZd8o2HgtKp2hjge2/61It+R/yRUTbSFglXhfB64HHiB0 eitw== X-Gm-Message-State: APjAAAXzBeHNuuuM3Zy8b8Ox7dWwJlcnPOhF5Pmw+QfApFPuBaTxiy0s 6jpEHwJwdvkXFhBoJNFLh89niZSXCW4WcELRyUI36QHV X-Google-Smtp-Source: APXvYqydum0v8PLTWnT4AVi6kQ3U9sQZxtPrHsyWa0eCTcvq/DRGkohJ0zqtGK5iBWl94vqovT3ThtQ++5cFxnja9Pk= X-Received: by 2002:a7b:c4c5:: with SMTP id g5mr29600328wmk.85.1577075766258; Sun, 22 Dec 2019 20:36:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Franco A. Cortesi" Date: Mon, 23 Dec 2019 01:35:55 -0300 Message-ID: Subject: Re: display-line-numbers set to relative To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000d4f1cf059a57905b" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 23 Dec 2019 01:43:40 -0500 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 (--) --000000000000d4f1cf059a57905b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Of course, evil-mode has a command, meaning "go to nth line", where the number of line is absolute and could be used with absolute_line_numbers. But I think nobody commonly uses this command, or at least, this command is not needed as relative line numbers allows the same behavior with the far more used and easier and commands, meaning "nex-line" and "previous line". Also moving around with relative numbers will always be two digits (key presses) while absolute can be quite higher. I don't understand why relative line numbers are so uncommon. Le lun. 23 d=C3=A9c. 2019 =C3=A0 00:49, Franco A. Cortesi a =C3=A9crit : > When display-line-numbers is set to 'relative', the number of spaces > before the digits starts growing (to two) when the current line hits 43 i= n > my case. Of course, no other line has more than two digits as the screen > only has 56 lines in total so the growing of spaces (and columns) is not > needed at all and of course is undesired. This behavior seems to be > correctly implemented but for absolute line numbers, where hitting line 4= 3 > means the bottom line is close to start showing numbers with three digits= . > > The current line always showing the absolute line number is another big > problem as it will make the number of columns to grow and srink anyway. > This growing and shrinking could be totally prevented if users were able = to > remove or configure the contents of the current line indicator. If > configurable, a custom face would be also very good. For example a colore= d > "-" indicating the current line would be nice for many users. > > Lastly and less important, it would be great to be able to remove the > space before the first numeric character! To make line-numbers-mode as le= ss > invasive and noticeable as possible. > > > This feature (relative line numbers) is AWESOME, especially when used wit= h > evil-mode as it allows to navigate the code VERY fast by prefixing > next/previous-line commands with exact numbers. No "fast mental math" (wh= en > using absolute line-numbers) or inaccurate guessings are needed, only > correct information. But I think the first two issues should be addresed = to > make relative line-numbers really usable without drawbacks. > > Thank you for reading. > --000000000000d4f1cf059a57905b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Of course, evil-mode has a <gg> command, meaning &qu= ot;go to nth line", where the number of line is absolute and could be = used with absolute_line_numbers. But I think nobody commonly uses this <= gg> command, or at least, this command is not needed as relative line nu= mbers allows the same behavior with the far more used and easier <j> = and=C2=A0 <k> commands, meaning "nex-line" and "previo= us line". Also moving around with relative numbers will always be two = digits (key presses) while absolute can be quite higher. I don't unders= tand why relative line numbers are so uncommon.



Le=C2=A0lun. 23 = d=C3=A9c. 2019 =C3=A0=C2=A000:49, Franco A. Cortesi <cortesifranco3@gmail.com> a =C3=A9crit=C2= =A0:
When display-line-numbers is set to 'relative', the number of= spaces before the digits starts growing (to two) when the current line hit= s 43 in my case. Of course, no other line has more than two digits as the s= creen only has 56 lines in total so the growing of spaces (and columns) is = not needed at all and of course is undesired. This behavior seems to be cor= rectly implemented but for absolute line numbers, where hitting line 43 mea= ns the bottom line is close to start showing numbers with three digits.
=
The current line always showing the absolute line number is another big= problem as it will make the number of columns to grow and srink anyway. Th= is growing and shrinking could be totally prevented if users were able to r= emove or configure the contents of the current line indicator. If configura= ble, a custom face would be also very good. For example a colored "-&q= uot; indicating the current line would be nice for many users.

Lastl= y and less important, it would be great to be able to remove the space befo= re the first numeric character! To make line-numbers-mode as less invasive = and noticeable as possible.


This feature (relative line numbers)= is AWESOME, especially when used with evil-mode as it allows to navigate t= he code VERY fast by prefixing next/previous-line commands with exact numbe= rs. No "fast mental math" (when using absolute line-numbers) or i= naccurate guessings are needed, only correct information. But I think the f= irst two issues should be addresed to make relative line-numbers really usa= ble without drawbacks.

Thank you for reading.
--000000000000d4f1cf059a57905b-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 08:48:19 2019 Received: (at 38717) by debbugs.gnu.org; 23 Dec 2019 13:48:19 +0000 Received: from localhost ([127.0.0.1]:50650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijO4I-0006Px-O9 for submit@debbugs.gnu.org; Mon, 23 Dec 2019 08:48:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijO4G-0006Pb-9p; Mon, 23 Dec 2019 08:48:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ijO4A-0008Vj-Ip; Mon, 23 Dec 2019 08:48:10 -0500 Received: from [176.228.60.248] (port=1632 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ijO4A-0001Dm-14; Mon, 23 Dec 2019 08:48:10 -0500 Date: Mon, 23 Dec 2019 15:47:53 +0200 Message-Id: <83h81rxieu.fsf@gnu.org> From: Eli Zaretskii To: "Franco A. Cortesi" In-reply-to: (cortesifranco3@gmail.com) Subject: Re: bug#38717: display-line-numbers set to relative References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38717 Cc: 38717@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: -3.3 (---) tags 38717 notabug thanks > From: "Franco A. Cortesi" > Date: Mon, 23 Dec 2019 00:49:47 -0300 > > When display-line-numbers is set to 'relative', the number of spaces before the digits starts growing (to two) > when the current line hits 43 in my case. Of course, no other line has more than two digits as the screen only > has 56 lines in total so the growing of spaces (and columns) is not needed at all and of course is undesired. > This behavior seems to be correctly implemented but for absolute line numbers, where hitting line 43 means > the bottom line is close to start showing numbers with three digits. This is a side effect of the implementation, which avoids scanning the entire area to be displayed twice, and instead estimates the maximum width of a line number when the first line of a window is displayed, and then sticks to that width for that window. Since Emacs can display variable-size fonts in the same window-full, it must be pessimistic and assume the smallest possible font (which makes the last line's number become larger, and cross the 3-digits threshold sooner). I don't think this is too much to pay for lightning-fast display of line numbers (unlike linum.el and similar modes). > The current line always showing the absolute line number is another big problem as it will make the number > of columns to grow and srink anyway. This growing and shrinking could be totally prevented if users were able > to remove or configure the contents of the current line indicator. If configurable, a custom face would be also > very good. For example a colored "-" indicating the current line would be nice for many users. Sounds like you want to customize the option display-line-numbers-current-absolute, and maybe also to customize the line-number-current-face face. In general, I suggest to type M-x customize-group RET display-line-numbers RET and review the customizable options this mode offers, you might find something you want to change from the default. (The most important options are also described in the Emacs manual.) > Lastly and less important, it would be great to be able to remove the space before the first numeric character! Cannot be done easily, because Emacs supports right-to-left text, where line numbers appear on the right, and when the line number is rendered, Emacs doesn't yet know whether the text after the line number is R2L or L2R. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 15 14:50:43 2020 Received: (at 38717-done) by debbugs.gnu.org; 15 Jan 2020 19:50:43 +0000 Received: from localhost ([127.0.0.1]:35601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irogZ-0008Ss-SW for submit@debbugs.gnu.org; Wed, 15 Jan 2020 14:50:43 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:39600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irogT-0008SR-NU for 38717-done@debbugs.gnu.org; Wed, 15 Jan 2020 14:50:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7+rdLReZXgtppkG49k67nknn/Qi4fbr/vAELccUpuBs=; b=rnqrLJUfpfrWFjIxTd3SEfWjBx dQcq5CLDM9M1RXdgwYUoKP4hUIvR/vRCltQVVhrhv5SvQ30vIf+e7rANA2L1NccOKavZvldAnZi+Z xrTh/918V0MtgdyAmBdvM2hU2MdDwGBHRO2/cvw1nknHFmKw4pmRcEArOejBJMKIFIA6lz+fdwL03 QyKtkNybcESmvyYw4VkIwQDTaJePrgDuqByjRPEO6mvtcICzX9Z76I5frRqXhl15KEHpc0DdRrI8t MwU54Pt/2Rd2d3gGJhWywFaHFEudrxaBOAONKlcwOBXxMNwGPfKCpHlIyFyGttSiDZmZQbFHOQdm+ ns7OlIDg==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:56408 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1irogO-001qhY-3t; Wed, 15 Jan 2020 14:50:28 -0500 From: Stefan Kangas To: Eli Zaretskii Subject: Re: bug#38717: display-line-numbers set to relative In-Reply-To: <83h81rxieu.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Dec 2019 15:47:53 +0200") References: <83h81rxieu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Wed, 15 Jan 2020 20:50:26 +0100 Message-ID: <87k15s1ou5.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38717-done Cc: 38717-done@debbugs.gnu.org, "Franco A. Cortesi" 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: -1.0 (-) Eli Zaretskii writes: > tags 38717 notabug > thanks > >> From: "Franco A. Cortesi" >> Date: Mon, 23 Dec 2019 00:49:47 -0300 >> >> When display-line-numbers is set to 'relative', the number of spaces before the digits starts growing (to two) >> when the current line hits 43 in my case. Of course, no other line has more than two digits as the screen only >> has 56 lines in total so the growing of spaces (and columns) is not needed at all and of course is undesired. >> This behavior seems to be correctly implemented but for absolute line numbers, where hitting line 43 means >> the bottom line is close to start showing numbers with three digits. > > This is a side effect of the implementation, which avoids scanning the > entire area to be displayed twice, and instead estimates the maximum > width of a line number when the first line of a window is displayed, > and then sticks to that width for that window. Since Emacs can > display variable-size fonts in the same window-full, it must be > pessimistic and assume the smallest possible font (which makes the > last line's number become larger, and cross the 3-digits threshold > sooner). > > I don't think this is too much to pay for lightning-fast display of > line numbers (unlike linum.el and similar modes). > >> The current line always showing the absolute line number is another big problem as it will make the number >> of columns to grow and srink anyway. This growing and shrinking could be totally prevented if users were able >> to remove or configure the contents of the current line indicator. If configurable, a custom face would be also >> very good. For example a colored "-" indicating the current line would be nice for many users. > > Sounds like you want to customize the option > display-line-numbers-current-absolute, and maybe also to customize the > line-number-current-face face. > > In general, I suggest to type > > M-x customize-group RET display-line-numbers RET > > and review the customizable options this mode offers, you might find > something you want to change from the default. (The most important > options are also described in the Emacs manual.) > >> Lastly and less important, it would be great to be able to remove the space before the first numeric character! > > Cannot be done easily, because Emacs supports right-to-left text, > where line numbers appear on the right, and when the line number is > rendered, Emacs doesn't yet know whether the text after the line > number is R2L or L2R. So it seems like there is nothing to do here and I'm closing this bug. Best regards, Stefan Kangas From unknown Mon Jun 23 18:30:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 13 Feb 2020 12:24:06 +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