Source

xemacsweb / release-mail-to-html.el

Diff from to

File release-mail-to-html.el

 (setq release-mail-to-html-regexp-alist
       (list
        (list
-	"XEmacs"
+	;; lower-case for down-cased type lookup
+	"xemacs"
 	'release-mail-to-html-preformatted-regexp
 	(list
 	 "<pre xml:space=\"preserve\">\\(.*?\\(\n.*?\\)*\\)</pre>" :body 1)
 	 :from 1 :subject 2 :reference 3)
 	)
        (list
-	"XEmacs Packages"
+	;; lower-case for down-cased type lookup
+	"xemacs packages"
 	'release-mail-to-html-preformatted-regexp
 	(list
 	 "<pre xml:space=\"preserve\">\\(.*?\\(\n.*?\\)*\\)</pre>" :body 1)
 	 "\n\\(--text follows this line--\\)?\n")
 	'release-mail-to-html-subject-regexp
 	(list
-	 "^subject[ \t]*:[ \t]*\\(?:\\[ANNOUNCE\\][ \t]*\\)?\\(XEmacs Packages\\) have been \\(?:pre-\\)?released (\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?:-[0-9]\\{2\\}\\)?\\))"
+	 "^subject[ \t]*:[ \t]*\\(?:\\[ANNOUNCE\\][ \t]*\\|.*\\)?\\(XEmacs Packages\\)\\(?: have been \\(?:pre-\\)?released\\|.+\\)?(\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?:-[0-9]\\{2\\}\\)?\\))"
 	 :type 1 :code-name 2)
 	'release-mail-to-html-summary-header-regexp
 	(list
 		  subject (let ((raw-subject (match-string 0)))
 			    (when (string-match "^subject: " raw-subject)
 			      (replace-match "" t nil raw-subject))))
-	      (setq type (plist-get result :type)))))
+	    ;; lower-case for down-cased type lookup
+	    (setq type (downcase (plist-get result :type))))))
        release-mail-to-html-regexp-alist))
-    (when type
+    (if (null type)
+	(warn
+	 "release-mail-to-html: None of the defined release types matched by %S."
+	 'release-mail-to-html-subject-regexp)
       (save-excursion
 	(with-temp-buffer
 	  (insert-buffer buffer)
 		   (point-min)
 		   (point-max)))
 	    ;; Generate list of index items
-	    ;; APA: Make sure to keep this order the reverse of the actual
-	    ;; document sections (because I cons here, adding to the head
-	    ;; of the list).
+	    ;; FIXME: Make sure to keep this order the reverse of the
+	    ;; actual document sections (because I cons here, adding
+	    ;; to the head of the list).
 	    (when release-mail-to-html-patch-list
 	      (setq
 	       release-mail-index