From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Justin Burkett Newsgroups: gmane.emacs.devel Subject: Re: Patch for beginning-of-visual-line and end-of-visual-line Date: Sat, 12 Aug 2017 07:54:16 -0400 Message-ID: References: <83inhuq74r.fsf@gnu.org> <83fucxqonl.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113e3ae0a3d64105568d1809" X-Trace: blaine.gmane.org 1502538912 2238 195.159.176.226 (12 Aug 2017 11:55:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Aug 2017 11:55:12 +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 Aug 12 13:55:07 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 1dgV0P-0008D7-Uy for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 13:55:02 +0200 Original-Received: from localhost ([::1]:47549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgV0T-00060F-6v for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 07:55:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgV0G-0005z8-Of for emacs-devel@gnu.org; Sat, 12 Aug 2017 07:54:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgV0D-0002sh-Mm for emacs-devel@gnu.org; Sat, 12 Aug 2017 07:54:52 -0400 Original-Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]:37169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgV0D-0002sT-FN for emacs-devel@gnu.org; Sat, 12 Aug 2017 07:54:49 -0400 Original-Received: by mail-qk0-x22c.google.com with SMTP id z18so32084100qka.4 for ; Sat, 12 Aug 2017 04:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burkett-cc.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vyMUCYf6C2WWB6bS++vH6/hw07VzbhavL4yu/qa2OJw=; b=T366chrk1R2gyM45iv/lF21R606MxthScMJRm1SIN1zcuwI0Ey1woDCMgAv1kEsdbE mo6K032nqgnCeqCyXM5BsMlR9a7xgC5TMAR321eoL/JFbftFhKTQgNpNrLZaZ/1gL52S PqyPx1NSmXpIzFLkkweBnbMy2Y8ddturzHlCVDSpCrFAHgskCPDcQz58gsiN7oNpZjlp Vkh8qKt+p/RH+9WrBNvcxFWM5fXguhfqg4zu/zU4IlhRojMEHzxEWPAaIlJSheLdRErf GRZTNwmwXSUBWulVo1LfRKBS/+SUPP3Uy7n0WrsfXhXZlkRMao2TkFiuqFCjyKBYyYuN ejMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vyMUCYf6C2WWB6bS++vH6/hw07VzbhavL4yu/qa2OJw=; b=P/2HTW2MoKBztxFFoBu5qikj+XZbbfBCi4yUFGPk9wTQst8Ml6wM0cDf1c6jkikp5i As0Usr2STc5Ym9Nsv2E7D/TFzgU0qFBwvRQZLdWjaLe2GAUxe7Xh7q/xDak12irqFXTX PCQOKK/u5vSJi5hz+nUHGgGIm2N6+hXXWsERBc0eYEX/d+NX0Q1mZ7aXg5F/zyTaD44c F9Rta7cg5HxEORRNBuv3m1LAtwRD+2aWfStuzsworCa5b8OsY/9apfSKkZrKfgFyqI/R VsFC2kcWp3pW53KdCfir5R7KNTiKziJSV2MlpG5nneIHr+uCZkKV7D9P7MrAmuyiNJe/ X04A== X-Gm-Message-State: AHYfb5iZEteBbXlbs4kUaUIcaGgfyHqtr1yISJUYwPCcy1nYZs9z/iyT gfkvMnKiiE7LJf94 X-Received: by 10.55.154.200 with SMTP id c191mr24420338qke.256.1502538888675; Sat, 12 Aug 2017 04:54:48 -0700 (PDT) Original-Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com. [209.85.216.179]) by smtp.gmail.com with ESMTPSA id w63sm2005992qkb.67.2017.08.12.04.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Aug 2017 04:54:47 -0700 (PDT) Original-Received: by mail-qt0-f179.google.com with SMTP id p3so33149990qtg.2; Sat, 12 Aug 2017 04:54:47 -0700 (PDT) X-Received: by 10.237.35.81 with SMTP id i17mr23892808qtc.19.1502538887319; Sat, 12 Aug 2017 04:54:47 -0700 (PDT) Original-Received: by 10.140.30.139 with HTTP; Sat, 12 Aug 2017 04:54:16 -0700 (PDT) In-Reply-To: <83fucxqonl.fsf@gnu.org> X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22c 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:217473 Archived-At: --001a113e3ae0a3d64105568d1809 Content-Type: text/plain; charset="UTF-8" > So I think this behavior is correct, perhaps we should describe this > special case in the doc string. This function must end up at the > beginning of a visual line, and in your case there's only one such > place. Note that (beginning-of-visual-line 1) and > (beginning-of-visual-line) all end up in the same place in this case. That's fine with me. While we're at it, move-beginning-of-line has the same inconsistency in the docstring. Arguably it's not that special of a case. With 50 lines in a buffer that doesn't end in a newline, (beginning-of-visual-line 99) does not end up at the end of the buffer as suggested by the docstring. In other words, it's the result of a buffer not ending in a newline, not that there is only one line in the buffer. Also, it would be nice to specify what the return value of these functions is if the docstring will change. Thanks, Justin On Sat, Aug 12, 2017 at 2:35 AM, Eli Zaretskii wrote: > > From: Justin Burkett > > Date: Fri, 11 Aug 2017 17:10:23 -0400 > > Cc: emacs-devel@gnu.org > > > > $ emacs -Q > > C-x b *test* RET > > asdf > > M-: (beginning-of-visual-line 2) > > > > point ends up at the beginning of the buffer for me. Note this doesn't > > happen with a final newline in the buffer. > > Ah, that was the missing bit. > > So I think this behavior is correct, perhaps we should describe this > special case in the doc string. This function must end up at the > beginning of a visual line, and in your case there's only one such > place. Note that (beginning-of-visual-line 1) and > (beginning-of-visual-line) all end up in the same place in this case. > --001a113e3ae0a3d64105568d1809 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

So I= think this behavior is correct, perhaps we should describe this
special= case in the doc string.=C2=A0 This function must end up at the
beginnin= g of a visual line, and in your case there's only one such
place.=C2= =A0 Note that (beginning-of-visual-line 1) and
(beginning-of-visual-line= ) all end up in the same place in this case.

That's fine with me. While we're at it, move-beginning-of-line ha= s the same inconsistency in the docstring. Arguably it's not that speci= al of a case. With 50 lines in a buffer that doesn't end in a newline, = (beginning-of-visual-line 99) does not end up at the end of the buffer as s= uggested by the docstring. In other words, it's the result of a buffer = not ending in a newline, not that there is only one line in the buffer.=C2= =A0

Also, it would be nice to specify what the ret= urn value of these functions is if the docstring will change.=C2=A0

Thanks,=C2=A0
Justin

=

On Sat, Aug 12, 2= 017 at 2:35 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Justin Burkett <justin@burkett.cc> > Date: Fri, 11 Aug 2017 17:10:23 -0400
> Cc: emacs-devel@gnu.org
>
> $ emacs -Q
> C-x b *test* RET
> asdf
> M-: (beginning-of-visual-line 2)
>
> point ends up at the beginning of the buffer for me. Note this doesn&#= 39;t
> happen with a final newline in the buffer.

Ah, that was the missing bit.

So I think this behavior is correct, perhaps we should describe this
special case in the doc string.=C2=A0 This function must end up at the
beginning of a visual line, and in your case there's only one such
place.=C2=A0 Note that (beginning-of-visual-line 1) and
(beginning-of-visual-line) all end up in the same place in this case.

--001a113e3ae0a3d64105568d1809--