From d346bf7e6a987a3a8c51856aa7732d0da9a6ca95 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 5 Jun 2008 14:37:42 +0000 Subject: [PATCH] * gnus-util.el (gnus-read-shell-command): New function. * mm-decode.el (mm-pipe-part): * gnus-art.el (gnus-summary-save-in-pipe): Use it. --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-util.el | 15 +++++++++------ lisp/gnus/mm-decode.el | 3 ++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index e16b8613f1e..7f678b91b9e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2008-06-05 Stefan Monnier + + * gnus-util.el (gnus-read-shell-command): New function. + * mm-decode.el (mm-pipe-part): + * gnus-art.el (gnus-summary-save-in-pipe): Use it. + 2008-06-05 Katsumi Yamaoka * message.el (message-disassociate-draft): Revert 2008-03-18 change. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c6eeb1af61b..2dc95ea49f6 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3944,7 +3944,7 @@ The directory to save in defaults to `gnus-article-save-directory'." gnus-last-shell-command) ((stringp command) command) - (t (read-string + (t (gnus-read-shell-command (format "Shell command on %s: " (if (and gnus-number-of-articles-to-be-saved diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index a3275224e7f..88671693721 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -62,7 +62,7 @@ (eval-and-compile (cond ;; Prefer `replace-regexp-in-string' (present in Emacs, XEmacs 21.5, - ;; SXEmacs 22.1.4) over `replace-in-string'. The later leads to inf-loops + ;; SXEmacs 22.1.4) over `replace-in-string'. The lalter leads to inf-loops ;; on empty matches: ;; (replace-in-string "foo" "/*$" "/") ;; (replace-in-string "xe" "\\(x\\)?" "") @@ -957,10 +957,10 @@ If there's no subdirectory, delete DIRECTORY as well." (overlays-at pos))))))) ;;; Protected and atomic operations. dmoore@ucsd.edu 21.11.1996 -;;; The primary idea here is to try to protect internal datastructures -;;; from becoming corrupted when the user hits C-g, or if a hook or -;;; similar blows up. Often in Gnus multiple tables/lists need to be -;;; updated at the same time, or information can be lost. +;; The primary idea here is to try to protect internal datastructures +;; from becoming corrupted when the user hits C-g, or if a hook or +;; similar blows up. Often in Gnus multiple tables/lists need to be +;; updated at the same time, or information can be lost. (defvar gnus-atomic-be-safe t "If t, certain operations will be protected from interruption by C-g.") @@ -979,7 +979,7 @@ variables and then do only the assignment atomically." (put 'gnus-atomic-progn 'lisp-indent-function 0) (defmacro gnus-atomic-progn-assign (protect &rest forms) - "Evaluate FORMS, but insure that the variables listed in PROTECT + "Evaluate FORMS, but ensure that the variables listed in PROTECT are not changed if anything in FORMS signals an error or otherwise non-locally exits. The variables listed in PROTECT are updated atomically. It is safe to use gnus-atomic-progn-assign with long computations. @@ -1798,6 +1798,9 @@ is allowed once again. (Immediately, if `inhibit-quit' is nil.)" ;; that intends to handle the quit signal next time. (eval '(ignore nil)))))) +(defalias 'gnus-read-shell-command + (if (fboundp 'read-shell-command) 'read-shell-command 'read-string)) + (provide 'gnus-util) ;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49 diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index f9d8311c0c1..6ee254ac03e 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1295,7 +1295,8 @@ text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+?\\)\\)?[\"'][^>]*>" nil t) "Pipe HANDLE to a process." (let* ((name (mail-content-type-get (mm-handle-type handle) 'name)) (command - (read-string "Shell command on MIME part: " mm-last-shell-command))) + (gnus-read-shell-command + "Shell command on MIME part: " mm-last-shell-command))) (mm-with-unibyte-buffer (mm-insert-part handle) (mm-add-meta-html-tag handle) -- 2.11.4.GIT