;;; mm-uu.el --- Return uu stuff as mm handles
-;; Copyright (c) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp
This can be either \"inline\" or \"attachment\".")
(defvar mm-uu-emacs-sources-regexp "gnu\\.emacs\\.sources"
- "The regexp of emacs sources groups.")
+ "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
"^;;;?[ \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.
"Copy the contents of the current buffer to a fresh buffer.
Return that buffer."
(save-excursion
- (let ((obuf (current-buffer)))
+ (let ((obuf (current-buffer))
+ (coding-system
+ ;; Might not exist in non-MULE XEmacs
+ (when (boundp 'buffer-file-coding-system)
+ buffer-file-coding-system)))
(set-buffer (generate-new-buffer " *mm-uu*"))
+ (setq buffer-file-coding-system coding-system)
(insert-buffer-substring obuf from to)
(current-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))
((eq mm-verify-option 'never) nil)
((eq mm-verify-option 'always) t)
((eq mm-verify-option 'known) t)
- (t (y-or-n-p "Verify pgp signed part?")))))
+ (t (y-or-n-p "Verify pgp signed part? ")))))
(eval-when-compile
(defvar gnus-newsgroup-charset))
((eq mm-decrypt-option 'never) nil)
((eq mm-decrypt-option 'always) t)
((eq mm-decrypt-option 'known) t)
- (t (y-or-n-p "Decrypt pgp encrypted part?")))))
+ (t (y-or-n-p "Decrypt pgp encrypted part? ")))))
(defun mm-uu-pgp-encrypted-extract-1 (handles ctl)
(let ((buf (mm-uu-copy-to-buffer (point-min) (point-max))))