From a3110b5ddc17825486b5584c299d9c9ab3ca20e8 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 6 Oct 2004 00:58:29 +0000 Subject: [PATCH] fix to for xml-substitute-special to produce a single string instead of several if a substitution is made. --- lisp/xml.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/xml.el b/lisp/xml.el index 993ef59b276..dd6d5095bc2 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -727,13 +727,13 @@ This follows the rule [28] in the XML specifications." (match-string 1 this-part))))))) (cond ((null children) - (if (stringp expansion) + (if (and (eq (length expansion) 1) + (stringp (cadr expansion))) (setq children (concat prev-part expansion)) - (if (stringp (car (last expansion))) - (progn - (setq children - (list (concat prev-part (car expansion)) - (cdr expansion)))) + (if (stringp (car expansion)) + (setq children + (list (concat prev-part (car expansion)) + (append (cdr expansion)))) (setq children (append expansion prev-part))))) ((stringp children) (if (stringp expansion) @@ -756,11 +756,15 @@ This follows the rule [28] in the XML specifications." (cond ((stringp children) (concat children (substring string point))) ((stringp (car (last children))) - (concat (car children) (substring string point))) + (concat (car (last children)) (substring string point))) ((null children) string) (t - (nreverse children))))) + (concat (mapconcat 'identity + (nreverse children) + "") + (substring string point)))))) + ;;******************************************************************* ;;** ;;** Printing a tree. -- 2.39.2