;;; gnus-uu.el --- extract (uu)encoded files in Gnus
-;; Copyright (C) 1985-1987, 1993-1998, 2000-2013 Free Software
+;; Copyright (C) 1985-1987, 1993-1998, 2000-2016 Free Software
;; Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
For example:
-To make gnus-uu use 'xli' to display JPEG and GIF files, put the
+To make gnus-uu use `xli' to display JPEG and GIF files, put the
following in your .emacs file:
- (setq gnus-uu-user-view-rules '((\"jpg$\\\\|gif$\" \"xli\")))
+ (setq gnus-uu-user-view-rules \\='((\"jpg$\\\\|gif$\" \"xli\")))
Both these variables are lists of lists with two string elements. The
first string is a regular expression. If the file name matches this
(defcustom gnus-uu-user-archive-rules nil
"A list that can be set to override the default archive unpacking commands.
-To use, for instance, 'untar' to unpack tar files and 'zip -x' to
+To use, for instance, `untar' to unpack tar files and `zip -x' to
unpack zip files, say the following:
(setq gnus-uu-user-archive-rules
- '((\"\\\\.tar$\" \"untar\")
+ \\='((\"\\\\.tar$\" \"untar\")
(\"\\\\.zip$\" \"zip -x\")))"
:group 'gnus-extract-archive
:type '(repeat (group regexp (string :tag "Command"))))
;; Various variables users may set
-(defcustom gnus-uu-tmp-dir
- (cond ((fboundp 'temp-directory) (temp-directory))
- ((boundp 'temporary-file-directory) temporary-file-directory)
- ("/tmp/"))
- "*Variable saying where gnus-uu is to do its work.
+(defcustom gnus-uu-tmp-dir temporary-file-directory
+ "Variable saying where gnus-uu is to do its work.
Default is \"/tmp/\"."
:group 'gnus-extract
:type 'directory)
(read-directory-name "Unbinhex and save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir))))
+ (gnus-uu-initialize)
(setq gnus-uu-binhex-article-name
- (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
+ (make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
(gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir))
(defun gnus-uu-decode-yenc (n dir)
(list current-prefix-arg
(read-file-name "Unbinhex, view and save in dir: "
gnus-uu-default-dir gnus-uu-default-dir)))
+ (gnus-uu-initialize)
(setq gnus-uu-binhex-article-name
- (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
+ (make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
(let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic)))
(gnus-uu-decode-binhex n file)))
(defun gnus-uu-digest-mail-forward (&optional n post)
"Digests and forwards all articles in this series."
(interactive "P")
+ (gnus-uu-initialize)
(let ((gnus-uu-save-in-digest t)
- (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "forward")))
+ (file (make-temp-file (nnheader-concat gnus-uu-work-dir "forward")))
(message-forward-as-mime message-forward-as-mime)
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)
(interactive)
(gnus-save-hidden-threads
(let ((level (gnus-summary-thread-level)))
- (while (and (gnus-summary-set-process-mark
- (gnus-summary-article-number))
- (zerop (gnus-summary-next-subject 1 nil t))
+ (while (and (gnus-summary-set-process-mark (gnus-summary-article-number))
+ (zerop (forward-line 1))
+ (not (eobp))
(> (gnus-summary-thread-level) level)))))
(gnus-summary-position-point))
(let ((level (gnus-summary-thread-level)))
(while (and (gnus-summary-remove-process-mark
(gnus-summary-article-number))
- (zerop (gnus-summary-next-subject 1))
+ (zerop (forward-line 1))
(> (gnus-summary-thread-level) level))))
(gnus-summary-position-point))
(setq state (list 'middle))))
(with-current-buffer "*gnus-uu-body*"
(goto-char (setq beg (point-max)))
- (save-excursion
+ (with-current-buffer buffer
(save-restriction
- (set-buffer buffer)
- (let (buffer-read-only)
- (set-text-properties (point-min) (point-max) nil)
- ;; These two are necessary for XEmacs 19.12 fascism.
- (put-text-property (point-min) (point-max) 'invisible nil)
- (put-text-property (point-min) (point-max) 'intangible nil))
+ (let ((inhibit-read-only t))
+ (set-text-properties (point-min) (point-max) nil))
(when (and message-forward-as-mime
message-forward-show-mml
gnus-uu-digest-buffer)
(match-beginning 0)
(or (and (re-search-forward "^[^ \t]" nil t)
(1- (point)))
- (progn (forward-line 1) (point)))))))))
- (widen)))
+ (progn (forward-line 1) (point)))))))))))
(if (and message-forward-as-mime gnus-uu-digest-buffer)
(if message-forward-show-mml
(progn
gnus-uu-tmp-dir)))
(setq gnus-uu-work-dir
- (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir))
+ (make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir))
(gnus-set-file-modes gnus-uu-work-dir 448)
(setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir))
(push (cons gnus-newsgroup-name gnus-uu-work-dir)
;; Initializing
-(add-hook 'gnus-exit-group-hook 'gnus-uu-clean-up)
-(add-hook 'gnus-exit-group-hook 'gnus-uu-delete-work-dir)
+(add-hook 'gnus-summary-prepare-exit-hook 'gnus-uu-clean-up)
+(add-hook 'gnus-summary-prepare-exit-hook 'gnus-uu-delete-work-dir)
\f