emacs-devel
[Top][All Lists]
Advanced

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

Re: master f117b5df4d: Add new functions eol and bol


From: Eli Zaretskii
Subject: Re: master f117b5df4d: Add new functions eol and bol
Date: Sat, 20 Aug 2022 09:21:23 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 19 Aug 2022 23:49:07 +0200
> 
> By the way, I wasn't quite aware of how DWIM-ey the `end-of-line'
> function is.  It also does the field stuff, but then:
> 
>   while (1)
>     {
>       newpos = XFIXNUM (Fline_end_position (n));
>       SET_PT (newpos);
> 
>       if (PT > newpos
>         && FETCH_BYTE (PT_BYTE - 1) == '\n')
>       {
>         /* If we skipped over a newline that follows
>            an invisible intangible run,
>            move back to the last tangible position
>            within the line.  */
> 
>         SET_PT (PT - 1);
>         break;
>       }
>       else if (PT > newpos && PT < ZV
>              && FETCH_BYTE (PT_BYTE) != '\n')
>       /* If we skipped something intangible
>          and now we're not really at eol,
>          keep going.  */
>       n = make_fixnum (1);
>       else
>       break;
>     }
> 
> Now, the `C-e' command (`move-end-of-line') is another layer of
> DWIM-ness on top of this...

Many commands are DWIM-ish, so the above shouldn't be a surprise.

> I guess these things have evolved over time.

See this old discussion:

  https://lists.gnu.org/archive/html/emacs-devel/2002-04/msg00407.html



reply via email to

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