;;; 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)
(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)
(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))
(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))
(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))
(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))
(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))
(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))
(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))
(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))
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))
(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
(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
(provide 'pgg)
-;;; arch-tag: 9cc705dd-1e6a-4c90-8dce-c3561f9a2cf4
+;; arch-tag: 9cc705dd-1e6a-4c90-8dce-c3561f9a2cf4
;;; pgg.el ends here