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: Sat, 13 Aug 2022 20:58:19 +0300 Message-ID: <83v8qwkouc.fsf@gnu.org> References: <831qtkm9ni.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8477"; 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 Sat Aug 13 19:59:59 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 1oMvQV-00020q-0A for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 19:59:59 +0200 Original-Received: from localhost ([::1]:42690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMvQT-0002Ie-HI for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 13:59:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMvP9-0001Uy-3T for emacs-devel@gnu.org; Sat, 13 Aug 2022 13:58:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMvP8-0001d0-MG; Sat, 13 Aug 2022 13:58:34 -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=AxWgeGnd3hVZ8E+AwkiroXMBYgrYCl4+QFRxMebKook=; b=J0Wye4EF/Idd CQDVf7rESde110OVrOC77t9igvgI8FP+gVmoN/P9c/gC6W2Bl9lz2jE8fthGWee67IHlovPgw6FBz lcfzbZJp9ptHVKNKxtZCSI53o670epfuXSnP1ZxFFbH/kSo/LDsT+p5Vgh3JGoCRRkZQUntLLrWuf Kfgb5OZ6oZhrtV/Xc52t+vOsfRW5WLOLN0SVcJGKlYw6WjJPegCfDqZjq760aBYTawqebH/TB5ZVw p4QzB6jUUdcFJ3R0HEeADqHkncxtkaU9YdiXrwKRIFZ1EygXbpux4v7o2Qi+kE5NJcNGHhfaDWU6z GldZHh/yLIlL8/GaBFpDiw==; Original-Received: from [87.69.77.57] (port=1532 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 1oMvP8-0002vs-5X; Sat, 13 Aug 2022 13:58:34 -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:293428 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`? Yes. > I can't see a reason, no. Thanks for the feedback.