From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nic James Ferrier Newsgroups: gmane.emacs.devel Subject: Re: Saving markup formats Date: Thu, 21 Jun 2007 01:05:55 +0100 Message-ID: <87r6o6uq70.fsf@kanga.tapsellferrier.co.uk> References: <871wgi9jzb.fsf@jidanni.org> <87odjlwpu1.fsf@jurta.org> <87ir9r1m99.fsf@jurta.org> <87myz2i9tj.fsf@jurta.org> <87r6ocx0tk.fsf_-_@jurta.org> <87d4zuyvn6.fsf@gmx.de> <87fy4prmdf.fsf@jurta.org> <85sl8ngp94.fsf@lola.goethe.zz> <87abuuexfo.fsf@kanga.tapsellferrier.co.uk> <87ps3qriao.fsf@gmx.de> <874pl2wfom.fsf@kanga.tapsellferrier.co.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182384476 7068 80.91.229.12 (21 Jun 2007 00:07:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 00:07:56 +0000 (UTC) Cc: Oliver Scholz , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 02:07:55 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I1ADK-0007Hs-NP for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 02:07:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1ADK-0003uY-1H for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2007 20:07:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1ADH-0003u3-Ij for emacs-devel@gnu.org; Wed, 20 Jun 2007 20:07:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1ADH-0003tr-4B for emacs-devel@gnu.org; Wed, 20 Jun 2007 20:07:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1ADH-0003to-0a for emacs-devel@gnu.org; Wed, 20 Jun 2007 20:07:51 -0400 Original-Received: from owls-tree.tapsellferrier.co.uk ([81.187.188.218] helo=owls-house.tapsellferrier.co.uk) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I1ADC-0002UG-VU; Wed, 20 Jun 2007 20:07:47 -0400 Original-Received: from nicferrier.tapsellferrier.co.uk ([172.31.50.1] helo=localhost) by owls-house.tapsellferrier.co.uk with esmtp (Exim 4.60 #1 (Debian)) id 1I1A7b-0003js-RW; Thu, 21 Jun 2007 01:01:59 +0100 Original-Received: by localhost (Postfix, from userid 1000) id 95DBBC06EB; Thu, 21 Jun 2007 01:05:55 +0100 (BST) In-Reply-To: <874pl2wfom.fsf@kanga.tapsellferrier.co.uk> (Nic James Ferrier's message of "Wed\, 20 Jun 2007 21\:10\:01 +0100") X-detected-kernel: Genre and OS details not recognized. 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73480 Archived-At: Nic James Ferrier writes: > Richard Stallman writes: > >> I am against structured data formats for an Emacs buffer because there >> is no way to reconcile that cleanly with the Emacs Lisp model of a >> buffer as a string of text. I thought about this thoroughly 15 years >> ago. > > I don't *think* I'm talking about a data format in an emacs buffer. > > I'm talking about using properties to mark the syntax of pieces of > text (in an ordinary buffer) as they are described in a word processor > schema instance (a document). > > > I think I'm just going to have to knock up an example and see whether > it's viable. Ok. I looked into it a bit more. I don't think I'm talking about something that breaks the primacy of the buffer. In fact, what I'm talking about has practically already been done. I am talking about writing a mode that works primarily on text properties specified via what most word processors call style. Emacs has a term for this as well: the category property. `category' If a character has a `category' property, we call it the "category" of the character. It should be a symbol. The properties of the symbol serve as defaults for the properties of the character. That's really all I'm talking about. Importing an OpenDoc (or in principle a Word document) into Emacs in a way that would ensure that you could save it back to something not too dissimilar would mean: - read the opendoc XML - convert all the styles to elisp symbols; some of these styles ("list-item", "p", etc...) would have well understood display; for example a heading needs to be display in bold or something. We could map standard Emacs display stuff onto the category symbols. - read in the document content inserting just the text into the buffer - propertize each piece of text, as you insert, with the name of the appropriate category; eg: if you have the following XML: Designed a REST binding for the SAML specification for single sign on web applications. then that would be converted into the following text buffer content: Designed a REST binding for the SAML specification for single sign on web applications. and the text would have a property assigned: category Standard so as to record the origin structure we might also add the following property: element p or: element text:p - let the user edit the text, editing would have to include the ability to add, remove or change the category property from/to text. cut and paste is not a problem. the text carries with it the properties it was assigned. That's fine. That's all word processor users expect. This doesn't deal with more complex structure (say, where you have a paragraph embedded in a list item) but I think that is possible quite naturally as well. I hope this answers some concerns. I think it shows that Emacs _could_ be a viable word processor for modern wp formats (and RTF as well). But if people are still doubtfull I'll have to go away and do it (in the 10seconds of free time I have every week). -- Nic Ferrier http://www.tapsellferrier.co.uk