all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 35536@debbugs.gnu.org, Mauro Aranda <maurooaranda@gmail.com>
Subject: bug#35536: 27.0.50; Expose buffer's marker list to Elisp
Date: Fri, 03 May 2019 16:50:56 +0100	[thread overview]
Message-ID: <87r29fcza7.fsf@tcd.ie> (raw)
In-Reply-To: <jwvimusvenm.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 02 May 2019 15:59:38 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I attach a patch implementing this based on BUF_MARKERS, as per Martin's
>> suggestion.  Any reasons not to expose such a function?
>
> AFAIK the main reason for such a function is so that you can implement
> "replace" functions which preserves markers better than "insert+delete"
> does, right?

AIUI, yes.

> Random thoughts:
> - I wouldn't expose a `(marker-list)` function but rather `(markers-in
>   BEG END)` so you're not bothered by unrelated markers outside of
>   the region of interest.

The patch in the OP accepts optional BEG and END arguments for the
caller's typing convenience.

> - The main problem I see is that some of the markers in BUF_MARKERS are
>   "proper" markers, while others are just the markers that we happen to
>   use in the current internal representation of overlays.
>   If you can get your hands on those markers, you might end up breaking
>   some invariants on which the C code relies (e.g. place the
>   overlay-start after the overlay-end, or in a different buffer).
> - I think the serious risks (e.g. crashes) are solvable.  E.g. there's
>   room for an additional boolean field `lisp_marker` which could be used
>   to distinguish those markers which can be safely returned (because
>   they're normal Lisp-level markers already accessible from Lisp anyway)
>   from the internal ones (such as those from overlays).
> - Then we'd probably want to discussion whether markers used within
>   `save-excursion` and friends should be marked as `lisp_marker` or not.
>
> This said, as you say later:
>> I have yet to see a use-case for marker-list which can't be engineered
>> in a different way
>
> So, whether it's worth the trouble: I don't know.

Given a sufficiently sufficient save+restore primitive as per Eli's
suggestion, it's not looking worth the trouble.

Thanks,

-- 
Basil





  parent reply	other threads:[~2019-05-03 15:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 15:44 bug#35536: 27.0.50; Expose buffer's marker list to Elisp Basil L. Contovounesios
2019-05-02 16:07 ` Eli Zaretskii
2019-05-02 16:51   ` Basil L. Contovounesios
2019-05-02 17:41     ` Eli Zaretskii
2019-05-03 15:50       ` Basil L. Contovounesios
2019-05-03 16:38         ` Drew Adams
2019-05-03 17:22           ` Basil L. Contovounesios
2019-05-03 17:31             ` Drew Adams
2019-05-03 17:39             ` Stefan Monnier
2019-05-03 17:53               ` Drew Adams
2019-05-03 18:13                 ` Stefan Monnier
2019-05-03 20:05                   ` Drew Adams
2019-05-04 21:25                   ` Richard Stallman
2019-09-16 21:07                     ` Lars Ingebrigtsen
2019-05-03 23:01     ` Mauro Aranda
2019-05-04 17:34       ` martin rudalics
2019-05-02 19:59 ` Stefan Monnier
2019-05-02 20:05   ` Eli Zaretskii
2019-05-03 15:50   ` Basil L. Contovounesios [this message]
2019-05-03 17:09     ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87r29fcza7.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=35536@debbugs.gnu.org \
    --cc=maurooaranda@gmail.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.