From: John Wiegley <jwiegley@gmail.com>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: Karl Fogel <kfogel@red-bean.com>,
Stefan Monnier <monnier@IRO.UMontreal.CA>,
emacs-devel@gnu.org
Subject: Re: "Staying in the same place"
Date: Mon, 04 Apr 2016 16:21:38 -0700 [thread overview]
Message-ID: <m2twjh6jul.fsf@newartisans.com> (raw)
In-Reply-To: <m3egalkv7j.fsf@gnus.org> (Lars Magne Ingebrigtsen's message of "Mon, 04 Apr 2016 21:52:32 +0200")
>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Karl Fogel <kfogel@red-bean.com> writes:
>> Yes, absolutely. A "fuzzily recorded position" should be a
>> first-class object that can be passed around like any value. There
>> can be a macro that generates and consumes such objects entirely
>> internally to the macro, but the objects can also be generated
>> explicitly in code and consumed later.
> This sounds great to me. :-)
I like this as well. Basically, a "fuzzy position" is three things:
Some internal value, potentially unique to each mode
A method to return such a value based on point
A method to restore point based on such a value
Seeing this as an abstract data type, the default would be:
#<marker>, point-marker, goto-char
But each mode would have the opportunity to override with another
implementation. Also, these objects might be persistable in some cases, such
as with bookmarks (though maybe not always).
We'd also need to either extend save-excursion to be aware of this, or define
a new helper form to do the saving/restoring based on this fuzzy definition.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
next prev parent reply other threads:[~2016-04-04 23:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 5:40 "Staying in the same place" Lars Magne Ingebrigtsen
2016-04-04 6:09 ` Lars Magne Ingebrigtsen
2016-04-04 7:28 ` Daniel McClanahan
2016-04-04 12:51 ` Stefan Monnier
2016-04-04 18:19 ` Lars Magne Ingebrigtsen
2016-04-04 18:36 ` Stefan Monnier
2016-04-04 18:42 ` Lars Magne Ingebrigtsen
2016-04-04 19:25 ` Karl Fogel
2016-04-04 19:43 ` Lars Magne Ingebrigtsen
2016-04-04 19:49 ` Karl Fogel
2016-04-04 19:52 ` Lars Magne Ingebrigtsen
2016-04-04 23:21 ` John Wiegley [this message]
2016-04-05 0:36 ` 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=m2twjh6jul.fsf@newartisans.com \
--to=jwiegley@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=kfogel@red-bean.com \
--cc=larsi@gnus.org \
--cc=monnier@IRO.UMontreal.CA \
/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).