;;; gnus-uu.el --- extract (uu)encoded files in Gnus
-;; Copyright (C) 1985,86,87,93,94,95,96,97,98 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987,1993-1998,2000 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Created: 2 Oct 1993
(require 'gnus-art)
(require 'message)
(require 'gnus-msg)
+(require 'mm-decode)
(defgroup gnus-extract nil
"Extracting encoded files."
;; Default viewing action rules
(defcustom gnus-uu-default-view-rules
- '(("\\.te?xt$\\|\\.doc$\\|read.*me\\|\\.c?$\\|\\.h$\\|\\.bat$\\|\\.asm$\\|makefile" "cat %s | sed s/\r//g")
- ("\\.pas$" "cat %s | sed s/\r//g")
+ '(("\\.te?xt$\\|\\.doc$\\|read.*me\\|\\.c?$\\|\\.h$\\|\\.bat$\\|\\.asm$\\|makefile" "cat %s | sed 's/\r$//'")
+ ("\\.pas$" "cat %s | sed 's/\r$//'")
("\\.[1-9]$" "groff -mandoc -Tascii %s | sed s/\b.//g")
- ("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$" "xv")
- ("\\.tga$" "tgatoppm %s | xv -")
+ ("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$" "display")
+ ("\\.tga$" "tgatoppm %s | ee -")
("\\.\\(wav\\|aiff\\|hcom\\|u[blw]\\|s[bfw]\\|voc\\|smp\\)$"
"sox -v .5 %s -t .au -u - > /dev/audio")
("\\.au$" "cat %s > /dev/audio")
;; Various variables users may set
-(defcustom gnus-uu-tmp-dir "/tmp/"
+(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.
Default is \"/tmp/\"."
:group 'gnus-extract
(defvar gnus-uu-shar-begin-string "^#! */bin/sh")
(defvar gnus-uu-shar-file-name nil)
-(defvar gnus-uu-shar-name-marker "begin [0-7][0-7][0-7][ \t]+\\(\\(\\w\\|\\.\\)*\\b\\)")
+(defvar gnus-uu-shar-name-marker
+ "begin [0-7][0-7][0-7][ \t]+\\(\\(\\w\\|\\.\\)*\\b\\)")
(defvar gnus-uu-postscript-begin-string "^%!PS-")
(defvar gnus-uu-postscript-end-string "^%%EOF$")
(gnus-define-keys (gnus-uu-extract-map "X" gnus-summary-mode-map)
;;"x" gnus-uu-extract-any
- ;;"m" gnus-uu-extract-mime
+ "m" gnus-summary-save-parts
"u" gnus-uu-decode-uu
"U" gnus-uu-decode-uu-and-save
"s" gnus-uu-decode-unshar
"P" gnus-uu-decode-postscript-and-save)
(gnus-define-keys
- (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
- "u" gnus-uu-decode-uu-view
- "U" gnus-uu-decode-uu-and-save-view
- "s" gnus-uu-decode-unshar-view
- "S" gnus-uu-decode-unshar-and-save-view
- "o" gnus-uu-decode-save-view
- "O" gnus-uu-decode-save-view
- "b" gnus-uu-decode-binhex-view
- "B" gnus-uu-decode-binhex-view
- "p" gnus-uu-decode-postscript-view
- "P" gnus-uu-decode-postscript-and-save-view)
+ (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
+ "u" gnus-uu-decode-uu-view
+ "U" gnus-uu-decode-uu-and-save-view
+ "s" gnus-uu-decode-unshar-view
+ "S" gnus-uu-decode-unshar-and-save-view
+ "o" gnus-uu-decode-save-view
+ "O" gnus-uu-decode-save-view
+ "b" gnus-uu-decode-binhex-view
+ "B" gnus-uu-decode-binhex-view
+ "p" gnus-uu-decode-postscript-view
+ "P" gnus-uu-decode-postscript-and-save-view)
;; Commands.
(interactive "P")
(let ((gnus-uu-save-in-digest t)
(file (make-temp-name (nnheader-concat gnus-uu-tmp-dir "forward")))
- buf subject from newsgroups)
+ buf subject from)
(gnus-setup-message 'forward
(setq gnus-uu-digest-from-subject nil)
(gnus-uu-decode-save n file)
- (setq buf (switch-to-buffer (get-buffer-create " *gnus-uu-forward*")))
- (gnus-add-current-to-buffer-list)
+ (setq buf (switch-to-buffer
+ (gnus-get-buffer-create " *gnus-uu-forward*")))
(erase-buffer)
(insert-file file)
+ (delete-file file)
(let ((fs gnus-uu-digest-from-subject))
(when fs
(setq from (caar fs)
(delete-region (point) (gnus-point-at-eol))
(insert from))
(message-forward post))
- (delete-file file)
- (kill-buffer buf)
(setq gnus-uu-digest-from-subject nil)))
(defun gnus-uu-digest-post-forward (&optional n)
;; Process marking.
(defun gnus-uu-mark-by-regexp (regexp &optional unmark)
- "Ask for a regular expression and set the process mark on all articles that match."
- (interactive (list (read-from-minibuffer "Mark (regexp): ")))
+ "Set the process mark on articles whose subjects match REGEXP.
+When called interactively, prompt for REGEXP.
+Optional UNMARK non-nil means unmark instead of mark."
+ (interactive "sMark (regexp): \nP")
(let ((articles (gnus-uu-find-articles-matching regexp)))
(while articles
(if unmark
(message ""))
(gnus-summary-position-point))
-(defun gnus-uu-unmark-by-regexp (regexp &optional unmark)
- "Ask for a regular expression and remove the process mark on all articles that match."
- (interactive (list (read-from-minibuffer "Mark (regexp): ")))
+(defun gnus-uu-unmark-by-regexp (regexp)
+ "Remove the process mark from articles whose subjects match REGEXP.
+When called interactively, prompt for REGEXP."
+ (interactive "sUnmark (regexp): ")
(gnus-uu-mark-by-regexp regexp t))
(defun gnus-uu-mark-series ()
(defun gnus-uu-mark-thread ()
"Marks all articles downwards in this thread."
(interactive)
- (let ((level (gnus-summary-thread-level)))
- (while (and (gnus-summary-set-process-mark (gnus-summary-article-number))
- (zerop (gnus-summary-next-subject 1))
- (> (gnus-summary-thread-level) level))))
+ (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))
+ (> (gnus-summary-thread-level) level)))))
(gnus-summary-position-point))
(defun gnus-uu-unmark-thread ()
"Invert the list of process-marked articles."
(interactive)
(let ((data gnus-newsgroup-data)
- d number)
+ number)
(save-excursion
(while data
(if (memq (setq number (gnus-data-number (pop data)))
(defun gnus-uu-mark-over (&optional score)
"Mark all articles with a score over SCORE (the prefix)."
(interactive "P")
- (let ((score (gnus-score-default score))
+ (let ((score (or score gnus-summary-default-score 0))
(data gnus-newsgroup-data))
(save-excursion
(while data
(mail-header-subject header))
gnus-uu-digest-from-subject))
(let ((name (file-name-nondirectory gnus-uu-saved-article-name))
- (delim (concat "^" (make-string 30 ?-) "$"))
beg subj headers headline sorthead body end-string state)
(if (or (eq in-state 'first)
(eq in-state 'first-and-last))
(progn
(setq state (list 'begin))
- (save-excursion (set-buffer (get-buffer-create "*gnus-uu-body*"))
- (erase-buffer))
(save-excursion
- (set-buffer (get-buffer-create "*gnus-uu-pre*"))
+ (set-buffer (gnus-get-buffer-create "*gnus-uu-body*"))
+ (erase-buffer))
+ (save-excursion
+ (set-buffer (gnus-get-buffer-create "*gnus-uu-pre*"))
(erase-buffer)
(insert (format
"Date: %s\nFrom: %s\nSubject: %s Digest\n\nTopics:\n"
(beginning-of-line)
(forward-line 1)
(when (file-exists-p gnus-uu-binhex-article-name)
- (append-to-file start-char (point) gnus-uu-binhex-article-name))))
+ (mm-append-to-file start-char (point) gnus-uu-binhex-article-name))))
(if (memq 'begin state)
(cons gnus-uu-binhex-article-name state)
state)))
(if (not (re-search-forward gnus-uu-postscript-end-string nil t))
(setq state (list 'wrong-type))
(setq end-char (point))
- (set-buffer (get-buffer-create gnus-uu-output-buffer-name))
+ (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name))
(insert-buffer-substring process-buffer start-char end-char)
(setq file-name (concat gnus-uu-work-dir
(cdr gnus-article-current) ".ps"))
(defun gnus-uu-reginize-string (string)
;; Takes a string and puts a \ in front of every special character;
- ;; ignores any leading "version numbers" thingies that they use in
- ;; the comp.binaries groups, and either replaces anything that looks
- ;; like "2/3" with "[0-9]+/[0-9]+" or, if it can't find something
- ;; like that, replaces the last two numbers with "[0-9]+". This, in
- ;; my experience, should get most postings of a series.
- (let ((count 2)
- (vernum "v[0-9]+[a-z][0-9]+:")
- beg)
- (save-excursion
- (set-buffer (get-buffer-create gnus-uu-output-buffer-name))
- (buffer-disable-undo (current-buffer))
- (erase-buffer)
- (insert (regexp-quote string))
- (setq beg 1)
+ ;; replaces the last thing that looks like "2/3" with "[0-9]+/3"
+ ;; or, if it can't find something like that, tries "2 of 3", then
+ ;; finally just replaces the next to last number with "[0-9]+".
+ (save-excursion
+ (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name))
+ (buffer-disable-undo)
+ (erase-buffer)
+ (insert (regexp-quote string))
- (setq case-fold-search nil)
- (goto-char (point-min))
- (when (looking-at vernum)
- (replace-match vernum t t)
- (setq beg (length vernum)))
+ (setq case-fold-search nil)
- (goto-char beg)
- (if (re-search-forward "[ \t]*[0-9]+/[0-9]+" nil t)
- (replace-match " [0-9]+/[0-9]+")
+ (end-of-line)
+ (if (re-search-backward "\\([^0-9]\\)[0-9]+/\\([0-9]+\\)" nil t)
+ (replace-match "\\1[0-9]+/\\2")
- (goto-char beg)
- (if (re-search-forward "[0-9]+[ \t]*of[ \t]*[0-9]+" nil t)
- (replace-match "[0-9]+ of [0-9]+")
+ (end-of-line)
+ (if (re-search-backward "\\([^0-9]\\)[0-9]+[ \t]*of[ \t]*\\([0-9]+\\)"
+ nil t)
+ (replace-match "\\1[0-9]+ of \\2")
- (end-of-line)
- (if (re-search-backward "\\([^0-9]\\)[0-9]+\\([^0-9]+\\)[0-9]+"
- nil t)
- (replace-match "\\1[0-9]+\\2[0-9]+" t nil nil nil))))
+ (end-of-line)
+ (if (re-search-backward "\\([^0-9]\\)[0-9]+\\([^0-9]+\\)[0-9]+"
+ nil t)
+ (replace-match "\\1[0-9]+\\2[0-9]+" t nil nil nil))))
- (goto-char beg)
- (while (re-search-forward "[ \t]+" nil t)
- (replace-match "[ \t]*" t t))
+ (goto-char 1)
+ (while (re-search-forward "[ \t]+" nil t)
+ (replace-match "[ \t]+" t t))
- (buffer-substring 1 (point-max)))))
+ (buffer-substring 1 (point-max))))
(defun gnus-uu-get-list-of-articles (n)
;; If N is non-nil, the article numbers of the N next articles
(gnus-uu-reginize-string (gnus-summary-article-subject))))
list-of-subjects)
(save-excursion
- (if (not subject)
- ()
+ (when subject
;; Collect all subjects matching subject.
(let ((case-fold-search t)
(data gnus-newsgroup-data)
(let ((out-list string-list)
string)
(save-excursion
- (set-buffer (get-buffer-create gnus-uu-output-buffer-name))
- (buffer-disable-undo (current-buffer))
+ (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name))
+ (buffer-disable-undo)
(while string-list
(erase-buffer)
(insert (caar string-list))
&optional sloppy limit no-errors)
(let ((state 'first)
(gnus-asynchronous nil)
+ (gnus-inhibit-treatment t)
has-been-begin article result-file result-files process-state
gnus-summary-display-article-function
- gnus-article-display-hook gnus-article-prepare-hook
+ gnus-article-prepare-hook gnus-display-mime-function
article-series files)
(while (and articles
(not (memq 'end process-state))))
(setq article (pop articles))
- (push article article-series)
-
- (unless articles
- (if (eq state 'first)
- (setq state 'first-and-last)
- (setq state 'last)))
+ (when (vectorp (gnus-summary-article-header article))
+ (push article article-series)
- (let ((part (gnus-uu-part-number article)))
- (gnus-message 6 "Getting article %d%s..."
- article (if (string= part "") "" (concat ", " part))))
- (gnus-summary-display-article article)
+ (unless articles
+ (if (eq state 'first)
+ (setq state 'first-and-last)
+ (setq state 'last)))
- ;; Push the article to the processing function.
- (save-excursion
- (set-buffer gnus-original-article-buffer)
- (let ((buffer-read-only nil))
- (save-excursion
- (set-buffer gnus-summary-buffer)
- (setq process-state
- (funcall process-function
- gnus-original-article-buffer state)))))
-
- (gnus-summary-remove-process-mark article)
-
- ;; If this is the beginning of a decoded file, we push it
- ;; on to a list.
- (when (or (memq 'begin process-state)
- (and (or (eq state 'first)
- (eq state 'first-and-last))
- (memq 'ok process-state)))
- (when has-been-begin
- ;; If there is a `result-file' here, that means that the
- ;; file was unsuccessfully decoded, so we delete it.
- (when (and result-file
- (file-exists-p result-file)
- (not gnus-uu-be-dangerous)
- (or (eq gnus-uu-be-dangerous t)
- (gnus-y-or-n-p
- (format "Delete unsuccessfully decoded file %s"
- result-file))))
- (delete-file result-file)))
- (when (memq 'begin process-state)
- (setq result-file (car process-state)))
- (setq has-been-begin t))
-
- ;; Check whether we have decoded one complete file.
- (when (memq 'end process-state)
- (setq article-series nil)
- (setq has-been-begin nil)
- (if (stringp result-file)
- (setq files (list result-file))
- (setq files result-file))
- (setq result-file (car files))
- (while files
- (push (list (cons 'name (pop files))
- (cons 'article article))
- result-files))
- ;; Allow user-defined functions to be run on this file.
- (when gnus-uu-grabbed-file-functions
- (let ((funcs gnus-uu-grabbed-file-functions))
- (unless (listp funcs)
- (setq funcs (list funcs)))
- (while funcs
- (funcall (pop funcs) result-file))))
- (setq result-file nil)
- ;; Check whether we have decoded enough articles.
- (and limit (= (length result-files) limit)
- (setq articles nil)))
-
- ;; If this is the last article to be decoded, and
- ;; we still haven't reached the end, then we delete
- ;; the partially decoded file.
- (and (or (eq state 'last) (eq state 'first-and-last))
- (not (memq 'end process-state))
- result-file
- (file-exists-p result-file)
- (not gnus-uu-be-dangerous)
- (or (eq gnus-uu-be-dangerous t)
- (gnus-y-or-n-p (format "Delete incomplete file %s? " result-file)))
- (delete-file result-file))
-
- ;; If this was a file of the wrong sort, then
- (when (and (or (memq 'wrong-type process-state)
- (memq 'error process-state))
- gnus-uu-unmark-articles-not-decoded)
- (gnus-summary-tick-article article t))
-
- ;; Set the new series state.
- (if (and (not has-been-begin)
- (not sloppy)
- (or (memq 'end process-state)
- (memq 'middle process-state)))
- (progn
- (setq process-state (list 'error))
- (gnus-message 2 "No begin part at the beginning")
- (sleep-for 2))
- (setq state 'middle)))
+ (let ((part (gnus-uu-part-number article)))
+ (gnus-message 6 "Getting article %d%s..."
+ article (if (string= part "") "" (concat ", " part))))
+ (gnus-summary-display-article article)
- ;; When there are no result-files, then something must be wrong.
- (if result-files
- (message "")
- (cond
- ((not has-been-begin)
- (gnus-message 2 "Wrong type file"))
- ((memq 'error process-state)
- (gnus-message 2 "An error occurred during decoding"))
- ((not (or (memq 'ok process-state)
- (memq 'end process-state)))
- (gnus-message 2 "End of articles reached before end of file")))
- ;; Make unsuccessfully decoded articles unread.
- (when gnus-uu-unmark-articles-not-decoded
- (while article-series
- (gnus-summary-tick-article (pop article-series) t))))
+ ;; Push the article to the processing function.
+ (save-excursion
+ (set-buffer gnus-original-article-buffer)
+ (let ((buffer-read-only nil))
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (setq process-state
+ (funcall process-function
+ gnus-original-article-buffer state)))))
+
+ (gnus-summary-remove-process-mark article)
+
+ ;; If this is the beginning of a decoded file, we push it
+ ;; on to a list.
+ (when (or (memq 'begin process-state)
+ (and (or (eq state 'first)
+ (eq state 'first-and-last))
+ (memq 'ok process-state)))
+ (when has-been-begin
+ ;; If there is a `result-file' here, that means that the
+ ;; file was unsuccessfully decoded, so we delete it.
+ (when (and result-file
+ (file-exists-p result-file)
+ (not gnus-uu-be-dangerous)
+ (or (eq gnus-uu-be-dangerous t)
+ (gnus-y-or-n-p
+ (format "Delete unsuccessfully decoded file %s"
+ result-file))))
+ (delete-file result-file)))
+ (when (memq 'begin process-state)
+ (setq result-file (car process-state)))
+ (setq has-been-begin t))
+
+ ;; Check whether we have decoded one complete file.
+ (when (memq 'end process-state)
+ (setq article-series nil)
+ (setq has-been-begin nil)
+ (if (stringp result-file)
+ (setq files (list result-file))
+ (setq files result-file))
+ (setq result-file (car files))
+ (while files
+ (push (list (cons 'name (pop files))
+ (cons 'article article))
+ result-files))
+ ;; Allow user-defined functions to be run on this file.
+ (when gnus-uu-grabbed-file-functions
+ (let ((funcs gnus-uu-grabbed-file-functions))
+ (unless (listp funcs)
+ (setq funcs (list funcs)))
+ (while funcs
+ (funcall (pop funcs) result-file))))
+ (setq result-file nil)
+ ;; Check whether we have decoded enough articles.
+ (and limit (= (length result-files) limit)
+ (setq articles nil)))
+
+ ;; If this is the last article to be decoded, and
+ ;; we still haven't reached the end, then we delete
+ ;; the partially decoded file.
+ (and (or (eq state 'last) (eq state 'first-and-last))
+ (not (memq 'end process-state))
+ result-file
+ (file-exists-p result-file)
+ (not gnus-uu-be-dangerous)
+ (or (eq gnus-uu-be-dangerous t)
+ (gnus-y-or-n-p
+ (format "Delete incomplete file %s? " result-file)))
+ (delete-file result-file))
+
+ ;; If this was a file of the wrong sort, then
+ (when (and (or (memq 'wrong-type process-state)
+ (memq 'error process-state))
+ gnus-uu-unmark-articles-not-decoded)
+ (gnus-summary-tick-article article t))
+
+ ;; Set the new series state.
+ (if (and (not has-been-begin)
+ (not sloppy)
+ (or (memq 'end process-state)
+ (memq 'middle process-state)))
+ (progn
+ (setq process-state (list 'error))
+ (gnus-message 2 "No begin part at the beginning")
+ (sleep-for 2))
+ (setq state 'middle)))
+
+ ;; When there are no result-files, then something must be wrong.
+ (if result-files
+ (message "")
+ (cond
+ ((not has-been-begin)
+ (gnus-message 2 "Wrong type file"))
+ ((memq 'error process-state)
+ (gnus-message 2 "An error occurred during decoding"))
+ ((not (or (memq 'ok process-state)
+ (memq 'end process-state)))
+ (gnus-message 2 "End of articles reached before end of file")))
+ ;; Make unsuccessfully decoded articles unread.
+ (when gnus-uu-unmark-articles-not-decoded
+ (while article-series
+ (gnus-summary-tick-article (pop article-series) t)))))
result-files))
(defun gnus-uu-part-number (article)
(let* ((header (gnus-summary-article-header article))
- (subject (and header (mail-header-subject header))))
- (if (and subject
- (string-match "[0-9]+ */[0-9]+\\|[0-9]+ * of *[0-9]+" subject))
- (match-string 0 subject)
- "")))
+ (subject (and header (mail-header-subject header)))
+ (part nil))
+ (if subject
+ (while (string-match "[0-9]+/[0-9]+\\|[0-9]+[ \t]+of[ \t]+[0-9]+"
+ subject)
+ (setq part (match-string 0 subject))
+ (setq subject (substring subject (match-end 0)))))
+ (or part
+ (while (string-match "\\([0-9]+\\)[^0-9]+\\([0-9]+\\)" subject)
+ (setq part (match-string 0 subject))
+ (setq subject (substring subject (match-end 0)))))
+ (or part "")))
(defun gnus-uu-uudecode-sentinel (process event)
(delete-process (get-process process)))
;; We replace certain characters that could make things messy.
(setq gnus-uu-file-name
(let ((nnheader-file-name-translation-alist
- '((?/ . ?,) (? . ?_) (?* . ?_) (?$ . ?_))))
+ '((?/ . ?,) (? . ?_) (?* . ?_) (?$ . ?_))))
(nnheader-translate-file-chars (match-string 1))))
(replace-match (concat "begin 644 " gnus-uu-file-name) t t)
(setq gnus-uu-uudecode-process
(start-process
"*uudecode*"
- (get-buffer-create gnus-uu-output-buffer-name)
+ (gnus-get-buffer-create gnus-uu-output-buffer-name)
shell-file-name shell-command-switch
(format "cd %s %s uudecode" gnus-uu-work-dir
gnus-shell-command-separator))))
(setq start-char (point))
(call-process-region
start-char (point-max) shell-file-name nil
- (get-buffer-create gnus-uu-output-buffer-name) nil
+ (gnus-get-buffer-create gnus-uu-output-buffer-name) nil
shell-command-switch
(concat "cd " gnus-uu-work-dir " "
gnus-shell-command-separator " sh"))))
(setq command (format "cd %s ; %s" dir (gnus-uu-command action file-path)))
(save-excursion
- (set-buffer (get-buffer-create gnus-uu-output-buffer-name))
+ (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name))
(erase-buffer))
(gnus-message 5 "Unpacking: %s..." (gnus-uu-command action file-path))
(if (= 0 (call-process shell-file-name nil
- (get-buffer-create gnus-uu-output-buffer-name)
+ (gnus-get-buffer-create gnus-uu-output-buffer-name)
nil shell-command-switch command))
(message "")
(gnus-message 2 "Error during unpacking of archive")
(when (setq buf (get-buffer gnus-uu-output-buffer-name))
(kill-buffer buf))))
-(defun gnus-quote-arg-for-sh-or-csh (arg)
- (let ((pos 0) new-pos accum)
- ;; *** bug: we don't handle newline characters properly
- (while (setq new-pos (string-match "[!`\"$\\& \t{}]" arg pos))
- (push (substring arg pos new-pos) accum)
- (push "\\" accum)
- (push (list (aref arg new-pos)) accum)
- (setq pos (1+ new-pos)))
- (if (= pos 0)
- arg
- (apply 'concat (nconc (nreverse accum) (list (substring arg pos)))))))
-
;; Inputs an action and a filename and returns a full command, making sure
;; that the filename will be treated as a single argument when the shell
;; executes the command.
(defun gnus-uu-command (action file)
- (let ((quoted-file (gnus-quote-arg-for-sh-or-csh file)))
+ (let ((quoted-file (mm-quote-arg file)))
(if (string-match "%s" action)
(format action quoted-file)
(concat action " " quoted-file))))
(gnus-summary-post-news)
- (use-local-map (copy-keymap (current-local-map)))
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map (current-local-map))
+ (use-local-map map))
(local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done)
(local-set-key "\C-c\C-c" 'gnus-uu-post-news-inews)
(local-set-key "\C-c\C-s" 'gnus-uu-post-news-inews)
(unwind-protect
(if (save-excursion
(set-buffer (setq uubuf
- (get-buffer-create uuencode-buffer-name)))
+ (gnus-get-buffer-create uuencode-buffer-name)))
(erase-buffer)
(funcall gnus-uu-post-encode-method file-path file-name))
(insert-buffer-substring uubuf)
(top-string "[ cut here %s (%s %d/%d) %s gnus-uu ]")
(separator (concat mail-header-separator "\n\n"))
uubuf length parts header i end beg
- beg-line minlen buf post-buf whole-len beg-binary end-binary)
+ beg-line minlen post-buf whole-len beg-binary end-binary)
(setq post-buf (current-buffer))
(setq end-binary (point-max))
(save-excursion
- (set-buffer (setq uubuf (get-buffer-create encoded-buffer-name)))
+ (set-buffer (setq uubuf (gnus-get-buffer-create encoded-buffer-name)))
(erase-buffer)
(insert-buffer-substring post-buf beg-binary end-binary)
(goto-char (point-min))
(setq i 1)
(setq beg 1)
(while (not (> i parts))
- (set-buffer (get-buffer-create send-buffer-name))
+ (set-buffer (gnus-get-buffer-create send-buffer-name))
(erase-buffer)
(insert header)
(when (and threaded gnus-uu-post-message-id)