From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master f117b5df4d: Add new functions eol and bol Date: Sat, 20 Aug 2022 09:21:23 +0300 Message-ID: <83h727e8po.fsf@gnu.org> References: <166091536530.20326.14174671546998200051@vcs2.savannah.gnu.org> <20220819132245.AE2BBC0088A@vcs2.savannah.gnu.org> <87a680v004.fsf@gnus.org> <87tu68tjfd.fsf@gnus.org> <87fshrsy3w.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6320"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stefankangas@gmail.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 20 08:24:03 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPHtq-0001Ti-28 for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Aug 2022 08:24:02 +0200 Original-Received: from localhost ([::1]:47284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPHto-000522-HM for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Aug 2022 02:24:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPHrK-00049c-Cu for emacs-devel@gnu.org; Sat, 20 Aug 2022 02:21:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPHrJ-0004GR-UM; Sat, 20 Aug 2022 02:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WNRHnndKhikGAMUZWo4aT9w3Iy5zsxTEwX4oCm1s2rw=; b=ixEB2ui1TfKU PoSK1fGFiTAL0Rm6qFKO3jNl9iBUDca69DP6UM7yxDtxbqesjX0hgLh7e0wHEZ76MgYTZbC9IcvkY KDHfOXB4kyfrso/LN4Aphdd7JHn7u4HwpeqjQp1Dzml27vhtFNKP7ZT74VNBM0nHEFPQah3ZS/boM ADvMPFyJsVV94fKpT9DewePl5QnIh7p7AH6RIVuUQdJ1+23eq2Ku1kyQnW13iCFmBOwJq22KWtN4p r+3y/WTGbdw+TPXTFLbRq6U04oiuD92jdRWJMDgRl6aVjohwME+DMghc9/aSvw8pfQ3BnC7fC6yja v1N9KD9x2qAs3fXi/E855A==; Original-Received: from [87.69.77.57] (port=4075 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPHrJ-0008S7-6v; Sat, 20 Aug 2022 02:21:25 -0400 In-Reply-To: <87fshrsy3w.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 19 Aug 2022 23:49:07 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293657 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Fri, 19 Aug 2022 23:49:07 +0200 > > By the way, I wasn't quite aware of how DWIM-ey the `end-of-line' > function is. It also does the field stuff, but then: > > while (1) > { > newpos = XFIXNUM (Fline_end_position (n)); > SET_PT (newpos); > > if (PT > newpos > && FETCH_BYTE (PT_BYTE - 1) == '\n') > { > /* If we skipped over a newline that follows > an invisible intangible run, > move back to the last tangible position > within the line. */ > > SET_PT (PT - 1); > break; > } > else if (PT > newpos && PT < ZV > && FETCH_BYTE (PT_BYTE) != '\n') > /* If we skipped something intangible > and now we're not really at eol, > keep going. */ > n = make_fixnum (1); > else > break; > } > > Now, the `C-e' command (`move-end-of-line') is another layer of > DWIM-ness on top of this... Many commands are DWIM-ish, so the above shouldn't be a surprise. > I guess these things have evolved over time. See this old discussion: https://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00407.html