From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: James Nguyen Newsgroups: gmane.emacs.devel Subject: Re: Native display of line numbers: visual line-counting Date: Sat, 24 Jun 2017 13:42:21 -0700 Message-ID: References: <83podttfpy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498336960 26307 195.159.176.226 (24 Jun 2017 20:42:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Jun 2017 20:42:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 24 22:42:36 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 1dOrt5-0006du-Rw for ged-emacs-devel@m.gmane.org; Sat, 24 Jun 2017 22:42:36 +0200 Original-Received: from localhost ([::1]:40395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOrtA-00074p-Sx for ged-emacs-devel@m.gmane.org; Sat, 24 Jun 2017 16:42:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOrt2-00074V-Ko for emacs-devel@gnu.org; Sat, 24 Jun 2017 16:42:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOrt1-0002X2-Jo for emacs-devel@gnu.org; Sat, 24 Jun 2017 16:42:32 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:35389) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dOrsw-0002Uh-Dt; Sat, 24 Jun 2017 16:42:26 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B4AB3207B0; Sat, 24 Jun 2017 16:42:22 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 24 Jun 2017 16:42:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=mBaDK0KfekoUPA2kS9 lAPD9fZ+65JnKmxodTqrwlGo8=; b=1ZrJ8dgWr0F6k/Eg5q6WFpqZyXAACrNeoJ ZwdnMn4Y40AELJl+H8t9REhDscx3lxJJNhVuvmMbzYZ7P+AzbzmIReVaan5WjvFV dE5vpaM6V/AusbOo6dgB/q5XXTVeZWaeg+0/0h797DuuIdUrZYJECKToGQP1d6kY 8ShvF5cCGsSepF0bdMPbRgzfAH1NLNkZspVgES+oA53gazdUwDuMEdIHPLmLZRz3 4OBeMg7RYeWk4+ugJGQRTc0W6AFaysC9o0YveBsNazK9d23zEW9+y7qNJKM7Upr9 R95Z3pzfjEBdU5sIpCR/Z31knnlWcXfJP0/8kthZVutRs6hbb2Kw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=mBaDK0KfekoUPA2kS9lAPD9fZ+65JnKmxodTqrwlGo8=; b=Nd2FnDJ1 ms2U/dwzERFNCHlWBz7g+mrGD8oY+6zh8/oWlwJP86h9GsmLPHpJonPp5i128xT/ rvG/TDMtHIZ7p0D+eUVx/xhywKOFWyuuW3l4U8QUirqL7Sou+EsKz0NQoyxWWFK8 qMrrpsr9fevl+vEJQtby8lHWoFiujCxX4/o/R31QWC8oJi8QHtBAHZ/JTxLbrr8u mORGW7P7f8Tgqv9Qup0hcbGZ+8LWS1d+1XHwWcsMrCnXPybXnKnB9mPA4wjqFsc9 G6TxGb23r1JdYWiLp1fVIkulnA8HNciG77AezRbgYhgNEP2FF4ojzQYLo/heo40K LqICjo5XYE9kIA== X-ME-Sender: X-Sasl-enc: /p/OMmSuc6ADB+dVKc8E0Su9HqZ/Hb7IXJtYTPj+KZJD 1498336942 Original-Received: from [10.0.1.47] (c-73-231-191-86.hsd1.ca.comcast.net [73.231.191.86]) by mail.messagingengine.com (Postfix) with ESMTPA id 38CC47E755; Sat, 24 Jun 2017 16:42:22 -0400 (EDT) In-Reply-To: <83podttfpy.fsf@gnu.org> X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.27 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:215943 Archived-At: >> First, this makes sense only for relative line numbers, right? If = not >> I don't really understand what would be the definition of "visually >> counted first line shown in a window". If everyone agrees, it would >> mean that the current line will have the number of zero, right? or = do >> people still want to see the "physical line number" for the current >> line in this case? I am thinking about it in terms of code folding. Each fold becomes the mark of the new line number. 1. static int internal_self_insert (int, EMACS_INT); // Absolute line = number of 1 1. DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 2. doc: /* Return buffer position N characters after (before if N = negative) point. */) 3. (Lisp_Object n) 4. { 5. CHECK_NUMBER (n); 6.=20 7. return make_number (PT + XINT (n)); 8. } 9.=20 10.=20 11. static Lisp_Object 12. move_point (Lisp_Object n, bool forward) 13. { 14. SET_PT (new_point); 15. return Qnil; 16. } Becomes 1. static int internal_self_insert (int, EMACS_INT); {} // FOLD // = Absolute Line number of 1 1.=20 2.=20 3. static Lisp_Object 4. move_point (Lisp_Object n, bool forward) {} // FOLD I'd like the current line to still represent the current absolute line = number of the file. > On Jun 24, 2017, at 11:15 AM, Eli Zaretskii wrote: >=20 > So a few people requested this feature, and I started thinking about > its implementation. Immediately I bumped into several issues that I'm > not sure how to resolve, since I don't really understand how this will > be used in Emacs. >=20 > First, this makes sense only for relative line numbers, right? If not > I don't really understand what would be the definition of "visually > counted first line shown in a window". If everyone agrees, it would > mean that the current line will have the number of zero, right? or do > people still want to see the "physical line number" for the current > line in this case? >=20 > Next, the only use case which I fully understand is the one with > some of the lines folded, as in Org or Outline modes. More > accurately, the case where text is not displayed because it was made > invisible by the 'invisible' property of some kind -- these lines are > not to be counted under this mode. >=20 > But that is not the only case where what is displayed does not > correspond to buffer text 1:1. Some text on the screen might come > from display properties or from before- and after-strings. These can > include embedded newlines, and this contribute to "visual lines" Emacs > displays. Are these lines to be counted or not? Should Emacs display > something for their "line numbers" or not? >=20 > We need to resolve all these and possibly other subtleties before the > feature can be implemented. Ideas and opinions are welcome. >=20 > TIA >=20