From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: enriched-mode and switching major modes. Date: Wed, 22 Sep 2004 09:11:07 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200409042358.i84Nwjt19152@raven.dms.auburn.edu> <87llfn5ihw.fsf@emacswiki.org> <01c49c75$Blat.v2.2.2$7a37cb00@zahav.net.il> <01c49d70$Blat.v2.2.2$f7cfb860@zahav.net.il> <01c49da7$Blat.v2.2.2$cd5f7160@zahav.net.il> <01c49dc6$Blat.v2.2.2$3b624d40@zahav.net.il> Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CA6uK-00026n-00 for ; Wed, 22 Sep 2004 15:11:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CA70H-0005pI-QN for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2004 09:17:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CA70B-0005pD-Og for emacs-devel@gnu.org; Wed, 22 Sep 2004 09:17:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CA70A-0005p0-6q for emacs-devel@gnu.org; Wed, 22 Sep 2004 09:17:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CA70A-0005ox-4e for emacs-devel@gnu.org; Wed, 22 Sep 2004 09:17:42 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CA6u4-0004ON-QB; Wed, 22 Sep 2004 09:11:24 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id BA8DEB3027B; Wed, 22 Sep 2004 09:11:07 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id AF9738CA23; Wed, 22 Sep 2004 09:11:07 -0400 (EDT) Original-To: Oliver Scholz In-Reply-To: (Oliver Scholz's message of "Wed, 22 Sep 2004 12:01:27 +0200") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27436 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27436 > buffer rather than in a string and that they are /editable/. And that > question I can reduce to: how can I implement a tree-like data > structure with text properties? Without thinking too much about it, I'd say that overlays seem to be a better fit: each node is an overlay, the node's attributes can be stored in the overlay's properties, the text corresponding to a node can be stored directly in the buffer and retrieved by (buffer-substring (overlay-start o) (overlay-end o)), ... Stefan