From: Yuan Fu <casouri@gmail.com>
To: emacs-devel@gnu.org
Subject: How is text properties stored?
Date: Wed, 8 May 2019 17:08:06 -0400 [thread overview]
Message-ID: <25202F5C-FE09-49D9-8782-5E9D013E0262@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
Hi,
I’m interested in how is text properties stored in a string/buffer. From what I see (printing propertzied string and try reading textprop.c), it seems that they are stored in ranges. Is that true?
If that’s the case, I have two more questions:
1. How is it implemented? I.e., is it like (very roughly):
struct string {
char* string;
property* properties;
};
struct property {
int beg;
int end;
Lisp_Object* plist;
}
?
2. In my naive minds, if the text properties are implemented like this, every time when the user insert something in to a buffer/string, all the properties after the point of insert has to adjust their position (like overlays). That’s probably not the case since text property is supposed to be more efficient than overlays. So how does it work?
Sincerely, Yuan
[-- Attachment #2: Type: text/html, Size: 2053 bytes --]
next reply other threads:[~2019-05-08 21:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 21:08 Yuan Fu [this message]
2019-05-09 0:58 ` How is text properties stored? Stefan Monnier
2019-05-09 1:41 ` Yuan Fu
2019-05-09 5:41 ` Eli Zaretskii
2019-05-09 20:26 ` Yuan Fu
2019-05-09 20:40 ` Stefan Monnier
2019-05-10 1:50 ` Yuan Fu
2019-05-10 5:43 ` Eli Zaretskii
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=25202F5C-FE09-49D9-8782-5E9D013E0262@gmail.com \
--to=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
/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.