all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Rankin <hello@paulwrankin.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 29597@debbugs.gnu.org
Subject: bug#29597: 26.0.90; line-number-display-width returns incorrect width
Date: Fri, 08 Dec 2017 12:32:31 +1000	[thread overview]
Message-ID: <1512700351.3662600.1198017792.20921918@webmail.messagingengine.com> (raw)
In-Reply-To: <87d13qf07e.fsf@users.sourceforge.net>

On Fri, 8 Dec 2017, at 12:00 PM, Noam Postavsky wrote:

> Here's the help text:
> 
>     line-number-display-width is a built-in function in ‘C source code’.
> 
>     (line-number-display-width &optional PIXELWISE)
> 
>     Return the width used for displaying line numbers in the selected window.
>     If optional argument PIXELWISE is the symbol ‘columns’, return the width
>     in units of the frame’s canonical character width.  In this case, 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, ‘line-number’.  Note that in the latter
>     case, the value doesn’t include the 2 columns used for padding the
>     numbers on display.

Thanks Noam, much appreciation 🙏

I’m sorry to be so blunt, but did anyone actually read this? I’ve read over it several times and cannot understand the writer thought it would make sense to anyone not already intimately familiar with the code. The questions that arise....

- Why does an argument PIXELWISE take a symbol “columns”? 
- Why does PIXELWISE then return characters?
- Still, why would the function not just return the width of the line numbers *with* the 2 columns for padding?

I mean, we’re not dealing with some deeply entrenched internal function where these sorts of mental contortions are required to maintain backwards compatibility, this is a *new* feature.

I understand that this function is also used internally for specific purposes, so it needs to behave a specific way to appease the initial writer of the code. But for the sake of sanity, I strongly suggest either fixing this function or creating a separate “public” function that operates vaguely in line with user expectation for those of us wanting to accommodate display-line-numbers-mode.





  reply	other threads:[~2017-12-08  2:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  5:34 bug#29597: 26.0.90; line-number-display-width returns incorrect width Paul Rankin
2017-12-07  8:55 ` Eli Zaretskii
2017-12-08  1:44 ` Paul Rankin
2017-12-08  2:00   ` Noam Postavsky
2017-12-08  2:32     ` Paul Rankin [this message]
2017-12-08 15:01       ` Eli Zaretskii
2017-12-08 15:37         ` Noam Postavsky
2017-12-08 15:53           ` Eli Zaretskii
2017-12-08 15:55           ` Eli Zaretskii
2017-12-08 16:23             ` Noam Postavsky
2017-12-08 16:29               ` Eli Zaretskii
2017-12-08 22:39                 ` Noam Postavsky
2017-12-08 14:22   ` Eli Zaretskii
2017-12-08 14:40     ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512700351.3662600.1198017792.20921918@webmail.messagingengine.com \
    --to=hello@paulwrankin.com \
    --cc=29597@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.