From ca7977476661208fada62cf4fbea7cb91c281f0b Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Wed, 1 Mar 2006 15:08:45 +0000 Subject: [PATCH] Merge consecutive definition list terms properly. * lisp/muse-publish.el (muse-publish-surround-dl): Keep track of status correctly. This makes Muse merge several definition list items into one list. (muse-forward-list-item): Use simpler regexp for 'dl. * lisp/muse-regexps.el (muse-list-item-regexp): Make terms optional in definition lists, and make terms the 2nd matched text. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-28 --- ChangeLog.2006 | 19 +++++++++++++++++++ lisp/muse-publish.el | 33 ++++++++++++++++++--------------- lisp/muse-regexps.el | 2 +- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/ChangeLog.2006 b/ChangeLog.2006 index 993dea8..6cda8e2 100644 --- a/ChangeLog.2006 +++ b/ChangeLog.2006 @@ -2,6 +2,25 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-03-01 15:08:45 GMT Michael Olson patch-28 + + Summary: + Merge consecutive definition list terms properly. + Revision: + muse--main--1.0--patch-28 + + * lisp/muse-publish.el (muse-publish-surround-dl): Keep track of status + correctly. This makes Muse merge several definition list items into + one list. + (muse-forward-list-item): Use simpler regexp for 'dl. + + * lisp/muse-regexps.el (muse-list-item-regexp): Make terms optional in + definition lists, and make terms the 2nd matched text. + + modified files: + ChangeLog.2006 lisp/muse-publish.el lisp/muse-regexps.el + + 2006-02-28 23:48:24 GMT Michael Olson patch-27 Summary: diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index b6c2a7e..099236d 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -938,8 +938,13 @@ The following contexts exist in Muse. (beg-dde (muse-markup-text 'begin-dde)) (end-dde (muse-markup-text 'end-dde)) (move-term `(lambda () - (while (and (muse-forward-list-item 'dl ,indent) - (null (match-string 3)))))) + (let (status) + (while (and + (setq status + (muse-forward-list-item 'dl ,indent)) + (string= (match-string 3) "")) + (goto-char (match-end 0))) + status))) (move-entry `(lambda () (muse-forward-list-item 'dl ,indent t))) (continue t) @@ -1030,12 +1035,9 @@ The beginning indentation is given by INDENT. If TYPE is 'dl and ENTRY-P is non-nil, seach ahead by dl entries. Otherwise if TYPE is 'dl and ENTRY-P is nil, search ahead by dl terms." - (let ((list-item (if (eq type 'dl) - (if entry-p - muse-dl-entry-regexp - (format muse-list-item-regexp - (concat "\\(" muse-dl-entry-regexp "\\|" - indent "\\)"))) + (let ((list-item (if (and (eq type 'dl) + entry-p) + muse-dl-entry-regexp (format muse-list-item-regexp indent))) (empty-line (concat "^[" muse-regexp-blank "]*\n")) (next-list-end (or (next-single-property-change (point) 'end-list) @@ -1054,13 +1056,14 @@ terms." t) nil)) ((eq type 'dl) - (if (string= (match-string 2) indent) - t - (if (match-beginning 3) - (progn - (goto-char (match-beginning 1)) - (eq 'dl (muse-list-item-type (match-string 3)))) - nil))) + (if (match-beginning 2) + (if (string= (buffer-substring (match-beginning 1) + (match-beginning 2)) + indent) + t + (goto-char (match-beginning 1)) + (eq 'dl (muse-list-item-type (match-string 2)))) + nil)) ((and (match-string 2) (eq type (muse-list-item-type (match-string 2)))) (replace-match "" t t nil 2) diff --git a/lisp/muse-regexps.el b/lisp/muse-regexps.el index f052b66..5c16739 100644 --- a/lisp/muse-regexps.el +++ b/lisp/muse-regexps.el @@ -140,7 +140,7 @@ the time." (defcustom muse-list-item-regexp (concat "^%s\\([" muse-regexp-blank "]-[" muse-regexp-blank "]*\\|[" muse-regexp-blank "][0-9]+\\.[" - muse-regexp-blank "]*\\|\\(?:.+?\\)[" + muse-regexp-blank "]*\\|\\(.*?\\)[" muse-regexp-blank "]+::[" muse-regexp-blank "]*\\)") "Regexp used to match the beginning of a list item. The '%s' will be replaced with a whitespace regexp when publishing." -- 2.11.4.GIT