emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/xml.el,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/xml.el,v
Date: Mon, 24 Jul 2006 18:02:10 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       06/07/24 18:02:10

Index: xml.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/xml.el,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- xml.el      6 Feb 2006 14:33:36 -0000       1.53
+++ xml.el      24 Jul 2006 18:02:10 -0000      1.54
@@ -165,22 +165,19 @@
 Returns the top node with all its children.
 If PARSE-DTD is non-nil, the DTD is parsed rather than skipped.
 If PARSE-NS is non-nil, then QNAMES are expanded."
-  (let ((keep))
     (if (get-file-buffer file)
-       (progn
-         (set-buffer (get-file-buffer file))
-         (setq keep (point)))
-      (let (auto-mode-alist)           ; no need for xml-mode
-       (find-file file)))
-
-    (let ((xml (xml-parse-region (point-min)
+      (with-current-buffer (get-file-buffer file)
+       (save-excursion
+         (xml-parse-region (point-min)
                                 (point-max)
                                 (current-buffer)
                                 parse-dtd parse-ns)))
-      (if keep
-         (goto-char keep)
-       (kill-buffer (current-buffer)))
-      xml)))
+    (with-temp-buffer
+      (insert-file-contents file)
+      (xml-parse-region (point-min)
+                       (point-max)
+                       (current-buffer)
+                       parse-dtd parse-ns))))
 
 
 (defvar xml-name-re)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]