From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Rankin Newsgroups: gmane.emacs.bugs Subject: bug#29597: 26.0.90; line-number-display-width returns incorrect width Date: Fri, 08 Dec 2017 12:32:31 +1000 Message-ID: <1512700351.3662600.1198017792.20921918@webmail.messagingengine.com> References: <1512624891.1385920.1196858744.3908725A@webmail.messagingengine.com> <1512697446.3649570.1197990904.2822A9C1@webmail.messagingengine.com> <87d13qf07e.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1512700396 3617 195.159.176.226 (8 Dec 2017 02:33:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2017 02:33:16 +0000 (UTC) Cc: 29597@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 08 03:33:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8TJ-0000ah-BD for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Dec 2017 03:33:06 +0100 Original-Received: from localhost ([::1]:35293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN8TO-0005re-QO for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Dec 2017 21:33:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN8TJ-0005rX-9T for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 21:33:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN8TG-0000Qg-6L for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 21:33:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eN8TG-0000Q2-1i for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 21:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eN8TF-0004xD-My for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 21:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2017 02:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29597 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 29597-submit@debbugs.gnu.org id=B29597.151270035419006 (code B ref 29597); Fri, 08 Dec 2017 02:33:01 +0000 Original-Received: (at 29597) by debbugs.gnu.org; 8 Dec 2017 02:32:34 +0000 Original-Received: from localhost ([127.0.0.1]:51219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8Sn-0004wT-Oy for submit@debbugs.gnu.org; Thu, 07 Dec 2017 21:32:34 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8Sl-0004wL-Tc for 29597@debbugs.gnu.org; Thu, 07 Dec 2017 21:32:32 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 8618820C0F; Thu, 7 Dec 2017 21:32:31 -0500 (EST) Original-Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Thu, 07 Dec 2017 21:32:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=PhPUFVRUYjuQaXWgz 8A9HIMhODgGOtV0KtdzYLq7s4Q=; b=ZVqlQDwb5bMCqphZwbDwXbISEBtd/KQjc l4rsLt/uD4sZeo4MtQfmgLx/I1OtX0NoVAMoaXrFqn50osjf5ALrK1ejrwHUfAxI H80hTgyPBpb0AfK73LYleM05fplfFL5aEOKzLDgKh0UKuScMFEZb/U2id0q5yPxV w/elsR539JZzUvqY2xw1cJJB9vs9EY1/cOya/BATFiCTDQJMXKE8PVehxyDkfuko nrOR84lDYBLCeSU525ZSeql84bZqq6JiVwyOtXwcN0DvLBHgE9ulMsvTgS0JypeS ivxi1s3zIv1gF7M3oJFMCbAM2Ftk0Nhj0opQfavMSq7GCeUZrlKrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=PhPUFV RUYjuQaXWgz8A9HIMhODgGOtV0KtdzYLq7s4Q=; b=lYKfKPFGn4Xtl1nISSaBcs qPQfrTV3esHS8UChb5oeBuep+2ozhZ4PLxsd+3mp/EMtxvdmuAcZDhPENowUsWHB gZFfxaVx8swjxidQaYi6FWFACpnL10b6c7poHJ9oRojP3e5l8QVIxHSnGJ8CQoSj w4a62NjCOpz51g8wBRhcK4Rh5Tddv64OwEq9AOxKtJzRUEq67R3iaz0IwVY/3Cog SdVlb+07azbm0/ZeuvCGcSHOEBqICaRxNYwoEbGbn7ME9KLVDuokp77PoWhxnlyL TSP61viB5jjulIPr7wvvWyxLFOCzFTqNfzT9dJ9OtjTWh/r9G4T5sdQvj4oYWUkA == X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 5F4749E087; Thu, 7 Dec 2017 21:32:31 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface - ajax-1b87d328 In-Reply-To: <87d13qf07e.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140798 Archived-At: On Fri, 8 Dec 2017, at 12:00 PM, Noam Postavsky wrote: > Here's the help text: >=20 > line-number-display-width is a built-in function in =E2=80=98C source= code=E2=80=99. >=20 > (line-number-display-width &optional PIXELWISE) >=20 > Return the width used for displaying line numbers in the selected win= dow. > If optional argument PIXELWISE is the symbol =E2=80=98columns=E2=80= =99, return the width > in units of the frame=E2=80=99s canonical character width. In this c= ase, the > value is a float. > If optional argument PIXELWISE is t or any other non-nil value, return > the width as an integer number of pixels. > Otherwise return the value as an integer number of columns of the face > used to display line numbers, =E2=80=98line-number=E2=80=99. Note th= at in the latter > case, the value doesn=E2=80=99t include the 2 columns used for paddin= g the > numbers on display. Thanks Noam, much appreciation =F0=9F=99=8F I=E2=80=99m sorry to be so blunt, but did anyone actually read this? I=E2= =80=99ve read over it several times and cannot understand the writer though= t it would make sense to anyone not already intimately familiar with the co= de. The questions that arise.... - Why does an argument PIXELWISE take a symbol =E2=80=9Ccolumns=E2=80=9D?=20 - Why does PIXELWISE then return characters? - Still, why would the function not just return the width of the line numbe= rs *with* the 2 columns for padding? I mean, we=E2=80=99re not dealing with some deeply entrenched internal func= tion where these sorts of mental contortions are required to maintain backw= ards compatibility, this is a *new* feature. I understand that this function is also used internally for specific purpos= es, so it needs to behave a specific way to appease the initial writer of t= he code. But for the sake of sanity, I strongly suggest either fixing this = function or creating a separate =E2=80=9Cpublic=E2=80=9D function that oper= ates vaguely in line with user expectation for those of us wanting to accom= modate display-line-numbers-mode.