unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: master f117b5df4d: Add new functions eol and bol
Date: Fri, 19 Aug 2022 23:49:07 +0200	[thread overview]
Message-ID: <87fshrsy3w.fsf@gnus.org> (raw)
In-Reply-To: <CADwFkmkaKhjd2HYuuX8AM7+c36bBWMgszJp=djQo79nUuAQTUA@mail.gmail.com> (Stefan Kangas's message of "Fri, 19 Aug 2022 09:00:29 -0700")

Stefan Kangas <stefankangas@gmail.com> writes:

> We could make the task less daunting by starting with something like:

[...]

> +(defalias 'point-at-eol #'line-end-position
> +  "Obsolete; use `point-eol' or `line-end-position' instead.")

Yes, I guess.  We could also just rename all the calls to point-at-eol
to line-end-position (etc) and obsolete the names for real.

It's some churn, but...  And then someone could audit all these calls at
leisure, if they want to.

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...

I guess these things have evolved over time.



  reply	other threads:[~2022-08-19 21:49 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166091536530.20326.14174671546998200051@vcs2.savannah.gnu.org>
     [not found] ` <20220819132245.AE2BBC0088A@vcs2.savannah.gnu.org>
2022-08-19 13:25   ` master f117b5df4d: Add new functions eol and bol Lars Ingebrigtsen
2022-08-19 13:34     ` Stefan Monnier
2022-08-19 13:36       ` Lars Ingebrigtsen
2022-08-19 21:02         ` Stefan Monnier
2022-08-19 21:24           ` Lars Ingebrigtsen
2022-08-19 13:55     ` Stefan Kangas
2022-08-19 14:04       ` Eli Zaretskii
2022-08-19 14:14         ` Robert Pluim
2022-08-19 14:56         ` Lars Ingebrigtsen
2022-08-19 16:24         ` [External] : " Drew Adams
2022-08-19 21:42           ` Tim Cross
2022-08-19 21:03         ` Stefan Monnier
2022-08-19 21:26           ` Lars Ingebrigtsen
2022-08-20 16:28             ` Gregory Heytings
2022-08-19 14:08       ` Lars Ingebrigtsen
2022-08-19 16:00         ` Stefan Kangas
2022-08-19 21:49           ` Lars Ingebrigtsen [this message]
2022-08-20  6:21             ` Eli Zaretskii
2022-08-20 16:47             ` Stefan Monnier
2022-08-21 16:19             ` Stefan Kangas
2022-08-22 10:03               ` Lars Ingebrigtsen
2022-08-23  3:05                 ` Stefan Kangas
2022-08-23  3:52                   ` Po Lu
2022-08-23 13:12                     ` Stefan Monnier
2022-08-24  3:53                       ` Richard Stallman
2022-08-24  4:28                         ` Po Lu
2022-08-24 11:58                         ` Stefan Monnier
2022-08-20  8:12       ` Po Lu
2022-08-20  9:22         ` Lars Ingebrigtsen
2022-08-20 11:37           ` Po Lu
2022-08-20 13:00             ` Lars Ingebrigtsen
2022-08-20 13:26               ` Po Lu
2022-08-19 22:15     ` Dmitry Gutov
2022-08-20  7:33       ` Lars Ingebrigtsen
2022-08-20  7:43         ` Eli Zaretskii
2022-08-20  9:21           ` Lars Ingebrigtsen
2022-08-20 16:46         ` Gregory Heytings
2022-08-20 16:49         ` Stefan Monnier
2022-08-20 17:14           ` Stefan Kangas
2022-08-21 12:01             ` Lars Ingebrigtsen
2022-08-20 18:46         ` Dmitry Gutov
2022-08-20 21:02           ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fshrsy3w.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).