all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* RFC: A "markup mode"
@ 2008-07-13 21:04 tomas
  2008-07-29 10:50 ` tomas
  0 siblings, 1 reply; 4+ messages in thread
From: tomas @ 2008-07-13 21:04 UTC (permalink / raw)
  To: emacs-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

for some time now I have been working on a generic markup mode for
Emacs. The work has been sped up by the needs of a customer, which might
be served by this code.

I've asked the customer and they would be fine with publishing wnatever
comes out of it under the GPL -- even better if it is adopted as part of
Emacs.

Please find the current incarnation here:

  git http://tuxteam.de/~tomas/Repositories/am

Some remarks:

Design:

The idea is to support (nested) mark-ups like XML or Wiki, rendering
them in a more-or-less WYSIWYG fashion (as far as Emacs supports that).
The mapping between the markup elements and rendering whithin Emacs is
done via a "style" file (which is at the moment just an elisp file
containing faces and assorted fix-ups for special cases. Several
examples of style files are contained in the above code sample.

The markup model is more or less what we know from XML: spans of text
are attached with a "markup class" and a (possibly empty) list of
attributes. Those spans may be empty (the "singletons" in XML).

Implementation:

To satisfy the constraints:

 - preserve document order (even for empty spans)
 - move around markup classes on copy/kill and yank
 - round trip invariance (i.e. what is written is in some sense
   "equivalent" to what has been read)

I ended up with an interesting mixture of overlays, text properties and
invisible "sentinel characters" (always at the beginning of spans: thus
a span is "never empty" in the implementation (helps keeping document
order).

The current implementation features an XML parser (ugh! I must be crazy
to write _yet_ another half-complete XML parser, right?), and is able to
display this XML according to the "style file", copy/yank "works",
nesting whatever markup is picked up at the copy site within the markup
present in the target site.

It is implemented as a minor mode (I'd hoped once to use it as "literate
programming sub-mode" within a programming major mode, to embellish
embedded documentation).

I'd love to hear criticism, ideas, whatever. Do you think something like
this could be useful?

NOTE: I'll be off the net for the next fourteen days. But I'm looking
forward to your comments.

Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIem3xBcgs9XrR2kYRAjpVAJ92PEqzPJWGYN7TRqt/N0Rgl0JKrACdFXTs
nfJo/PESQOrhO2uUeHAfFQc=
=iHJz
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-29 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-13 21:04 RFC: A "markup mode" tomas
2008-07-29 10:50 ` tomas
2008-07-29 10:57   ` Miles Bader
2008-07-29 12:39   ` Thien-Thi Nguyen

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.