Merge from gnus--rel--5.10
authorMiles Bader <miles@gnu.org>
Mon, 27 Nov 2006 00:39:24 +0000 (00:39 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 27 Nov 2006 00:39:24 +0000 (00:39 +0000)
Patches applied:

 * emacs--devo--0  (patch 504, 507, 515, 518, 524, 527)

   - Merge from gnus--rel--5.10
   - Update from CVS

 * gnus--rel--5.10  (patch 169)

   - Merge from emacs--devo--0

2006-11-24  Eli Zaretskii  <eliz@gnu.org>

   * contrib/smtpmail.el (smtpmail-send-it):
   Copy buffer-file-coding-system from the mail buffer.  Possibly add a
   MIME header for the message encoding.
   Bind coding-system-for-write around the call to mail-do-fcc.
   Use smtpmail-code-conv-from to encode queued mail messages.

2006-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>

   * lisp/pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of
   strings to a single string.  Quote `errors-file-name'.
   (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region, pgg-pgp-sign-region)
   (pgg-pgp-verify-region, pgg-pgp-insert-key, pgg-pgp-snarf-keys-region):
   Adjust calls.  Use `shell-quote-argument'.

2006-11-24  Juanma Barranquero  <lekktu@gmail.com>

   * lisp/gnus-agent.el (gnus-agent-expire-unagentized-dirs)
   (gnus-agent-regenerate-group): Fix space/tab mixup in messages.

   * lisp/gnus-art.el (gnus-article-x-face-command, gnus-numeric-save-name):
   * lisp/gnus-group.el (gnus-group-sort-function, gnus-group-line-format)
   (gnus-group-mode, gnus-group-read-group, gnus-group-delete-group)
   (gnus-group-make-directory-group, gnus-group-transpose-groups):
   * lisp/gnus-start.el (gnus-options-subscribe, gnus-options-not-subscribe)
   (gnus-subscribe-newsgroup, gnus-1):
   * lisp/gnus-sum.el (gnus-summary-make-false-root, gnus-make-threads):
   * lisp/gnus.el (gnus-nntp-server, gnus-use-cross-reference)
   (gnus-valid-select-methods, total-expire, gnus-summary-line-format)
   (gnus-group-read-only-p): Fix space/tab mixup in docstrings.

Revision: emacs@sv.gnu.org/gnus--devo--0--patch-243

contrib/ChangeLog
contrib/smtpmail.el
lisp/ChangeLog
lisp/gnus-agent.el
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-start.el
lisp/gnus-sum.el
lisp/gnus.el
lisp/pgg-pgp.el

index fe23bad..3689fdf 100644 (file)
@@ -1,11 +1,19 @@
+2006-11-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * smtpmail.el (smtpmail-send-it):
+       Copy buffer-file-coding-system from the mail buffer.  Possibly add a
+       MIME header for the message encoding.
+       Bind coding-system-for-write around the call to mail-do-fcc.
+       Use smtpmail-code-conv-from to encode queued mail messages.
+
 2006-10-02  MIYOSHI Masanori <miyoshi@meadowy.org>  (tiny change)
 
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Fix typo in
+       * smtpmail.el (smtpmail-try-auth-methods): Fix typo in
        2006-09-28 commit.
 
 2006-09-28  Osamu Yamane  <yamane@green.ocn.ne.jp> (tiny change)
 
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Do not break long
+       * smtpmail.el (smtpmail-try-auth-methods): Do not break long
        lines in base64-encoded authentication response.
 
 2006-09-04  Chong Yidong  <cyd@stupidchicken.com>
index ac87a93..271c7a7 100644 (file)
@@ -244,6 +244,11 @@ This is relative to `smtpmail-queue-dir'.")
        (save-excursion
          (set-buffer tembuf)
          (erase-buffer)
+         ;; Use the same buffer-file-coding-system as in the mail
+         ;; buffer, otherwise any write-region invocations (e.g., in
+         ;; mail-do-fcc below) will annoy with asking for a suitable
+         ;; encoding.
+         (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
          (insert-buffer-substring mailbuf)
          (goto-char (point-max))
          ;; require one newline at the end.
@@ -326,6 +331,22 @@ This is relative to `smtpmail-queue-dir'.")
            (goto-char (point-min))
            (unless (re-search-forward "^Date:" delimline t)
              (insert "Date: " (message-make-date) "\n"))
+           ;; Possibly add a MIME header for the current coding system
+           (let (charset)
+             (goto-char (point-min))
+             (and (eq mail-send-nonascii 'mime)
+                  (not (re-search-forward "^MIME-version:" delimline t))
+                  (progn (skip-chars-forward "\0-\177")
+                         (/= (point) (point-max)))
+                  smtpmail-code-conv-from
+                  (setq charset
+                        (coding-system-get smtpmail-code-conv-from
+                                           'mime-charset))
+                  (goto-char delimline)
+                  (insert "MIME-version: 1.0\n"
+                          "Content-type: text/plain; charset="
+                          (symbol-name charset)
+                          "\nContent-Transfer-Encoding: 8bit\n")))
            ;; Insert an extra newline if we need it to work around
            ;; Sun's bug that swallows newlines.
            (goto-char (1+ delimline))
@@ -334,7 +355,10 @@ This is relative to `smtpmail-queue-dir'.")
            ;; Find and handle any FCC fields.
            (goto-char (point-min))
            (if (re-search-forward "^FCC:" delimline t)
-               (mail-do-fcc delimline))
+               ;; Force mail-do-fcc to use the encoding of the mail
+               ;; buffer to encode outgoing messages on FCC files.
+               (let ((coding-system-for-write smtpmail-code-conv-from))
+                 (mail-do-fcc delimline)))
            (if mail-interactive
                (with-current-buffer errbuf
                  (erase-buffer))))
@@ -370,6 +394,7 @@ This is relative to `smtpmail-queue-dir'.")
                (make-directory smtpmail-queue-dir t))
              (with-current-buffer buffer-data
                (erase-buffer)
+               (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
                (insert-buffer-substring tembuf)
                (write-file file-data)
                (set-buffer buffer-elisp)
index dfc6442..0237307 100644 (file)
@@ -1,3 +1,27 @@
+2006-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of
+       strings to a single string.  Quote `errors-file-name'.
+       (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region, pgg-pgp-sign-region)
+       (pgg-pgp-verify-region, pgg-pgp-insert-key, pgg-pgp-snarf-keys-region):
+       Adjust calls.  Use `shell-quote-argument'.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * gnus-agent.el (gnus-agent-expire-unagentized-dirs)
+       (gnus-agent-regenerate-group): Fix space/tab mixup in messages.
+
+       * gnus-art.el (gnus-article-x-face-command, gnus-numeric-save-name):
+       * gnus-group.el (gnus-group-sort-function, gnus-group-line-format)
+       (gnus-group-mode, gnus-group-read-group, gnus-group-delete-group)
+       (gnus-group-make-directory-group, gnus-group-transpose-groups):
+       * gnus-start.el (gnus-options-subscribe, gnus-options-not-subscribe)
+       (gnus-subscribe-newsgroup, gnus-1):
+       * gnus-sum.el (gnus-summary-make-false-root, gnus-make-threads):
+       * gnus.el (gnus-nntp-server, gnus-use-cross-reference)
+       (gnus-valid-select-methods, total-expire, gnus-summary-line-format)
+       (gnus-group-read-only-p): Fix space/tab mixup in docstrings.
+
 2006-11-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-sum.el (gnus-summary-limit-to-headers): New command and
@@ -9784,6 +9808,7 @@ See ChangeLog.2 for earlier changes.
 ;; Local Variables:
 ;; coding: iso-2022-7bit
 ;; fill-column: 79
+;; add-log-time-zone-rule: t
 ;; End:
 
 ;;; arch-tag: 3f33a3e7-090d-492b-bedd-02a1417d32b4
index 5224b6a..309596e 100644 (file)
@@ -13,7 +13,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -1191,7 +1191,7 @@ downloadable."
             ;; For each article that I processed that is no longer
             ;; undownloaded, remove its processable mark.
 
-           (mapc #'gnus-summary-remove-process-mark 
+           (mapc #'gnus-summary-remove-process-mark
                  (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
 
             ;; The preceeding call to (gnus-agent-summary-fetch-group)
@@ -2059,11 +2059,11 @@ doesn't exist, to valid the overview buffer."
                   ;; First, we'll fix the sort.
                   (sort-numeric-fields 1 (point-min) (point-max))
 
-                  ;; but now we have to consider that we may have duplicate rows...      
+                  ;; but now we have to consider that we may have duplicate rows...
                   ;; so reset to beginning of file
                   (goto-char (point-min))
                   (setq last -134217728)
-         
+
                   ;; and throw a code that restarts this scan
                   (throw 'problems t))
                 nil))))))
@@ -3608,7 +3608,7 @@ articles in every agentized group? "))
                    (or gnus-expert-user
                        (gnus-y-or-n-p
                         "gnus-agent-expire has identified local directories that are\
- not currently required by any agentized group.         Do you wish to consider\
+ not currently required by any agentized group.  Do you wish to consider\
  deleting them?")))
           (while to-remove
             (let ((dir (pop to-remove)))
@@ -3896,7 +3896,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
           (dir (file-name-directory file))
           point
           (downloaded (if (file-exists-p dir)
-                          (sort (delq nil (mapcar (lambda (name) 
+                          (sort (delq nil (mapcar (lambda (name)
                                                     (and (not (file-directory-p (nnheader-concat dir name)))
                                                          (string-to-number name)))
                                                   (directory-files dir nil "^[0-9]+$" t)))
@@ -4063,8 +4063,8 @@ If REREAD is not nil, downloaded articles are marked as unread."
              (gnus-agent-possibly-alter-active group group-active)))))
 
       (when (and reread gnus-agent-article-alist)
-       (gnus-agent-synchronize-group-flags 
-        group 
+       (gnus-agent-synchronize-group-flags
+        group
         (list (list
                (if (listp reread)
                    reread
index dcded1c..7ef6cec 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -275,7 +275,7 @@ This can also be a list of the above values."
 display -"))
   "*String or function to be executed to display an X-Face header.
 If it is a string, the command will be executed in a sub-shell
-asynchronously.         The compressed face will be piped to this command."
+asynchronously.  The compressed face will be piped to this command."
   :type `(choice string
                 (function-item gnus-display-x-face-in-from)
                 function)
@@ -3848,7 +3848,7 @@ Otherwise, it is like ~/News/news/group/num."
 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
   "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
 If variable `gnus-use-long-file-name' is non-nil, it is
-~/News/news.group/num. Otherwise, it is like ~/News/news/group/num."
+~/News/news.group/num.  Otherwise, it is like ~/News/news/group/num."
   (let ((default
          (expand-file-name
           (concat (if (gnus-use-long-file-name 'not-save)
index 03ec48a..561abc8 100644 (file)
@@ -135,7 +135,7 @@ for the groups to be sorted.  Pre-made functions include
 `gnus-group-sort-by-score', `gnus-group-sort-by-method',
 `gnus-group-sort-by-server', and `gnus-group-sort-by-rank'.
 
-This variable can also be a list of sorting functions. In that case,
+This variable can also be a list of sorting functions.  In that case,
 the most significant sort function should be the last function in the
 list."
   :group 'gnus-group-listing
@@ -197,7 +197,7 @@ with some simple extensions.
 
 Note that this format specification is not always respected.  For
 reasons of efficiency, when listing killed groups, this specification
-is ignored altogether. If the spec is changed considerably, your
+is ignored altogether.  If the spec is changed considerably, your
 output may end up looking strange when listing both alive and killed
 groups.
 
@@ -1131,7 +1131,7 @@ When FORCE, rebuild the tool bar."
 
 All normal editing commands are switched off.
 \\<gnus-group-mode-map>
-The group buffer lists (some of) the groups available. For instance,
+The group buffer lists (some of) the groups available.  For instance,
 `\\[gnus-group-list-groups]' will list all subscribed groups with unread articles, while `\\[gnus-group-list-zombies]'
 lists all zombie groups.
 
@@ -2028,7 +2028,7 @@ and with point over the group in question."
 If the prefix argument ALL is non-nil, already read articles become
 readable.  IF ALL is a number, fetch this number of articles.  If the
 optional argument NO-ARTICLE is non-nil, no article will be
-auto-selected upon group entry.         If GROUP is non-nil, fetch that
+auto-selected upon group entry.  If GROUP is non-nil, fetch that
 group."
   (interactive "P")
   (let ((no-display (eq all 0))
@@ -2898,7 +2898,7 @@ Given a prefix, create a full group."
 (defun gnus-group-make-directory-group (dir)
   "Create an nndir group.
 The user will be prompted for a directory.  The contents of this
-directory will be used as a newsgroup. The directory should contain
+directory will be used as a newsgroup.  The directory should contain
 mail messages or news articles in files that have numeric names."
   (interactive
    (list (read-file-name "Create group from directory: ")))
@@ -3570,7 +3570,7 @@ group line."
 
 (defun gnus-group-transpose-groups (n)
   "Move the current newsgroup up N places.
-If given a negative prefix, move down instead. The difference between
+If given a negative prefix, move down instead.  The difference between
 N and the number of steps taken is returned."
   (interactive "p")
   (unless (gnus-group-group-name)
@@ -4283,7 +4283,7 @@ and the second element is the address."
        (unless entry
          (error "Trying to change non-existent group %s" method-only-group))
        ;; We have received parts of the actual group info - either the
-       ;; select method or the group parameters.        We first check
+       ;; select method or the group parameters.  We first check
        ;; whether we have to extend the info, and if so, do that.
        (let ((len (length info))
              (total (if (eq part 'method) 5 6)))
index 7bc9c2b..cd3c21d 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -352,7 +352,7 @@ be subscribed using `gnus-subscribe-options-newsgroup-method'."
 
 (defcustom gnus-options-subscribe nil
   "*All new groups matching this regexp will be subscribed unconditionally.
-Note that this variable deals only with new newsgroups.         This variable
+Note that this variable deals only with new newsgroups.  This variable
 does not affect old newsgroups.
 
 New groups that match this regexp will not be handled by
@@ -364,7 +364,7 @@ be subscribed using `gnus-subscribe-options-newsgroup-method'."
 
 (defcustom gnus-options-not-subscribe nil
   "*All new groups matching this regexp will be ignored.
-Note that this variable deals only with new newsgroups.         This variable
+Note that this variable deals only with new newsgroups.  This variable
 does not affect old (already subscribed) newsgroups."
   :group 'gnus-group-new
   :type '(choice regexp
@@ -626,7 +626,7 @@ it is killed."
 
 (defun gnus-subscribe-newsgroup (newsgroup &optional next)
   "Subscribe new NEWSGROUP.
-If NEXT is non-nil, it is inserted before NEXT.         Otherwise it is made
+If NEXT is non-nil, it is inserted before NEXT.  Otherwise it is made
 the first newsgroup."
   (save-excursion
     (goto-char (point-min))
@@ -737,7 +737,7 @@ will not connect to the local server."
 (defun gnus-1 (&optional arg dont-connect slave)
   "Read network news.
 If ARG is non-nil and a positive number, Gnus will use that as the
-startup level. If ARG is non-nil and not a positive number, Gnus will
+startup level.  If ARG is non-nil and not a positive number, Gnus will
 prompt the user for the name of an NNTP server to use."
   (interactive "P")
 
index 92ba3b6..f218fe3 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -114,7 +114,7 @@ have all the sub-threads as children.
 If this variable is `adopt', Gnus will make one of the \"children\"
 the parent and mark all the step-children as such.
 If this variable is `empty', the \"children\" are printed with empty
-subject fields.         (Or rather, they will be printed with a string
+subject fields.  (Or rather, they will be printed with a string
 given by the `gnus-summary-same-subject' variable.)"
   :group 'gnus-thread
   :type '(choice (const :tag "off" nil)
@@ -4078,7 +4078,7 @@ If NO-DISPLAY, don't generate a summary buffer."
     infloop))
 
 (defun gnus-make-threads ()
-  "Go through the dependency hashtb and find the roots.         Return all threads."
+  "Go through the dependency hashtb and find the roots.  Return all threads."
   (let (threads)
     (while (catch 'infloop
             (mapatoms
@@ -4582,7 +4582,7 @@ If LINE, insert the rebuilt thread starting on line LINE."
     ;; First go up in this thread until we find the root.
     (setq last-id (gnus-root-id id)
          headers (message-flatten-list (gnus-id-to-thread last-id)))
-    ;; We have now found the real root of this thread. It might have
+    ;; We have now found the real root of this thread.  It might have
     ;; been gathered into some loose thread, so we have to search
     ;; through the threads to find the thread we wanted.
     (let ((threads gnus-newsgroup-threads)
@@ -6047,7 +6047,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
       (let ((case-fold-search t)
            in-reply-to header p lines chars)
        (goto-char (point-min))
-       ;; Search to the beginning of the next header.  Error messages
+       ;; Search to the beginning of the next header.  Error messages
        ;; do not begin with 2 or 3.
        (while (re-search-forward "^[23][0-9]+ " nil t)
          (setq id nil
@@ -6055,7 +6055,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
          ;; This implementation of this function, with nine
          ;; search-forwards instead of the one re-search-forward and
          ;; a case (which basically was the old function) is actually
-         ;; about twice as fast, even though it looks messier.  You
+         ;; about twice as fast, even though it looks messier.  You
          ;; can't have everything, I guess.  Speed and elegance
          ;; doesn't always go hand in hand.
          (setq
index 0bb4465..80a7413 100644 (file)
@@ -16,7 +16,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -1331,7 +1331,7 @@ non-numeric prefix - `C-u M-x gnus', in short."
 
 (defcustom gnus-nntp-server nil
   "*The name of the host running the NNTP server.
-This variable is semi-obsolete.         Use the `gnus-select-method'
+This variable is semi-obsolete.  Use the `gnus-select-method'
 variable instead."
   :group 'gnus-server
   :type '(choice (const :tag "disable" nil)
@@ -1474,7 +1474,7 @@ group."
 (defcustom gnus-use-cross-reference t
   "*Non-nil means that cross referenced articles will be marked as read.
 If nil, ignore cross references.  If t, mark articles as read in
-subscribed newsgroups. If neither t nor nil, mark as read in all
+subscribed newsgroups.  If neither t nor nil, mark as read in all
 newsgroups."
   :group 'gnus-server
   :type '(choice (const :tag "off" nil)
@@ -1688,7 +1688,7 @@ of the select method.  The other elements may be the category of
 this method (i. e., `post', `mail', `none' or whatever) or other
 properties that this method has (like being respoolable).
 If you implement a new select method, all you should have to change is
-this variable. I think."
+this variable.  I think."
   :group 'gnus-server
   :type '(repeat (group (string :tag "Name")
                        (radio-button-choice (const :format "%v " post)
@@ -1842,7 +1842,7 @@ which to perform auto-expiry.  This only makes sense for mail groups."
  "*Groups in which to perform expiry of all read articles.
 Use with extreme caution.  All groups that match this regexp will be
 expiring - which means that all read articles will be deleted after
-\(say) one week.        (This only goes for mail groups and the like, of
+\(say) one week.  (This only goes for mail groups and the like, of
 course.)"
  :variable-group nnmail-expire
  :variable-type '(choice (const nil)
@@ -3032,7 +3032,7 @@ with some simple extensions.
 The %U (status), %R (replied) and %z (zcore) specs have to be handled
 with care.  For reasons of efficiency, Gnus will compute what column
 these characters will end up in, and \"hard-code\" that.  This means that
-it is invalid to have these specs after a variable-length spec.         Well,
+it is invalid to have these specs after a variable-length spec.  Well,
 you might not be arrested, but your summary buffer will look strange,
 which is bad enough.
 
@@ -3415,7 +3415,7 @@ GROUP can either be a string (a group name) or a select method."
 
 (defun gnus-group-read-only-p (&optional group)
   "Check whether GROUP supports editing or not.
-If GROUP is nil, `gnus-newsgroup-name' will be checked instead.         Note
+If GROUP is nil, `gnus-newsgroup-name' will be checked instead.  Note
 that that variable is buffer-local to the summary buffers."
   (let ((group (or group gnus-newsgroup-name)))
     (not (gnus-check-backend-function 'request-replace-article group))))
@@ -4087,7 +4087,7 @@ If NEWSGROUP is nil, return the global kill file name instead."
     (not method)))
 
 (defun gnus-server-extend-method (group method)
-  ;; This function "extends" a virtual server. If the server is
+  ;; This function "extends" a virtual server.  If the server is
   ;; "hello", and the select method is ("hello" (my-var "something"))
   ;; in the group "alt.alt", this will result in a new virtual server
   ;; called "hello+alt.alt".
index e53a0c2..aa0cfcf 100644 (file)
@@ -63,9 +63,9 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
 (defun pgg-pgp-process-region (start end passphrase program args)
   (let* ((errors-file-name (pgg-make-temp-file "pgg-errors"))
         (args
-         (append args
+         (concat args
                  pgg-pgp-extra-args
-                 (list (concat "2>" errors-file-name))))
+                  " 2>" (shell-quote-argument errors-file-name)))
         (shell-file-name pgg-pgp-shell-file-name)
         (shell-command-switch pgg-pgp-shell-command-switch)
         (process-environment process-environment)
@@ -83,9 +83,8 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
          (let ((coding-system-for-read 'binary)
                (coding-system-for-write 'binary))
            (setq process
-                 (apply #'funcall
-                        #'start-process-shell-command "*PGP*" output-buffer
-                        program args)))
+                 (start-process-shell-command "*PGP*" output-buffer
+                                               (concat program " " args))))
          (set-process-sentinel process #'ignore)
          (when passphrase
            (process-send-string process (concat passphrase "\n")))
@@ -142,15 +141,14 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
                                    pgg-pgp-user-id)
                            pgg-pgp-user-id))))
         (args
-         (append
-          `("+encrypttoself=off +verbose=1" "+batchmode"
-            "+language=us" "-fate"
-            ,@(if recipients
-                  (mapcar (lambda (rcpt) (concat "\"" rcpt "\""))
-                          (append recipients
-                                  (if pgg-encrypt-for-me
-                                      (list pgg-pgp-user-id))))))
-          (if sign '("-s" "-u" pgg-pgp-user-id)))))
+         (concat
+          "+encrypttoself=off +verbose=1 +batchmode +language=us -fate "
+           (if recipients
+               (mapconcat 'shell-quote-argument
+                          (append recipients
+                                  (if pgg-encrypt-for-me
+                                      (list pgg-pgp-user-id)))))
+           (if sign (concat " -s -u " (shell-quote-argument pgg-pgp-user-id))))))
     (pgg-pgp-process-region start end nil pgg-pgp-program args)
     (pgg-process-when-success nil)))
 
@@ -166,7 +164,7 @@ passphrase cache or user."
              (pgg-read-passphrase
               (format "PGP passphrase for %s: " pgg-pgp-user-id) key)))
         (args
-         '("+verbose=1" "+batchmode" "+language=us" "-f")))
+         "+verbose=1 +batchmode +language=us -f"))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
     (pgg-process-when-success
       (if pgg-cache-passphrase
@@ -184,9 +182,9 @@ passphrase cache or user."
               (format "PGP passphrase for %s: " pgg-pgp-user-id)
               (pgg-pgp-lookup-key pgg-pgp-user-id 'sign))))
         (args
-         (list (if clearsign "-fast" "-fbast")
-               "+verbose=1" "+language=us" "+batchmode"
-               "-u" pgg-pgp-user-id)))
+         (concat (if clearsign "-fast" "-fbast")
+               " +verbose=1 +language=us +batchmode"
+               " -u " (shell-quote-argument pgg-pgp-user-id))))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
     (pgg-process-when-success
       (goto-char (point-min))
@@ -204,7 +202,7 @@ passphrase cache or user."
 (defun pgg-pgp-verify-region (start end &optional signature)
   "Verify region between START and END as the detached signature SIGNATURE."
   (let* ((orig-file (pgg-make-temp-file "pgg"))
-        (args '("+verbose=1" "+batchmode" "+language=us"))
+        (args "+verbose=1 +batchmode +language=us")
         (orig-mode (default-file-modes)))
     (unwind-protect
        (progn
@@ -216,8 +214,8 @@ passphrase cache or user."
     (if (stringp signature)
        (progn
          (copy-file signature (setq signature (concat orig-file ".asc")))
-         (setq args (append args (list signature orig-file))))
-      (setq args (append args (list orig-file))))
+         (setq args (concat args " " (shell-quote-argument signature)))))
+    (setq args (concat args " " (shell-quote-argument orig-file)))
     (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args)
     (delete-file orig-file)
     (if signature (delete-file signature))
@@ -237,8 +235,8 @@ passphrase cache or user."
   "Insert public key at point."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
         (args
-         (list "+verbose=1" "+batchmode" "+language=us" "-kxaf"
-               (concat "\"" pgg-pgp-user-id "\""))))
+         (concat "+verbose=1 +batchmode +language=us -kxaf "
+                  (shell-quote-argument pgg-pgp-user-id))))
     (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args)
     (insert-buffer-substring pgg-output-buffer)))
 
@@ -247,8 +245,8 @@ passphrase cache or user."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
         (key-file (pgg-make-temp-file "pgg"))
         (args
-         (list "+verbose=1" "+batchmode" "+language=us" "-kaf"
-               key-file)))
+         (concat "+verbose=1 +batchmode +language=us -kaf "
+                  (shell-quote-argument key-file))))
     (let ((coding-system-for-write 'raw-text-dos))
       (write-region start end key-file))
     (pgg-pgp-process-region start end nil pgg-pgp-program args)
@@ -257,5 +255,5 @@ passphrase cache or user."
 
 (provide 'pgg-pgp)
 
-;;; arch-tag: 076b7801-37b2-49a6-97c3-218fdecde33c
+;; arch-tag: 076b7801-37b2-49a6-97c3-218fdecde33c
 ;;; pgg-pgp.el ends here