Don't call turn_on_atimers around `connect' (Bug#5723).
[bpt/emacs.git] / lisp / pgg.el
index 3de9b5e..7364d37 100644 (file)
@@ -1,7 +1,7 @@
 ;;; pgg.el --- glue for the various PGP implementations.
 
 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Symmetric encryption added by: Sascha Wilde <wilde@sha-bang.de>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
+;; This file is on its way to obsolescence, waiting for allout.el to
+;; switch to EPG.
+
 ;;; Code:
 
 (require 'pgg-def)
@@ -129,7 +130,7 @@ or `cancel-timer'."
 (put 'pgg-save-coding-system 'lisp-indent-function 2)
 
 (defmacro pgg-save-coding-system (start end &rest body)
-  `(if (interactive-p)
+  `(if (called-interactively-p 'interactive)
        (let ((buffer (current-buffer)))
         (with-temp-buffer
           (let (buffer-undo-list)
@@ -323,7 +324,7 @@ passphrase cache or user."
         (pgg-save-coding-system start end
           (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme)
                       (point-min) (point-max) rcpts sign passphrase))))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -339,7 +340,7 @@ cache or user."
           (pgg-invoke "encrypt-symmetric-region"
                       (or pgg-scheme pgg-default-scheme)
                       (point-min) (point-max) passphrase))))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -356,7 +357,7 @@ passphrase cache or user."
   (let* ((start (or start (point-min)))
         (end (or end (point-max)))
         (status (pgg-encrypt-symmetric-region start end passphrase)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -375,7 +376,7 @@ passphrase cache or user."
   (let* ((start (or start (point-min)))
         (end (or end (point-max)))
         (status (pgg-encrypt-region start end rcpts sign passphrase)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -391,7 +392,7 @@ passphrase cache or user."
          (pgg-save-coding-system start end
            (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme)
                        (point-min) (point-max) passphrase))))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -408,7 +409,7 @@ passphrase cache or user."
   (let* ((start (or start (point-min)))
         (end (or end (point-max)))
         (status (pgg-decrypt-region start end passphrase)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -428,9 +429,10 @@ passphrase cache or user."
   (let ((status (pgg-save-coding-system start end
                  (pgg-invoke "sign-region" (or pgg-scheme pgg-default-scheme)
                              (point-min) (point-max)
-                             (or (interactive-p) cleartext)
+                             (or (called-interactively-p 'interactive)
+                                 cleartext)
                               passphrase))))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -453,9 +455,10 @@ passphrase cache or user."
   (let* ((start (or start (point-min)))
         (end (or end (point-max)))
         (status (pgg-sign-region start end
-                                  (or (interactive-p) cleartext)
+                                  (or (called-interactively-p 'interactive)
+                                     cleartext)
                                   passphrase)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (pgg-display-output-buffer start end status))
     status))
 
@@ -483,7 +486,7 @@ signer's public key from `pgg-default-keyserver-address'."
         pgg-query-keyserver
         (setq key (concat "0x" (pgg-truncate-key-identifier key)))
         (null (pgg-lookup-key key))
-        (or fetch (interactive-p))
+        (or fetch (called-interactively-p 'interactive))
         (y-or-n-p (format "Key %s not found; attempt to fetch? " key))
         (setq keyserver
               (or (cdr (assq 'preferred-key-server packet))
@@ -493,7 +496,7 @@ signer's public key from `pgg-default-keyserver-address'."
          (pgg-save-coding-system start end
            (pgg-invoke "verify-region" (or pgg-scheme pgg-default-scheme)
                        (point-min) (point-max) signature)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (let ((temp-buffer-show-function
             (function pgg-temp-buffer-show-function)))
        (with-output-to-temp-buffer pgg-echo-buffer
@@ -515,7 +518,7 @@ within the region."
   (let* ((start (or start (point-min)))
         (end (or end (point-max)))
         (status (pgg-verify-region start end signature fetch)))
-    (when (interactive-p)
+    (when (called-interactively-p 'interactive)
       (let ((temp-buffer-show-function
             (function pgg-temp-buffer-show-function)))
        (with-output-to-temp-buffer pgg-echo-buffer
@@ -599,5 +602,5 @@ within the region."
 
 (provide 'pgg)
 
-;;; arch-tag: 9cc705dd-1e6a-4c90-8dce-c3561f9a2cf4
+;; arch-tag: 9cc705dd-1e6a-4c90-8dce-c3561f9a2cf4
 ;;; pgg.el ends here