From 2bcfe99d046fea790986e46b3fd4b2e7a09030d8 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 15 Jul 2005 01:50:05 +0000 Subject: [PATCH] Do the right thing with consecutive list items, hopefully. * lisp/muse-docbook.el: Apply patch from Dale Smith and add to it. (muse-docbook-header): Add DTD string. (muse-docbook-markup-regexps): Add rule that merges consecutive list tags. (muse-docbook-merged-tags, muse-docbook-fixup-tags): Removed. ("docbook"): Change :before-end back to 'muse-docbook-fixup-sections. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-140 --- ChangeLog | 18 ++++++++++++++++++ lisp/muse-docbook.el | 39 +++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51ed2ec..a05e8e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,24 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-07-15 01:50:05 GMT Michael Olson patch-140 + + Summary: + Do the right thing with consecutive list items, hopefully. + Revision: + muse--main--1.0--patch-140 + + * lisp/muse-docbook.el: Apply patch from Dale Smith and add to it. + (muse-docbook-header): Add DTD string. + (muse-docbook-markup-regexps): Add rule that merges consecutive list + tags. + (muse-docbook-merged-tags, muse-docbook-fixup-tags): Removed. + ("docbook"): Change :before-end back to 'muse-docbook-fixup-sections. + + modified files: + ChangeLog lisp/muse-docbook.el + + 2005-07-15 01:07:35 GMT Michael Olson patch-139 Summary: diff --git a/lisp/muse-docbook.el b/lisp/muse-docbook.el index 5669d50..cc8af1b 100644 --- a/lisp/muse-docbook.el +++ b/lisp/muse-docbook.el @@ -50,7 +50,8 @@ See `muse-docbook' for more information." (defcustom muse-docbook-header " (muse-docbook-encoding)\"?> - +
<lisp>(muse-publishing-directive \"title\")</lisp> @@ -75,8 +76,13 @@ See `muse-docbook' for more information." (10100 "\\s-*\\s-*]*>\\s-*\\s-*" 0 "") (10200 "\\s-*]*>\\s-*" 0 "") + ;; Merge consecutive list tags + (10300 ,(concat "" + "\\s-*<\\(itemized\\|ordered\\|variable\\)list" + "[^>]*>") 0 "") + ;; beginning of doc, end of doc, or plain paragraph separator - (10300 ,(concat "\\(\n\\)?" + (10400 ,(concat "\\(\n\\)?" "\\(?:\n\\([" muse-regexp-blank "]*\n\\)+\\|\\`\\s-*\\|\\s-*\\'\\)" @@ -239,24 +245,17 @@ match is found, `muse-docbook-charset-default' is used instead." "\n" "\n" "\n" "\n"))) -(defcustom muse-docbook-merged-tags - '("itemizedlist" "orderedlist" "section" "variablelist") - "Tags which need to be merged together if they are consecutive." - :type '(repeat (string :tag "Tag")) - :group 'muse-docbook) - -(defun muse-docbook-fixup-tags () - "Merge multiple sections of tags from `muse-docbook-merged-tags'." - (dolist (tag muse-docbook-merged-tags) - (goto-char (point-min)) - (let (last) - (while (re-search-forward (concat "\n*<" tag ">") nil t) - (when last - (replace-match (concat "\n\n\n<" tag ">"))) - (setq last (match-beginning 0))) +(defun muse-docbook-fixup-sections () + "Add tags." + (goto-char (point-min)) + (let (last) + (while (re-search-forward "\n*
" nil t) (when last - (goto-char (point-max)) - (insert ""))))) + (replace-match "\n
\n\n
")) + (setq last (match-beginning 0))) + (when last + (goto-char (point-max)) + (insert "
")))) (defun muse-docbook-finalize-buffer () (when (memq buffer-file-coding-system '(no-conversion undecided-unix)) @@ -272,7 +271,7 @@ match is found, `muse-docbook-charset-default' is used instead." :functions 'muse-docbook-markup-functions :strings 'muse-docbook-markup-strings :specials 'muse-docbook-markup-specials - :before-end 'muse-docbook-fixup-tags + :before-end 'muse-docbook-fixup-sections :after 'muse-docbook-finalize-buffer :header 'muse-docbook-header :footer 'muse-docbook-footer -- 2.11.4.GIT