From f139c5af0f5086b3596be4a6832efcb99cabc92f Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Fri, 1 Dec 2000 04:01:39 +0000 Subject: [PATCH] 2000-11-30 22:00:00 ShengHuo ZHU * 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 | 16 ++++++++++++++++ contrib/gpg.el | 26 ++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index f512ae667..c9e7e8b99 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,14 @@ +2000-11-30 22:00:00 ShengHuo ZHU + + * 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,Av(Brn Torkelsson * gpg.el: In Xemacs it is called point-at-eol, not @@ -11,6 +22,11 @@ * gpg.el (gpg-command-verify-cleartext): New variable. (gpg-verify-cleartext): New function. +2000-10-31 17:32:02 ShengHuo ZHU + + * 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: diff --git a/contrib/gpg.el b/contrib/gpg.el index f885330d1..a66f036ae 100644 --- a/contrib/gpg.el +++ b/contrib/gpg.el @@ -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. @@ -108,13 +108,16 @@ ;;;; 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 -- 2.25.1