* mm-uu.el (mm-uu-diff-groups-regexp, mm-uu-type-alist)
authorJesper Harder <harder@ifa.au.dk>
Tue, 8 Apr 2003 16:35:42 +0000 (16:35 +0000)
committerJesper Harder <harder@ifa.au.dk>
Tue, 8 Apr 2003 16:35:42 +0000 (16:35 +0000)
(mm-uu-diff-extract, mm-uu-diff-test): New functionality:
recognize diffs.

* emacs-mime.texi (Non-MIME): Add diff.

lisp/ChangeLog
lisp/mm-uu.el
texi/ChangeLog
texi/emacs-mime.texi

index 552b53f..cce4efa 100644 (file)
@@ -1,5 +1,9 @@
 2003-04-08  Jesper Harder  <harder@ifa.au.dk>
 
+       * mm-uu.el (mm-uu-diff-groups-regexp, mm-uu-type-alist)
+       (mm-uu-diff-extract, mm-uu-diff-test): New functionality:
+       recognize diffs.
+
        * mm-bodies.el (mm-decode-body): Use the supplied charset
        unconditionally if `code-pages' hasn't been loaded.
 
index 13b6dcf..186e219 100644 (file)
@@ -78,6 +78,11 @@ This can be either \"inline\" or \"attachment\".")
 (defvar mm-uu-emacs-sources-regexp "gnu\\.emacs\\.sources"
   "The regexp of emacs sources groups.")
 
+(defcustom mm-uu-diff-groups-regexp "gnus\\.commits"
+  "*Regexp matching diff groups."
+  :type 'regexp
+  :group 'gnus-article-mime)
+
 (defvar mm-uu-type-alist
   '((postscript
      "^%!PS-"
@@ -139,7 +144,13 @@ This can be either \"inline\" or \"attachment\".")
      "^;;;?[ \t]*\\([^ \t]+\\.el\\)[ \t]+ends here"
      mm-uu-emacs-sources-extract
      nil
-     mm-uu-emacs-sources-test)))
+     mm-uu-emacs-sources-test)
+    (diff
+     "^Index: "
+     nil
+     mm-uu-diff-extract
+     nil
+     mm-uu-diff-test)))
 
 (defcustom mm-uu-configure-list '((shar . disabled))
   "A list of mm-uu configuration.
@@ -249,6 +260,15 @@ Return that buffer."
        mm-uu-emacs-sources-regexp
        (string-match mm-uu-emacs-sources-regexp gnus-newsgroup-name)))
 
+(defun mm-uu-diff-extract ()
+  (mm-make-handle (mm-uu-copy-to-buffer start-point end-point)
+                 '("text/x-patch")))
+
+(defun mm-uu-diff-test ()
+  (and gnus-newsgroup-name
+       mm-uu-diff-groups-regexp
+       (string-match mm-uu-diff-groups-regexp gnus-newsgroup-name)))
+
 (defun mm-uu-forward-extract ()
   (mm-make-handle (mm-uu-copy-to-buffer
                   (progn (goto-char start-point) (forward-line) (point))
index 35d09d0..6cd913a 100644 (file)
@@ -1,3 +1,7 @@
+2003-04-08  Jesper Harder  <harder@ifa.au.dk>
+
+       * emacs-mime.texi (Non-MIME): Add diff.
+
 2003-04-07  Jesper Harder  <harder@ifa.au.dk>
 
        * message.texi (Security): Fix typo.
index f249157..c68450d 100644 (file)
@@ -135,8 +135,8 @@ descend the message, following the structure, and return a tree of
 @vindex mm-uu-configure-list
 
 Gnus also understands some non-@sc{mime} attachments, such as
-postscript, uuencode, binhex, yenc, shar, forward, gnatsweb, pgp.
-Each of these features can be disabled by add an item into
+postscript, uuencode, binhex, yenc, shar, forward, gnatsweb, pgp,
+diff.  Each of these features can be disabled by add an item into
 @code{mm-uu-configure-list}.  For example,
 
 @lisp
@@ -187,9 +187,17 @@ PGP public keys.
 
 @item emacs-sources
 @findex emacs-sources
+@vindex mm-uu-emacs-sources-regexp
 Emacs source code.  This item works only in the groups matching
 @code{mm-uu-emacs-sources-regexp}.
 
+@item diff
+@vindex diff
+@vindex mm-uu-diff-groups-regexp
+Patches.  This is intended for groups where diffs of committed files
+are automatically sent to.  It only works in groups matching
+@code{mm-uu-diff-groups-regexp}.
+
 @end table
 
 @node Handles