emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for line beginning


From: Eli Zaretskii
Subject: Re: Searching for line beginning
Date: Sun, 14 Aug 2022 15:54:39 +0300

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]