* mel-q.el (quoted-printable-external-decoder-option-to-specify-file):
[elisp/flim.git] / mel-b-el.el
index f8a13ef..eac60b5 100644 (file)
@@ -50,7 +50,8 @@
   :type '(cons (file :tag "Command")(repeat :tag "Arguments" string)))
 
 (defcustom base64-external-decoder-option-to-specify-file '("-o")
-  "*list of options of base64 decoder program to specify file."
+  "*list of options of base64 decoder program to specify file.
+If the base64 decoder program does not have such option, set this as nil."
   :group 'base64
   :type '(repeat :tag "Arguments" string))
 
@@ -368,13 +369,22 @@ START and END are buffer positions."
   (interactive "*r\nFWrite decoded region to file: ")
   (if (and base64-internal-decoding-limit
           (> (- end start) base64-internal-decoding-limit))
-      (as-binary-process
-       (apply (function call-process-region)
-             start end (car base64-external-decoder)
-             nil nil nil
-             (append (cdr base64-external-decoder)
-                     base64-external-decoder-option-to-specify-file
-                     (list filename))))
+      (progn
+       (as-binary-process
+        (apply (function call-process-region)
+               start end (car base64-external-decoder)
+               (null base64-external-decoder-option-to-specify-file)
+               (unless base64-external-decoder-option-to-specify-file
+                 (list (current-buffer) nil))
+               nil
+               (delq nil
+                     (append
+                      (cdr base64-external-decoder)
+                      base64-external-decoder-option-to-specify-file
+                      (when base64-external-decoder-option-to-specify-file
+                        (list filename))))))
+       (unless base64-external-decoder-option-to-specify-file
+         (write-region-as-binary (point-min) (point-max) filename)))
     (let ((str (buffer-substring start end)))
       (with-temp-buffer
        (insert (base64-internal-decode-string str))