From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47466 Path: main.gmane.org!not-for-mail From: Joseph Barillari Newsgroups: gmane.emacs.gnus.general Subject: pgg-passphrase-cache-expiry customization patch Date: Wed, 30 Oct 2002 00:18:18 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <87znswsdwl.fsf@bigbox.barillari.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035955251 15278 80.91.224.249 (30 Oct 2002 05:20:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 30 Oct 2002 05:20:51 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 186lHe-0003yI-00 for ; Wed, 30 Oct 2002 06:20:50 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 186lFw-0001we-00; Tue, 29 Oct 2002 23:19:04 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 29 Oct 2002 23:19:48 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id XAA12970 for ; Tue, 29 Oct 2002 23:19:32 -0600 (CST) Original-Received: (qmail 10723 invoked by alias); 30 Oct 2002 05:18:38 -0000 Original-Received: (qmail 10718 invoked from network); 30 Oct 2002 05:18:37 -0000 Original-Received: from jbarilla.student.princeton.edu (HELO bigbox.barillari.org) (140.180.137.120) by gnus.org with SMTP; 30 Oct 2002 05:18:37 -0000 Original-Received: from bigbox.barillari.org (localhost [127.0.0.1]) by bigbox.barillari.org (8.12.6/8.12.6/Debian-7) with ESMTP id g9U5IILX027232 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Wed, 30 Oct 2002 00:18:18 -0500 Original-Received: (from jdb@localhost) by bigbox.barillari.org (8.12.6/8.12.6/Debian-7) id g9U5II9Y027230; Wed, 30 Oct 2002 00:18:18 -0500 Original-To: ding@gnus.org X-URL: http://www.princeton.edu/~jbarilla X-Public-Key-Fingerprint: 99C7 4F49 AF41 AD0F A4FC 529C 215E 1BD2 F6A1 FA37 X-Public-Key: finger -l jbarilla@phoenix.princeton.edu User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:47466 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:47466 --=-=-= Hi. I've been off the list for a while (actually, I still am, so I'd really appreciate it if you'd cc: me with any replies). Perhaps I missed the debate on the issue (though I didn't see it in the archives): why is pgg-passphrase-cache-expiry hardcoded to 16 and left with no customization option? One could change it with setq in .gnus, but I assume that you'd rather have a defcustom. The patch I attached replaces the boolean pgg-cache-passphrase with a test for the non-zeroness of pgg-passphrase-cache-expiry, and adds a corresponding defcustom. Unfortunately, I haven't tested this: I'm running emacs and w3m-el from Debian unstable and it seems to have broken my build process. My apologies for the untested-ness, but the patch is sufficiently trivial that it should be evident if it works by visual inspection (I'm not an elisp wizard, but lots of people on this list are). If anyone's had the build problem, the log is below: jdb@bigbox:~/dl/gnus-cvs/gnus$ ./configure jdb@bigbox:~/dl/gnus-cvs/gnus$ make cd lisp && make EMACS="emacs" lispdir="/usr/share/emacs/site-lisp" all make[1]: Entering directory `/home/jdb/dl/gnus-cvs/gnus/lisp' rm -f *.elc gnus-load.el URLDIR=no W3DIR=no lispdir=/usr/share/emacs/site-lisp srcdir=. emacs -batch -q -no-site-file -l ./dgnushack.el -f dgnushack-make-cus-load . Loading cus-dep... Directory . Generating cus-load.el... Wrong type argument: stringp, (mm-inline-text-html-with-w3m-keymap custom-variable) make[1]: *** [gnus-load.el] Error 255 make[1]: Leaving directory `/home/jdb/dl/gnus-cvs/gnus/lisp' make: *** [lick] Error 2 Patch is attached. Cheers, --Joe --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pgg-expiry-patch.patch Content-Transfer-Encoding: quoted-printable diff -ru gnus/lisp/pgg-def.el mygnus/lisp/pgg-def.el =2D-- gnus/lisp/pgg-def.el 2002-10-30 00:06:05.000000000 -0500 +++ mygnus/lisp/pgg-def.el 2002-10-30 00:05:09.000000000 -0500 @@ -58,10 +58,10 @@ :group 'pgg :type 'boolean) =20 =2D(defcustom pgg-cache-passphrase t =2D "If t, cache passphrase." +(defcustom pgg-passphrase-cache-expiry 60 + "If nonzero, cache passphrase for this many seconds." :group 'pgg =2D :type 'boolean) + :type 'integer) =20 (defvar pgg-messages-coding-system nil "Coding system used when reading from a PGP external process.") diff -ru gnus/lisp/pgg-gpg.el mygnus/lisp/pgg-gpg.el =2D-- gnus/lisp/pgg-gpg.el 2002-10-30 00:06:05.000000000 -0500 +++ mygnus/lisp/pgg-gpg.el 2002-10-30 00:05:09.000000000 -0500 @@ -98,7 +98,7 @@ (set-default-file-modes orig-mode)))) =20 (defun pgg-gpg-possibly-cache-passphrase (passphrase) =2D (if (and pgg-cache-passphrase + (if (and (not (eq pgg-passphrase-cache-expiry 0)) (progn (goto-char (point-min)) (re-search-forward "^\\[GNUPG:] GOOD_PASSPHRASE\\>" nil t))) diff -ru gnus/lisp/pgg-pgp.el mygnus/lisp/pgg-pgp.el =2D-- gnus/lisp/pgg-pgp.el 2002-10-30 00:06:06.000000000 -0500 +++ mygnus/lisp/pgg-pgp.el 2002-10-30 00:05:09.000000000 -0500 @@ -177,7 +177,7 @@ (progn (beginning-of-line 2) (point)) (point-max)))))) =2D (if pgg-cache-passphrase + (if (not (eq pgg-passphrase-cache-expiry 0)) (pgg-add-passphrase-cache (cdr (assq 'key-identifier packet)) passphrase))))))) diff -ru gnus/lisp/pgg-pgp5.el mygnus/lisp/pgg-pgp5.el =2D-- gnus/lisp/pgg-pgp5.el 2002-10-30 00:06:06.000000000 -0500 +++ mygnus/lisp/pgg-pgp5.el 2002-10-30 00:05:09.000000000 -0500 @@ -189,7 +189,7 @@ (progn (beginning-of-line 2) (point)) (point-max)))))) =2D (if pgg-cache-passphrase + (if (not (eq pgg-passphrase-cache-expiry 0)) (pgg-add-passphrase-cache (cdr (assq 'key-identifier packet)) passphrase))))))) diff -ru gnus/lisp/pgg.el mygnus/lisp/pgg.el =2D-- gnus/lisp/pgg.el 2002-10-30 00:06:06.000000000 -0500 +++ mygnus/lisp/pgg.el 2002-10-30 00:05:09.000000000 -0500 @@ -99,7 +99,7 @@ (setq pgg-read-passphrase 'read-passwd) (autoload 'ange-ftp-read-passwd "ange-ftp") (setq pgg-read-passphrase 'ange-ftp-read-passwd)))) =2D (or (and pgg-cache-passphrase + (or (and (not (eq pgg-passphrase-cache-expiry 0)) key (setq key (pgg-truncate-key-identifier key)) (symbol-value (intern-soft key pgg-passphrase-cache))) (funcall pgg-read-passphrase prompt))) --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA9v2uaIV4b0vah+jcRAhXwAKCUS7LVsAObxwYG9lFGyTYougZy6ACeMG2e q6p3JtqqfZn05GBEgJxSCwo= =QxZl -----END PGP SIGNATURE----- --==-=-=-- --=-=-=--