From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 35536@debbugs.gnu.org, maurooaranda@gmail.com, monnier@iro.umontreal.ca
Subject: bug#35536: 27.0.50; Expose buffer's marker list to Elisp
Date: Thu, 02 May 2019 17:51:12 +0100 [thread overview]
Message-ID: <87imusztof.fsf@tcd.ie> (raw)
In-Reply-To: <83ef5gq1po.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 2 May 2019 19:07:47 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: "Basil L. Contovounesios" <contovob@tcd.ie>
>> Date: Thu, 02 May 2019 16:44:52 +0100
>> Cc: Mauro Aranda <maurooaranda@gmail.com>,
>> Stefan Monnier <monnier@iro.umontreal.ca>
>>
>> I attach a patch implementing this based on BUF_MARKERS, as per Martin's
>> suggestion. Any reasons not to expose such a function?
>
> I'm not yet convinced we need something like that, but in any case, is
> the order important? Because the code you propose produces a list in
> reverse order.
The order of the returned list is in increasing buffer position, thanks
to the call to Fsort. Is that not a reasonable order?
> More generally, I think we should discuss the need for this in more
> detail. Markers are used for several features, and there's internal
> stuff like conversion from character to byte positions that depends on
> them. Changing markers could thus easily crash Emacs, especially if
> it comes in some in-opportune moment.
Are you saying that BUF_MARKERS could include markers created by
internal functions which could crash if these markers are changed across
calls to other Lisp functions?
If so, that sounds like a valid concern to a non-expert like me, but it
also sounds like a bug waiting to happen, given that other C code
also traverses and manipulates BUF_MARKERS.
If not, I don't see how manipulating markers returned by marker-list is
any worse than manipulating those created at the Lisp level, with the
usual and documented risks associated with manipulating markers not
owned by the caller.
> It is possible that people actually need higher-level primitives that
> manipulate markers internally. We should first identify the use cases
> where this could be needed, and then see how to help solving those use
> cases by something like a new marker-related primitive.
I have yet to see a use-case for marker-list which can't be engineered
in a different way (other than as a replacement for the obsolete
buffer-has-markers-at, FWIW). Perhaps some of the CCed parties might
have examples.
Thanks,
--
Basil
next prev parent reply other threads:[~2019-05-02 16:51 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 [this message]
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
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=87imusztof.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=35536@debbugs.gnu.org \
--cc=eliz@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.