From 60879fc191ee9359fcb396f0db4ddd90121f15a3 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sun, 26 Nov 2006 22:56:07 +0000 Subject: [PATCH] muse-docbook: Get nested list publishing up to par 2006-11-26 Michael Olson * lisp/muse-docbook.el (muse-docbook-markup-paragraph): Fix nested list issues and multiple-stanza verse issues. This takes care of all of the markup issues I was worried about. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-251 --- ChangeLog | 4 ++++ lisp/muse-docbook.el | 57 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index c107cb0..47add16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-11-26 Michael Olson + * lisp/muse-docbook.el (muse-docbook-markup-paragraph): Fix nested + list issues and multiple-stanza verse issues. This takes care of + all of the markup issues I was worried about. + * lisp/muse-project.el (muse-project-ignore-regexp): Minor docfix. (muse-project-publish-private-files): New option that indicates whether files with private filesystem permissions should be diff --git a/lisp/muse-docbook.el b/lisp/muse-docbook.el index de12b59..32724ce 100644 --- a/lisp/muse-docbook.el +++ b/lisp/muse-docbook.el @@ -208,30 +208,39 @@ found in `muse-docbook-encoding-map'." muse-docbook-charset-default)) (defun muse-docbook-markup-paragraph () - (let ((end (copy-marker (match-end 0) t))) - (goto-char (match-beginning 0)) - (when (save-excursion - (save-match-data - (and (re-search-backward "<\\(/?\\)\\(para\\|footnote\\)[ >]" - nil t) - (or (and (string= (match-string 2) "para") - (not (string= (match-string 1) "/"))) - (and (string= (match-string 2) "footnote") - (string= (match-string 1) "/")))))) - (when (get-text-property (1- (point)) 'end-list) - (goto-char (previous-single-property-change (1- (point)) 'end-list))) - (muse-insert-markup "")) - (goto-char end)) - (cond - ((eobp) - (unless (bolp) - (insert "\n"))) - ((eq (char-after) ?\<) - (when (looking-at (concat "<\\(emphasis\\|systemitem\\|inlinemediaobject" - "\\|u?link\\|anchor\\|email\\)[ >]")) - (muse-insert-markup ""))) - (t - (muse-insert-markup "")))) + (catch 'bail-out + (let ((end (copy-marker (match-end 0) t))) + (goto-char (match-beginning 0)) + (when (save-excursion + (save-match-data + (and (re-search-backward + "<\\(/?\\)\\(para\\|footnote\\|literallayout\\)[ >]" + nil t) + (cond ((string= (match-string 2) "literallayout") + (throw 'bail-out t)) + ((string= (match-string 2) "para") + (and + (not (string= (match-string 1) "/")) + ;; don't mess up nested lists + (not (and (muse-looking-back "") + (throw 'bail-out t))))) + ((string= (match-string 2) "footnote") + (string= (match-string 1) "/")) + (t nil))))) + (when (get-text-property (1- (point)) 'end-list) + (goto-char (previous-single-property-change (1- (point)) 'end-list))) + (muse-insert-markup "")) + (goto-char end)) + (cond + ((eobp) + (unless (bolp) + (insert "\n"))) + ((eq (char-after) ?\<) + (when (looking-at (concat "<\\(emphasis\\|systemitem\\|inlinemediaobject" + "\\|u?link\\|anchor\\|email\\)[ >]")) + (muse-insert-markup ""))) + (t + (muse-insert-markup ""))))) (defun muse-docbook-get-author (&optional author) "Split the AUTHOR directive into separate fields. -- 2.11.4.GIT