From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Native display of line numbers Date: Sun, 18 Jun 2017 17:54:31 +0300 Message-ID: <83tw3dxs60.fsf@gnu.org> References: <83lgoqzm0v.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497797737 12957 195.159.176.226 (18 Jun 2017 14:55:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Jun 2017 14:55:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 18 16:55:32 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dMbbv-0002wX-TW for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 16:55:32 +0200 Original-Received: from localhost ([::1]:38628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMbc0-0006an-19 for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 10:55:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMbbF-00064A-FS for emacs-devel@gnu.org; Sun, 18 Jun 2017 10:54:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMbbB-0003x2-JV for emacs-devel@gnu.org; Sun, 18 Jun 2017 10:54:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMbbB-0003wx-Ga; Sun, 18 Jun 2017 10:54:45 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3294 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dMbbB-0006Oj-0X; Sun, 18 Jun 2017 10:54:45 -0400 In-reply-to: (message from Yuri Khan on Sun, 18 Jun 2017 18:03:18 +0700) 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215747 Archived-At: > From: Yuri Khan > Date: Sun, 18 Jun 2017 18:03:18 +0700 > Cc: Emacs developers > > On Sat, Jun 17, 2017 at 10:12 PM, Eli Zaretskii wrote: > > > I came up with an implementation of a native > > display of line numbers. You can find it in the scratch/line-numbers > > branch of the Emacs repository. > > It is nice to have native line numbers. They work with a non-default > background, correctly handle line wrapping, and even when their face > is customized to a smaller size. (In a larger size, their tops get > truncated, but that’s firmly in the “don’t to that, then” territory.) Hmm... that ought to work. Something's amiss, I'll take a look. I agree that it's a strange thing to do, but bitter experience has taught me that for every strange customization there's a more-or-less valid use case out there, so it's better to have the code follow the expectations than have bug reports ;-) > But now we have three facilities that can display auxiliary > information around the buffer text: margin, fringe, and line numbers, > all with their own unique limitations: > > * The margin’s limitation is that its overall background is defined by > the default face. Fragments of text are displayed in the margin can > specify their own background, but the space where nothing is displayed > is always the same color as the buffer. Also, overlay performance. (You can write in the margins using 'display' text properties you put on buffer text or on line-prefix strings.) > * The fringe can only display bitmaps, only monochrome bitmaps, and > only bitmaps at native display resolution. Which makes all bitmaps > that are designed for low resolution displays unreadably tiny on a > HiDPI display. > > * And the line numbers area only displays line numbers. > > > The relative ordering of the margin and fringe can be customized with > ‘fringes-outside-margins’ but line numbers are always inside both of > those. That means a line number area with a non-default background > color will visually divide the display. Also, the line wrapping > indicator in the fringe is visually separated from the wrapped line. > IMO, it should be possible to put the fringe, and maybe the margin, > inside line numbers. That would AFAIU require a change in basic design of the screen layout: it currently assumes only 3 areas, the 2 margins and the text area. But I'm not sure I understand the motivation: is it due to the background issues with the margins? If so, fixing that might be much easier.