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 line numbers landed on master Date: Mon, 10 Jul 2017 20:50:52 +0300 Message-ID: <83lgnwi3k3.fsf@gnu.org> References: <83k23jl5ra.fsf@gnu.org> <87r2xqo8p7.fsf@lylat> <83lgnxk7v6.fsf@gnu.org> <87shi5jk2w.fsf@lylat> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1499709075 18490 195.159.176.226 (10 Jul 2017 17:51:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2017 17:51:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 10 19:51:09 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 1dUcpr-0004Ed-S8 for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2017 19:51:03 +0200 Original-Received: from localhost ([::1]:42332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcpx-0003Qn-D1 for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2017 13:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcpq-0003QU-Tb for emacs-devel@gnu.org; Mon, 10 Jul 2017 13:51:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcpm-0004Oa-1f for emacs-devel@gnu.org; Mon, 10 Jul 2017 13:51:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcpl-0004OU-UC; Mon, 10 Jul 2017 13:50:57 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4286 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dUcpl-0004bh-92; Mon, 10 Jul 2017 13:50:57 -0400 In-reply-to: <87shi5jk2w.fsf@lylat> (message from Alex on Sun, 09 Jul 2017 16:56:23 -0600) 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:216428 Archived-At: > From: Alex > Cc: emacs-devel@gnu.org > Date: Sun, 09 Jul 2017 16:56:23 -0600 > > I've attached a patch below. I changed the menu bar to toggle the global > mode since the other toggles in the Show/Hide menu are also toggled > globally. Does it look alright for inclusion? I have some comments: > +(defgroup display-line-numbers nil > + "Display line numbers in the buffer." > + :group 'display) This means the defcustoms here will be separate from those defined in cus-start.el. Is that intended? More generally, do we want some of the defcustoms to live here and some in another file? And if we want all of them here, does that mean this file needs to be preloaded, or at least auto-loaded when display-line-numbers is set by the user? > +(defcustom display-line-number-inhibit-shrink nil Instead of "inhibit-shrink" (which is a kind-of double negation), I would suggest to use "grow-only", which AFAIR was your original suggestion. > +(defcustom display-line-number-width-start nil > + "If non-nil, set initial line number width based on buffer contents. "Based on buffer contents" is a euphemism. I would suggest to tell explicitly that this will cause the lines counted in the buffer when it's created. > +To change the type of line numbers displayed by default, > +customize `display-line-number-type'. To change the type while ^^ Two spaces, please. > +(define-globalized-minor-mode global-display-line-numbers-mode > + display-line-numbers-mode > + (lambda () > + (unless (or (minibufferp) > + ;; taken from linum.el > + (and (daemonp) (null (frame-parameter nil 'client)))) > + (display-line-numbers-mode)))) The daemonp part is only needed when display-line-number-width-start is non-nil, right? Thanks.