Arnaud Bailly <[EMAIL PROTECTED]> writes: > Michael Olson <[EMAIL PROTECTED]> writes: >> >> - A `muse-trac-markup-list' function based on >> `muse-publish-markup-list' that just uses the "movement" functions >> (like muse-forward-list-item) and replaces dashes with "*" >> characters. >> > > That's the hard part. I understand the english but not the emacs-lisp > version :-) I am sorry but my mastery of the latter is rather low and > I have a hard time understanding how `muse-publish-markup-list' > and muse-forward-list-item work.
Indeed, it is kind of tricky. The reason for using muse-forward-list
item is to figure out which list entries are consecutive. Come to think
of it, you might not even need to go to a lot of effort after all, as
long as the leading whitespace serves exactly the same purpose in Muse
and Trac.
An easier solution would to write a muse-trac-markup-list function like
this:
(defun muse-trac-markup-list ()
"Markup a list entry.
This function works by marking up items of the same list level
and type, respecting the end-of-list property."
(let* ((str (match-string 1))
(type (muse-list-item-type str)))
(cond
((or (get-text-property (muse-list-item-critical-point) 'read-only)
(get-text-property (muse-list-item-critical-point) 'muse-link))
nil)
((eq type 'ul)
;; unordered lists
(replace-match "* " t t nil 1))
((eq type 'ol)
;; handle ordered lists, if needed
)
((not (string= (match-string 2) ""))
;; handle definition lists, if needed
)))
nil)
--
Michael Olson -- FSF Associate Member #652 |
http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net | /` |\ | | |
Sysadmin -- Hobbies: Lisp, GP2X, HCoop | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
pgpklAsr23KFW.pgp
Description: PGP signature
_______________________________________________ Muse-el-discuss mailing list [email protected] https://mail.gna.org/listinfo/muse-el-discuss
