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: Searching for line beginning Date: Sun, 14 Aug 2022 15:54:39 +0300 Message-ID: <8335dzkmsw.fsf@gnu.org> References: <831qtkm9ni.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2367"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 14 14:56:04 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 1oND9v-0000Q8-Gt for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Aug 2022 14:56:03 +0200 Original-Received: from localhost ([::1]:57832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oND9t-0005Bz-UF for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Aug 2022 08:56:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oND8q-0004PW-Lp for emacs-devel@gnu.org; Sun, 14 Aug 2022 08:54:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oND8q-0006mL-9t; Sun, 14 Aug 2022 08:54:56 -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=ZkYm5sctXB2irJECieT7PLIOOjH1zySR+yV0+xFbCqw=; b=OfGlaQRI/c8S S72KHVVKpdexvfS4+sJgJnv81iDNv1kI/7SRdXYet2a663mrtIeIWiPinfA0HT8H6DGQUXr8dxY/9 b6e1HpNI/bR5Nf0f4x4nwaAmyekf2fhPyRJ7OEbREjl9qPVFEyJ8MQEGCSl91GBsUsOrYohkZ/xEi hcK3AhkCmb6sfBqmFVeU15iTe2MHe99SBcLwfnVpU22N4v9N3fxvoJBNe6dFI0uoFBla8PnRNct85 ailSbmEsO0DZnSSPbCesDUB5thiN4OT1VTM57owykQFPAZQO6gkc7Z+eWJtS2A1x8r8RslHhCeLnq mwwNOuYZF5PWdzAyeKEiTQ==; Original-Received: from [87.69.77.57] (port=3308 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 1oND8p-0006YF-Ma; Sun, 14 Aug 2022 08:54:56 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 13 Aug 2022 12:20:04 -0400) 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:293443 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Sat, 13 Aug 2022 12:20:04 -0400 > > Eli Zaretskii [2022-08-13 18:43:29] wrote: > > > C-a (move-beginning-of-line) does this to find the line's beginning: > > > > ;; Move to beginning-of-line, ignoring fields and invisible text. > > (skip-chars-backward "^\n") > > (while (and (not (bobp)) (invisible-p (1- (point)))) > > (goto-char (previous-char-property-change (point))) > > (skip-chars-backward "^\n")) > > > > Apart of the fields part (which can be handled by binding > > inhibit-field-text-motion), can anyone see a reason why not use > > line-beginning-position instead? The latter is much faster, > > especially when lines are very long. > > You mean instead of `skip-chars-backward`? I can't see a reason, no. Done.