unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Line Numbering -- remove leading space; and, customize trailing character.
@ 2019-08-23  1:53 Keith David Bershatsky
  2019-08-23  8:23 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Keith David Bershatsky @ 2019-08-23  1:53 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

I am uncertain whether this issue has already been discussed ad nauseam, either when built-in line numbering first came out or sometime thereafter, but here goes anyway ...  In a recent thread on emacs.stackexchange.com, a user did a comparison screenshot between the new built-in line numbers and the old ones that were generated via Lisp.  In that thread, the user wondered what could be done to shrink the width of the built-in line numbering ...

https://emacs.stackexchange.com/questions/52269/how-to-change-line-number-gutter-width-using-display-line-numbers-mode

I posted an answer pointing the O.P. to the variable `display-line-numbers-width' and its doc-string.  In addition, I made reference to the two lines in maybe_produce_line_number responsible for the left/right space padding surrounding the line numbers.

All of that got me thinking ... how would it look if I removed the leading space and changed the trailing space into a "|" symbol?  Attached is a screenshot of what this looks like ...

Have there been some requests to customize the leading/trailing spaces, and, if so, what was the consensus?  If not, then it may be something worth considering ....  I think the attached screenshot looks kind of nifty, and saves me 11 pixels of screen real estate after eliminating one character (the space) on the left, which happens to be my frame-char-width ...



[-- Attachment #2: line_numbers_mod_001.png --]
[-- Type: image/png, Size: 428412 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Line Numbering -- remove leading space; and, customize trailing character.
  2019-08-23  1:53 Line Numbering -- remove leading space; and, customize trailing character Keith David Bershatsky
@ 2019-08-23  8:23 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2019-08-23  8:23 UTC (permalink / raw)
  To: Keith David Bershatsky; +Cc: emacs-devel

> From: Keith David Bershatsky <esq@lawlist.com>
> Date: Thu, 22 Aug 2019 18:53:58 -0700
> 
> All of that got me thinking ... how would it look if I removed the leading space and changed the trailing space into a "|" symbol?  Attached is a screenshot of what this looks like ...
> 
> Have there been some requests to customize the leading/trailing spaces, and, if so, what was the consensus?  If not, then it may be something worth considering ....  I think the attached screenshot looks kind of nifty, and saves me 11 pixels of screen real estate after eliminating one character (the space) on the left, which happens to be my frame-char-width ...

The leading space that looks "useless" to you makes the display of
line numbers in R2L text as efficient as in L2R text, for somewhat
complicated technical reasons (I can explain if someone _really_ wants
to know, but believe me: you don't ;-).  I bet people who wonder about
those "wasted" few pixels never use R2L or bidirectional text, but we
cannot do anything in Emacs these days on such assumptions.

So yes, this single space is there to stay, at least for now.  The
only compromise we could perhaps consider is replacing the ASCII space
with a thinner non-ASCII space character (on both sides of the
number), although this would get us into the mess of how to detect if
the face's font has a glyph for that, and what to do if it doesn't.
Which is already an expensive complication.

Bottom line: with today's wide hi-res screens, I really cannot
understand why half a dozen pixels "wasted" on that space could make a
difference important enough to complicate the heck out of this
feature.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-23  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-23  1:53 Line Numbering -- remove leading space; and, customize trailing character Keith David Bershatsky
2019-08-23  8:23 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).