2000-11-30 22:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 1 Dec 2000 04:01:39 +0000 (04:01 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 1 Dec 2000 04:01:39 +0000 (04:01 +0000)
* gpg.el: Use itimer if xemacs.
(gpg-make-temp-file): Use expand-file-name.
(gpg-point-at-eol): New function.
(gpg-call-process): Use it.
(gpg-key-list-keys-parse-line): Ditto.
(gpg-with-passphrase-env): edebug-form-spec.
(gpg-with-temp-files): Ditto.
(gpg-show-result): Ditto.

contrib/ChangeLog
contrib/gpg.el

index f512ae6..c9e7e8b 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-30 22:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gpg.el: Use itimer if xemacs.
+       (gpg-make-temp-file): Use expand-file-name.
+       (gpg-point-at-eol): New function.
+       (gpg-call-process): Use it.
+       (gpg-key-list-keys-parse-line): Ditto.
+       (gpg-with-passphrase-env): edebug-form-spec.
+       (gpg-with-temp-files): Ditto.
+       (gpg-show-result): Ditto.
+
 2000-11-08  Bj\e,Av\e(Brn Torkelsson  <torkel@hpc2n.umu.se>
 
        * gpg.el: In Xemacs it is called point-at-eol, not
        * gpg.el (gpg-command-verify-cleartext): New variable.
        (gpg-verify-cleartext): New function.
        
+2000-10-31 17:32:02  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gpg.el (gpg-verify): The last argument of apply is a list.
+       (gpg-encrypt): Add passphrase as a parameter.
+       
 ;; Local Variables:
 ;; coding: iso-2022-7bit
 ;; End:
index f885330..a66f036 100644 (file)
@@ -7,7 +7,7 @@
 ;; Keywords: crypto
 ;; Created: 2000-04-15
 
-;; $Id: gpg.el,v 1.2 2000/11/18 20:57:13 jas Exp $
+;; $Id: gpg.el,v 1.3 2000/11/22 22:55:47 zsh Exp $
 
 ;; This file is NOT (yet?) part of GNU Emacs.
 
 \f
 ;;;; Code:
 
-(require 'timer)
 (eval-when-compile 
+  (if (featurep 'xemacs)
+      (require 'itimer)
+    (require 'timer))
   (require 'cl))
 
-
-(if (featurep 'xemacs)
-         (defalias 'line-end-position 'point-at-eol))
+(defalias 'gpg-point-at-eol
+  (if (fboundp 'point-at-eol)
+      'point-at-eol
+    'line-end-position))
 
 ;;;; Customization:
 
@@ -600,12 +603,15 @@ adjust according to `gpg-command-passphrase-env'."
         (when gpg-command-passphrase-env
           ;; This will clear the variable if it wasn't set before.
           (setenv (car gpg-command-passphrase-env) ,env-value))))))
+(put 'gpg-with-passphrase-env 'lisp-indent-function 0)
+(put 'gpg-with-passphrase-env 'edebug-form-spec '(body))
 
 ;;; Temporary files:
 
 (defun gpg-make-temp-file ()
   "Create a temporary file in a safe way"
-  (let ((name (concat gpg-temp-directory "/gnupg")))
+  (let ((name  ;; User may use "~/"
+        (expand-file-name "gnupg" gpg-temp-directory)))
     (if (fboundp 'make-temp-file)
        ;; If we've got make-temp-file, we are on the save side.
        (make-temp-file name)
@@ -653,6 +659,8 @@ arguments."
            (gpg-with-temp-files-create ,count)
            ,@body)
        (gpg-with-temp-files-delete))))
+(put 'gpg-with-temp-files 'lisp-indent-function 1)
+(put 'gpg-with-temp-files 'edebug-form-spec '(body))
 
 ;;;  Making subprocesses:
 
@@ -707,7 +715,7 @@ to this file."
                 (apply 'call-process-region (point-min) (point-max) cpr-args)
                 ;; Wipe out passphrase.
                 (goto-char (point-min))
-                (translate-region (point) (line-end-position)
+                (translate-region (point) (gpg-point-at-eol)
                                   (make-string 256 ? )))
             (if (listp stdin)
                 (with-current-buffer (car stdin)
@@ -755,6 +763,8 @@ evaluates BODY, like `progn'.  If BODY evaluates to `nil' (or
      (unwind-protect
         (gpg-show-result-buffer ,always-show (progn ,@body))
        (kill-buffer gpg-result-buffer))))
+(put 'gpg-show-result 'lisp-indent-function 1)
+(put 'gpg-show-result 'edebug-form-spec '(body))
 
 ;;; Passphrase handling:
 
@@ -1108,7 +1118,7 @@ documentation for details)."
 
 (defun gpg-key-list-keys-parse-line ()
   "Parse the line in the current buffer and return a vector of fields."
-  (let* ((eol (line-end-position))
+  (let* ((eol (gpg-point-at-eol))
         (v (if (eolp)
                nil
              (vector