emacs-devel
[Top][All Lists]
Advanced

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

Re: "Staying in the same place"


From: John Wiegley
Subject: Re: "Staying in the same place"
Date: Mon, 04 Apr 2016 16:21:38 -0700
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (darwin)

>>>>> Lars Magne Ingebrigtsen <address@hidden> writes:

> Karl Fogel <address@hidden> 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



reply via email to

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