From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: Searching for line beginning Date: Sun, 14 Aug 2022 18:33:00 +0300 Message-ID: <878rnqq1qr.fsf@tcd.ie> References: <831qtkm9ni.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36150"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 14 17:34:05 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 1oNFcp-00096O-VO for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Aug 2022 17:34:04 +0200 Original-Received: from localhost ([::1]:56374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNFco-0008Ky-UN for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Aug 2022 11:34:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNFbw-0006xP-LI for emacs-devel@gnu.org; Sun, 14 Aug 2022 11:33:08 -0400 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNFbu-0003zb-QJ for emacs-devel@gnu.org; Sun, 14 Aug 2022 11:33:08 -0400 Original-Received: by mail-wr1-x434.google.com with SMTP id n4so6461910wrp.10 for ; Sun, 14 Aug 2022 08:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc; bh=JwntOMJh/h2MFrbDJOZJ8ZMVhIVr2TH5readFPVs5AA=; b=AnTexTldvxr+ldRVFOyOz0qzWcU30NtpfNX1GoXJZTmHuXwlp+X1ksoq2gQEMXArFq P9LvErlA2p1Lvekl8khb21Jpg3hXwSMbOWJF38jHA3is1en38xtohYXS0UrSMuWlX4TJ 7yP2fcjHp3T/rh0mF6aFH/vLmRf0Sr41TFbZM74oUw8d1UWcDYFAMmGgXAjIXqYw1/Nd GaTX38mu7ZX7F9cfJ5Jf3tz6KNW2EfkSZ8gfz/6RatvSCF9Bh6lG3aM65pFyQWTLOiap M6KVUIZuMPFfLt5Rx7oWuXdfM/WctNkq3H0FCPYl3CU7PRPSeSDqgX0b1zqqJbGitJEV jb3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=JwntOMJh/h2MFrbDJOZJ8ZMVhIVr2TH5readFPVs5AA=; b=vT/7kMPLRgpFGKGdmZ3k/TxugnDcNITjv9CYFmMHAIa4ywucBvOXaMSTyTpzx7ZLH8 U4+uiNAxDG/quJGJuHm/84aRZrzQ6p+MnPgd8ZPta1syt5g/XM1/r9hhaVj8yJtdgUvZ UJj5cJR6YoR50Bb7OMsYPrrQ0+yH/s0HDhBBvDB0SKQtL9XJwXG6+UG+/agkodyY4X29 m+4trKt6RnNKcMwuU7+o2LGGbsWGjttARl6pV8mCA6GQJTrQv60LumZdmfsEj5+HkKar 2L5o5OQkqb0vExZAG4liOkEMu4FclYrcPFPBl9DMiS4NgrHOxZZKNTmBXH48ebtSKsFJ wQNg== X-Gm-Message-State: ACgBeo2ClZMCk4AGFRRZbTUnFPTsEGzqrqCGU79VAeDoYpWwYLNE9+Q/ VvktBU65C52TvImGUxZYh+jnoWRgTyh00Q== X-Google-Smtp-Source: AA6agR50n2+Q1D9QyzqfJ2DXnc7wFI+M6FLIvkKEnEzHTXRtalcXtw2mOS4cTUqfs7ezNjG0mZQPrg== X-Received: by 2002:adf:d1c1:0:b0:220:5ec3:fb62 with SMTP id b1-20020adfd1c1000000b002205ec3fb62mr6423078wrd.69.1660491182647; Sun, 14 Aug 2022 08:33:02 -0700 (PDT) Original-Received: from localhost ([2a02:587:322a:4bea:c3bc:c7ac:e79d:a903]) by smtp.gmail.com with ESMTPSA id n5-20020a05600c3b8500b003a302fb9df7sm6545832wms.21.2022.08.14.08.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 08:33:02 -0700 (PDT) In-Reply-To: <831qtkm9ni.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Aug 2022 18:43:29 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=contovob@tcd.ie; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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:293447 Archived-At: Eli Zaretskii [2022-08-13 18:43 +0300] 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. FWIW, one could also say (beginning-of-line) or (beginning-of-line 1) instead of (goto-char (line-beginning-position)). But they boil down to the same thing, so they should be very close in terms of performance. Thanks, -- Basil