From: yamaoka Date: Fri, 1 Dec 2000 12:50:42 +0000 (+0000) Subject: Synch with Gnus. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a56af45d44d242f2482667607c95e4b4f3c47f15;p=elisp%2Fgnus.git- Synch with Gnus. --- diff --git a/contrib/ChangeLog b/contrib/ChangeLog index f512ae6..da72e83 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,13 @@ +2000-11-30 22:00:00 ShengHuo ZHU + + * gpg.el: (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 +21,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 fff73c3..f2dbbe8 100644 --- a/contrib/gpg.el +++ b/contrib/gpg.el @@ -110,9 +110,10 @@ (eval-when-compile (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: @@ -598,12 +599,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) @@ -651,6 +655,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: @@ -705,7 +711,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) @@ -753,6 +759,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: @@ -1106,7 +1114,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