[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Overlay insertion types, markers, etc.
From: |
Drew Adams |
Subject: |
RE: Overlay insertion types, markers, etc. |
Date: |
Wed, 13 Nov 2019 07:36:14 -0800 (PST) |
ping.
I really would like to know about this,
if someone has an idea. Thx.
___
> From (elisp) `Overlays':
>
> "An overlay uses markers to record its beginning and end."
>
> 1. You can create an overlay with `make-overlay',
> passing it markers.
>
> But the insertion types of those markers are not used
> for that overlay. Instead, you can specify those types
> for the overlay as optional `make-overlay' args. By
> default, text you insert at the beginning, but not at
> the end, of the overlay is included in the (extended)
> overlay.
>
> First question:
>
> Why, if you pass markers, isn't the default to use
> the insertion types of those markers?
>
>
> 2. `make-overlay' seems to be the only way to specify
> the insertion types for an overlay. Is that right,
> or did I miss something? `move-overlay' doesn't let
> you specify them, nor does `copy-overlay'. (And I
> don't see this being handled by `overlay-put'' - they
> are not overlay properties.)
>
> There are hook properties `insert-in-front-hooks'
> and `insert-behind-hooks'. But that's not the same.
>
> Second question:
>
> Why isn't there (or is there?) a simple way to
> change the "marker insertion types" of an existing
> overlay?
>
> Suppose you want to copy an existing overlay and
> then change some things in the copy. You can't
> change the insertion types for it, right?
>
> I guess you need to use `make-overlay', specifying
> insertion types, and then explicitly copy everything
> else from the first overlay. Is that right?
>
>
> 3. Similarly, the default BUFFER for `make-overlay'
> is the current buffer, even if you pass markers.
>
> Third question (similar to the first):
>
> Why, if you pass markers to `make-overlay', and
> you don't pass arg BUFFER, isn't the default to
> use the buffer of those markers?
>
>
> 4. (Repeating) "An overlay uses markers to record
> its beginning and end."
>
> It seems that an overlay "uses markers" but those
> aren't the markers you passed to `make-overlay'.
> Is that right?
>
> Fourth question (also similar to the first):
>
> Can you retrieve the markers that are "used by"
> an overlay, i.e., as markers? I don't see that
> you can. (`overlay-start' and `overlay-end',
> for example, don't give you markers.) You can
> of course create suitable (but separate) markers.
>
> (elisp) `Managing Overlays' says, about
> `move-overlay':
>
> "This is the only valid way to change the endpoints
> of an overlay. Do not try modifying the markers in
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> the overlay by hand, as that fails to update other
> vital data structures and can cause some overlays
> to be lost."
>
> That makes me wonder. I don't even see how you
> could try to "modify the markers of the overlay"
> (with Lisp). How so? How to get those markers?
>
>
> I feel like I'm probably missing something here,
> but I don't notice it in the manual, doc strings,
> or Lisp code (only `remove-overlay' and
> `copy-overlay' are coded in Lisp, it seems).
>
> Do I understand the situation correctly? If so,
> what's the rationale for it? I'm guessing there
> are good reasons?
- Overlay insertion types, markers, etc., Drew Adams, 2019/11/11
- RE: Overlay insertion types, markers, etc.,
Drew Adams <=
- Re: Overlay insertion types, markers, etc., Eli Zaretskii, 2019/11/15
- RE: Overlay insertion types, markers, etc., Drew Adams, 2019/11/15
- Re: Overlay insertion types, markers, etc., Eli Zaretskii, 2019/11/15
- RE: Overlay insertion types, markers, etc., Drew Adams, 2019/11/15
- Re: Overlay insertion types, markers, etc., Richard Stallman, 2019/11/16
- RE: Overlay insertion types, markers, etc., Drew Adams, 2019/11/16
- Re: Overlay insertion types, markers, etc., Stefan Monnier, 2019/11/17
- RE: Overlay insertion types, markers, etc., Drew Adams, 2019/11/17
- Re: Overlay insertion types, markers, etc., Richard Stallman, 2019/11/20
- Re: Overlay insertion types, markers, etc., Eli Zaretskii, 2019/11/20