]> gitweb.fperrin.net Git - atom.el.git/blobdiff - atom.el
Re-order the arguments to `atom-create'.
[atom.el.git] / atom.el
diff --git a/atom.el b/atom.el
index c645cdabe08313b160472b6e32767c179dadd351..7d70ac577b445e7c9a65b067a02f2e428c03a3c4 100644 (file)
--- a/atom.el
+++ b/atom.el
 
 (require 'xml)
 
-(defun atom-create (title link &optional author self updated id)
+(defun atom-create (title link &optional self id author updated)
   "Create a new atom structure.
 
 TITLE is the title for the feed, a short, text-only, human
 readable string.
 
-AUTHOR is the author of the feed. See `atom-massage-author' for
-the possible ways to specify it.
-
-SELF is the canonical URL to this feed.
-
 LINK is the URL of a page responible for the content of this
 feed.
 
-UPDATED is the date the feed was last updated. If not given,
-`(current-time)' is used.
+SELF is the canonical URL to this feed.
 
 ID is a unique identifier for this feed. If not given, it
-defaults to LINK."
+defaults to LINK.
+
+AUTHOR is the author of the feed. See `atom-massage-author' for
+the possible ways to specify it.
+
+UPDATED is the date the feed was last updated. If not given,
+`(current-time)' is used."
   (let ((atom-feed (list (list 'title nil title))))
     (atom-modify-entry atom-feed 'link `(((href . ,link))))
     (atom-modify-entry atom-feed 'author (atom-massage-author author))
@@ -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."