From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Native display of line numbers Date: Sun, 18 Jun 2017 23:54:38 +0700 Message-ID: References: <83lgoqzm0v.fsf@gnu.org> <83tw3dxs60.fsf@gnu.org> 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 1497805008 31448 195.159.176.226 (18 Jun 2017 16:56:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Jun 2017 16:56:48 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 18 18:56:43 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 1dMdVC-0007sy-OS for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 18:56:42 +0200 Original-Received: from localhost ([::1]:39003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMdVI-0001S2-2z for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 12:56:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMdTb-0000sl-0X for emacs-devel@gnu.org; Sun, 18 Jun 2017 12:55:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMdTa-0008TL-4H for emacs-devel@gnu.org; Sun, 18 Jun 2017 12:55:03 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:34885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMdTY-0008Sq-F2; Sun, 18 Jun 2017 12:55:00 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id x70so60980025wme.0; Sun, 18 Jun 2017 09:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=sSO6Va6CeUVFZRv7F5xug0vHJyvucJvKtATrSRpgMu4=; b=Vt0Bb4b2Ri6cEYPWd4hZQk2MdnJ2/Pjok2hxkHaP6PxbILXBek2M6dEK6AsmRtsY5l gwf8PWOImdwJjEeW4duK9IQ6rIcnUXN6rylo7mSImo+PNvP3bBTAWRah01J1bMYMXanU maQ8GbgrxJ0z5LBU+YDXjVORyxnAi67ctudZAK6o0QXNkUbobzU8ViQNko1JpWdTtcbd NUVuSog23Xl30S4jrUQH5ju8Z69dwKxbHuR2pN/cZnJ+EHe5UTF1ME4zQtwnrCHMU2Dp j7jo0MaL+JA858aMS7Hpvuy+hf7uKGUgjM2KqyzQMAc7VBJ7mS0ZTK/nGk+d/o81deUr qJwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=sSO6Va6CeUVFZRv7F5xug0vHJyvucJvKtATrSRpgMu4=; b=Ed3k/xCg4A7Woh8UDQJ7DRcCACIsXxK9XjFVWPhZA5ApmTmIUrSuP0Iv+MnelumfKX Ay82HTahV2Mv4v+3NPOmw6JCztb3rPhA2hvrUCAvTilycEPdOhWzMxTV2Mbm3b4qg/Oj cqaVKbya9JkAsNL196nsaBFac38HHuvLboStVjJc7XcsnAg0+FgVhen0+8RlVSDYI5CZ fFATiV+5avXtCaIISRIFmLDDli9R2PwNAMhe1xHgq89s8KDOC1rq5XBIZV5h1EfEs980 pMvcJRBaqC+6efE5STJuOf3+Uqdkd4EmoGd0iOeZ7XmVNWcbpH/avqgIFb89YdTgMHyd Xaew== X-Gm-Message-State: AKS2vOwXvhnY4MEbwRbaviuvweh801T0wtB91/RXE/HMCYTqBYNbVMmv pU53ntr/ey6TdQj/RI3rZGQsYFSZl+i6 X-Received: by 10.28.91.198 with SMTP id p189mr12443217wmb.97.1497804898954; Sun, 18 Jun 2017 09:54:58 -0700 (PDT) Original-Received: by 10.223.164.93 with HTTP; Sun, 18 Jun 2017 09:54:38 -0700 (PDT) In-Reply-To: <83tw3dxs60.fsf@gnu.org> X-Google-Sender-Auth: w6r88rQYA2w-jXAYnOMmjnBliaA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a 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:215752 Archived-At: On Sun, Jun 18, 2017 at 9:54 PM, Eli Zaretskii wrote: >> The relative ordering of the margin and fringe can be customized with >> =E2=80=98fringes-outside-margins=E2=80=99 but line numbers are always in= side 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. The base motivation is to have an intuitive ordering of out-of-buffer adornments. Out of the box in Emacs, there are: * line numbers * line wrap indicators * horizontal scrolling indicators * debugging overlay arrows Some IDEs also display in their gutters: * change bars indicating modifications since the last commit (in Emacs, see Git-Gutter) * in-buffer bookmark indicators (functionality of bm.el) * folding indicators and controls (functionality of outline-minor-mode) * static analysis warnings (flycheck) Some of these attract to the buffer text more strongly than others. Let=E2=80=99s take scrolling indicators, because it=E2=80=99s easiest to ex= plain the logic. Suppose a long line: Lorem ipsum dolor sit amet, consectetur wgah=E2=80=99nagl fhtagn. We put it in a narrow window: Lorem ipsum dolor sit amet, consectetur =C2=BB We can scroll it horizontally: =C2=AB sit amet, consectetur wgah=E2=80=99nagl fhtagn. So far, in all cases, a scrolling indicator implies some text is elided at this point. Now we enable line numbers. As is: =C2=AB 42 amet, consectetur wgah=E2=80=99nagl fhtagn. If the elided text were inserted at the position of the indicator, the line number would end up in the middle of the line. Compare: 42 =C2=ABt amet, consectetur wgah=E2=80=99nagl fhtagn. Similarly, a pair of wrapping indicators serves as a =E2=80=9Cportal=E2=80= =9D which a long line enters and another =E2=80=9Cportal=E2=80=9D out of which the cont= inuation emerges. They want to be immediately adjacent to the line. 42 Lorem ipsum dolor sit amet, consectetu} }r wgah=E2=80=99nagl fhtagn. If the margin background issue were fixed but line numbers remained closely tied to the buffer, I would probably continue using the now deprecated linum-mode, because this configuration gives me the intuitive ordering.