Add a function to write an Atom feed to a file.
authorFrédéric Perrin <frederic.perrin@resel.fr>
Mon, 31 Jan 2011 22:59:50 +0000 (23:59 +0100)
committerFrédéric Perrin <frederic.perrin@resel.fr>
Wed, 2 Feb 2011 21:20:16 +0000 (22:20 +0100)
atom.el

diff --git a/atom.el b/atom.el
index c645cdabe08313b160472b6e32767c179dadd351..c73c7d90704d10c8140183bff29e23e9d18a4603 100644 (file)
--- a/atom.el
+++ b/atom.el
@@ -167,6 +167,12 @@ fragment. See `atom-add-entry' for additional details."
   (xml-print atom)
   (insert "\n</feed>"))
 
+(defun atom-write-file (atom filename)
+  "Writes the feed ATOM to FILENAME."
+  (with-temp-buffer
+    (atom-print atom)
+    (write-region (point-min) (point-max) filename)))
+
 \f
 (defun atom-format-time (&optional time)
   "Format a time according to RFC3339."