X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=contrib%2Fgpg.el;h=b96762885f751957c6c40646ac8cc7777f8e4f59;hb=e838d259405e34d4598d1e9b99350258cf80988e;hp=09e1d59f6d35094ca9113660a0e19d8055ebb820;hpb=1c48bd6f9e4925db0801f5feed2994418f58f484;p=gnus diff --git a/contrib/gpg.el b/contrib/gpg.el index 09e1d59f6..b96762885 100644 --- a/contrib/gpg.el +++ b/contrib/gpg.el @@ -7,7 +7,7 @@ ;; Keywords: crypto ;; Created: 2000-04-15 -;; $Id: gpg.el,v 1.4 2000/12/01 04:01:39 zsh Exp $ +;; $Id: gpg.el,v 1.7 2000/12/15 04:50:15 zsh Exp $ ;; This file is NOT (yet?) part of GNU Emacs. @@ -143,12 +143,19 @@ ;;; Customization: Widgets: -(define-widget 'gpg-command-alist 'alist - "An association list for GnuPG command names." - :key-type '(symbol :tag "Abbreviation") - :value-type '(string :tag "Program name") - :convert-widget 'widget-alist-convert-widget - :tag "Alist") +(if (get 'alist 'widget-type) + (define-widget 'gpg-command-alist 'alist + "An association list for GnuPG command names." + :key-type '(symbol :tag "Abbreviation") + :value-type '(string :tag "Program name") + :convert-widget 'widget-alist-convert-widget + :tag "Alist") + (define-widget 'gpg-command-alist 'repeat + "An association list for GnuPG command names." + :args '((cons :format "%v" + (symbol :tag "Abbreviation") + (string :tag "Program name"))) + :tag "Alist")) (define-widget 'gpg-command-program 'choice "Widget for entering the name of a program (mostly the GnuPG binary)." @@ -616,7 +623,8 @@ adjust according to `gpg-command-passphrase-env'." ;; make-temp-name doesn't create the file, and an ordinary ;; write-file operation is prone to nasty symlink attacks if the ;; temporary file resides in a world-writable directory. - (unless (eq (file-modes gpg-temp-directory) 448) ; mode 0700 + (unless (or (memq system-type '(windows-nt cygwin32 win32 w32 mswindows)) + (eq (file-modes gpg-temp-directory) 448)) ; mode 0700 (error "Directory for temporary files must have mode 0700.")) (setq name (make-temp-name name)) (let ((mode (default-file-modes))) @@ -798,10 +806,12 @@ Updates the timeout for clearing the cache to `gpg-passphrase-timeout'." (timer-relative-time (current-time) gpg-passphrase-timeout)) (timer-set-function gpg-passphrase-timer 'gpg-passphrase-forget) - (timer-activate gpg-passphrase-timer) + (unless (and (fboundp 'itimer-live-p) + (itimer-live-p gpg-passphrase-timer)) + (timer-activate gpg-passphrase-timer)) (setq gpg-passphrase passphrase)) passphrase) - + (defun gpg-passphrase-read () "Read a passphrase and remember it for some time." (interactive)