From: ueno Date: Sat, 6 Nov 1999 10:41:20 +0000 (+0000) Subject: * pgg.el (pgg-verify-region): Bind `pgg-scheme' in the predicate X-Git-Tag: emiko-1_13_7~42 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5f35de0260a113cf4413bf847ab487a4b0510e5f;p=elisp%2Fsemi.git * pgg.el (pgg-verify-region): Bind `pgg-scheme' in the predicate of whether to fetch signer's public key. (pgg-convert-lbt-region): New macro. (pgg-as-lbt): New macro. --- diff --git a/pgg.el b/pgg.el index c702ac0..8008db5 100644 --- a/pgg.el +++ b/pgg.el @@ -228,7 +228,8 @@ and END to the keyring.") status) (and (stringp key) (setq key (concat "0x" (pgg-truncate-key-identifier key))) - (null (pgg-lookup-key-string key)) + (null (let ((pgg-scheme scheme)) + (pgg-lookup-key-string key))) (or fetch (interactive-p)) (y-or-n-p (format "Key %s not found; attempt to fetch? " key)) (setq keyserver @@ -350,6 +351,33 @@ and END to the keyring.") (defun pgg-remove-passphrase-cache (key) (unintern key pgg-passphrase-cache)) +(defmacro pgg-convert-lbt-region (start end lbt) + `(let ((pgg-conversion-end (set-marker (make-marker) ,end))) + (goto-char ,start) + (case ,lbt + (CRLF + (while (progn + (end-of-line) + (> (marker-position pgg-conversion-end) (point))) + (insert "\r") + (forward-line 1))) + (LF + (while (re-search-forward "\r$" pgg-conversion-end t) + (replace-match "")))) + )) + +(put 'pgg-as-lbt 'lisp-indent-function 3) + +(defmacro pgg-as-lbt (start end lbt &rest body) + `(let ((inhibit-read-only t) + buffer-read-only + buffer-undo-list) + (pgg-convert-lbt-region ,start ,end ,lbt) + (let ((,end (point))) + ,@body) + (push nil buffer-undo-list) + (undo))) + ;;; @ postprocess macros ;;;