From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Native display of line numbers, improved Date: Mon, 26 Jun 2017 12:12:34 -0400 Message-ID: References: <83tw35thxw.fsf@gnu.org> <87efu7lsj0.fsf@lylat> <83r2y7sc9q.fsf@gnu.org> <87a84vl8gm.fsf@lylat> <83podqsst5.fsf@gnu.org> <83efu6spyk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498493577 28301 195.159.176.226 (26 Jun 2017 16:12:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2017 16:12:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 18:12:53 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 1dPWd6-0006to-1A for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 18:12:48 +0200 Original-Received: from localhost ([::1]:47499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPWdB-0004Ae-2S for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2017 12:12:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPWd0-00049D-CJ for emacs-devel@gnu.org; Mon, 26 Jun 2017 12:12:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPWcw-00048b-L9 for emacs-devel@gnu.org; Mon, 26 Jun 2017 12:12:42 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:38909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPWcw-00047W-El; Mon, 26 Jun 2017 12:12:38 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v5QGCY7m002013; Mon, 26 Jun 2017 12:12:35 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 682E66627F; Mon, 26 Jun 2017 12:12:34 -0400 (EDT) In-Reply-To: <83efu6spyk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 26 Jun 2017 18:56:03 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6056=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6056> : inlines <5950> : streams <1751611> : uri <2451214> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:216000 Archived-At: >> Basically, start with a small value of display-line-number-width, and if >> during display we find that this value is too small to fit the largest >> displayed line-number, we increase it. > I wanted to avoid using a buffer-local variable settable by the > display engine. (I cannot easily use display-line-number-width, > because that's a user-settable option; I need another variable.) Oh, I didn't mean to use that variable. I was just explaining that Alex request to "grow-only" seems to work fairly well to provide "mostly constant width" without having to scan the whole buffer upfront. How to provide "grow-only" (i.e. where to store the previous-width info) is not something I've thought about, but maybe it can be kept as a window-local information, reset whenever we set-window-buffer. Stefan