Are there any Elisp functions that enumerate tokens in a given buffer?

I see that buffer-has-markers-atat least it will tell if there are markers indicating the position, but not only it was marked as deprecated since 24.3, it does not provide one means for actually getting the marker object.

Looking at the source of C , I see that this buffer for struct_ buffer_text points to a separate list of Lisp_marker structures, but I can’t find any Elisp functions to access them. Also, a related stream since 1999 .

+4
source share
1 answer

To expand my comment: there really is no function that gives you a set of tokens present in the buffer.

This is partly due to the fact that at the implementation level, each buffer contains a list of its markers, at a conceptual level, markers point to buffers, but not vice versa: if the marker does not refer to any data that is already collected with garbage.

Thus, the list of markers that you can find in source C contains "real markers" as well as "zombie markers", i.e. markers that have become unavailable and will be removed at the next GC.

The impact of this on Elisp means that some of these zombie markers can be "resuscitated." Perhaps this can be done without any technical problems, but this means that the semantics of such a function will be a little ugly.

, , , ( GC, ), , : , , save-excursion.

, - (0-length) , overlays-in, , , .

0

All Articles