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: Searching for line beginning Date: Sat, 13 Aug 2022 18:43:29 +0300 Message-ID: <831qtkm9ni.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18874"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 13 18:16:55 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 1oMtok-0004hw-2R for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 18:16:54 +0200 Original-Received: from localhost ([::1]:50344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMtoi-0006HA-OT for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 12:16:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMtIc-0006NB-Qi for emacs-devel@gnu.org; Sat, 13 Aug 2022 11:43:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMtIc-0007bB-HA for emacs-devel@gnu.org; Sat, 13 Aug 2022 11:43:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=XqGsUUxElQPCzywac+8i+z2YMli3lj8aspeBTZJY4nA=; b=J4ZPzlikB/YZ/e Z3peKRR6O+sB+PnkpKu+K/xfkvt05//ve4CgmEN1oaNox6IWPXD2wuZwHFqlTdV7YsU2bVuvZs9GR J5ffFY3HADw7SHUYHj2x/s6RGnaInSjwXpve3eu/76zvtXRz8L+ppEeYTTu3k1rvQoJWwGmh3gigv 0pVGll1tvbS2WtUgsLBDmwWD2trNbOL1o4Hpsr16qDuGaMd44tTr7A8Hyxh9pHbduii6mmPC7gKhq A1nXd3XQHezF5XKwQI8P36EyG9boNl2QKAC79qfcVnjzClSzUncffNvq0y+6jjBTaEvLrVziZzjtA 82UnJp8rH3wJr1GYQFyA==; Original-Received: from [87.69.77.57] (port=1240 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 1oMtIb-0001A7-V7 for emacs-devel@gnu.org; Sat, 13 Aug 2022 11:43:42 -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:293424 Archived-At: 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.