X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fpgg-pgp5.el;h=c18671ff11d962fdaabc5e8f95f0b5d779453640;hb=2cd3c854340f702bc7f6526c8439e7311dcfc7a3;hp=9624836dcd08cd507d2b43d252eba9e641713dac;hpb=4561b7af638f16343fbfef6a8227c498be6d6cc5;p=gnus diff --git a/lisp/pgg-pgp5.el b/lisp/pgg-pgp5.el index 9624836dc..c18671ff1 100644 --- a/lisp/pgg-pgp5.el +++ b/lisp/pgg-pgp5.el @@ -1,22 +1,22 @@ ;;; pgg-pgp5.el --- PGP 5.* support for PGG. -;; Copyright (C) 1999,2000 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Created: 1999/11/02 ;; Keywords: PGP, OpenPGP -;; This file is part of SEMI (Secure Emacs MIME Interface). +;; This file is part of GNU Emacs. -;; This program 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 2, or (at -;; your option) any later version. +;; 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 2, or (at your option) +;; any later version. -;; This program 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 GNU -;; General Public License for more details. +;; 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 +;; 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 @@ -25,7 +25,9 @@ ;;; Code: -(eval-when-compile (require 'pgg)) +(eval-when-compile + (require 'cl) ; for pgg macros + (require 'pgg)) (defgroup pgg-pgp5 () "PGP 5.* interface" @@ -65,15 +67,15 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (defcustom pgg-pgp5-extra-args nil "Extra arguments for every PGP 5.* invocation." :group 'pgg-pgp5 - :type 'string) + :type '(choice + (const :tag "None" nil) + (string :tag "Arguments"))) (defvar pgg-pgp5-user-id nil "PGP 5.* ID of your default identity.") (defun pgg-pgp5-process-region (start end passphrase program args) - (let* ((errors-file-name - (expand-file-name (make-temp-name "pgg-errors") - pgg-temporary-file-directory)) + (let* ((errors-file-name (pgg-make-temp-file "pgg-errors")) (args (append args pgg-pgp5-extra-args @@ -194,10 +196,9 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (defun pgg-pgp5-verify-region (start end &optional signature) "Verify region between START and END as the detached signature SIGNATURE." - (let* ((basename (expand-file-name "pgg" pgg-temporary-file-directory)) - (orig-file (make-temp-name basename)) - (args '("+verbose=1" "+batchmode=1" "+language=us")) - (orig-mode (default-file-modes))) + (let ((orig-file (pgg-make-temp-file "pgg")) + (args '("+verbose=1" "+batchmode=1" "+language=us")) + (orig-mode (default-file-modes))) (unwind-protect (progn (set-default-file-modes 448) @@ -232,8 +233,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (defun pgg-pgp5-snarf-keys-region (start end) "Add all public keys in region between START and END to the keyring." (let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id)) - (basename (expand-file-name "pgg" pgg-temporary-file-directory)) - (key-file (make-temp-name basename)) + (key-file (pgg-make-temp-file "pgg")) (args (list "+verbose=1" "+batchmode=1" "+language=us" "-a" key-file)))