unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Searching for line beginning
@ 2022-08-13 15:43 Eli Zaretskii
  2022-08-13 16:20 ` Stefan Monnier
  2022-08-14 15:33 ` Basil L. Contovounesios
  0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2022-08-13 15:43 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-08-18 12:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-13 15:43 Searching for line beginning Eli Zaretskii
2022-08-13 16:20 ` Stefan Monnier
2022-08-13 17:58   ` Eli Zaretskii
2022-08-14 12:54   ` Eli Zaretskii
2022-08-14 15:33 ` Basil L. Contovounesios
2022-08-14 15:36   ` Eli Zaretskii
2022-08-14 15:43     ` Lars Ingebrigtsen
2022-08-14 15:48       ` Eli Zaretskii
2022-08-15  4:28         ` Lars Ingebrigtsen
2022-08-15 11:29           ` Eli Zaretskii
2022-08-15 11:37             ` Lars Ingebrigtsen
2022-08-15 12:00               ` Eli Zaretskii
2022-08-17  2:49                 ` Richard Stallman
2022-08-17 10:41                   ` Lars Ingebrigtsen
2022-08-17 11:48                   ` Eli Zaretskii
2022-08-17 11:52               ` Stefan Monnier
2022-08-18 12:37                 ` Lars Ingebrigtsen
2022-08-14 17:24     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).