Mercurial > emacs
annotate lisp/pgg.el @ 110955:c84f553cca36
Add some default custom themes.
* cus-theme.el (custom-theme--listed-faces): Add cursor face.
(describe-theme-1): Extract doc from unloaded themes.
* custom.el (custom-theme-name-valid-p): Don't list color-themes.
* themes/tango-theme.el:
* themes/tango-dark-theme.el:
* themes/wheatgrass-theme.el: New files.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Tue, 12 Oct 2010 16:06:20 -0400 |
parents | 236342431786 |
children |
rev | line source |
---|---|
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
1 ;;; pgg.el --- glue for the various PGP implementations. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
2 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
3 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
5 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
6 ;; Author: Daiki Ueno <ueno@unixuser.org> |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
7 ;; Symmetric encryption added by: Sascha Wilde <wilde@sha-bang.de> |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
8 ;; Created: 1999/10/28 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
9 ;; Keywords: PGP |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
10 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
12 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
16 ;; (at your option) any later version. |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
17 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
22 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
25 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
26 ;;; Commentary: |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
27 |
100652 | 28 ;; This file is on its way to obsolescence, waiting for allout.el to |
29 ;; switch to EPG. | |
30 | |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
31 ;;; Code: |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
32 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
33 (require 'pgg-def) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
34 (require 'pgg-parse) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
35 (autoload 'run-at-time "timer") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
36 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
37 ;; Don't merge these two `eval-when-compile's. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
38 (eval-when-compile |
110918
236342431786
nnimap.el (gnutls-negotiate): Silence the byte compiler.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110637
diff
changeset
|
39 ;; For Emacs <22.2 and XEmacs. |
87209 | 40 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
41 (require 'cl)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
42 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
43 ;;; @ utility functions |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
44 ;;; |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
45 |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
46 (eval-when-compile |
110637
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
47 (when (featurep 'xemacs) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
48 (defmacro pgg-run-at-time-1 (time repeat function args) |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
49 (if (condition-case nil |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
50 (let ((delete-itimer 'delete-itimer) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
51 (itimer-driver-start 'itimer-driver-start) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
52 (itimer-value 'itimer-value) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
53 (start-itimer 'start-itimer)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
54 (unless (or (symbol-value 'itimer-process) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
55 (symbol-value 'itimer-timer)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
56 (funcall itimer-driver-start)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
57 ;; Check whether there is a bug to which the difference of |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
58 ;; the present time and the time when the itimer driver was |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
59 ;; woken up is subtracted from the initial itimer value. |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
60 (let* ((inhibit-quit t) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
61 (ctime (current-time)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
62 (itimer-timer-last-wakeup |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
63 (prog1 |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
64 ctime |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
65 (setcar ctime (1- (car ctime))))) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
66 (itimer-list nil) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
67 (itimer (funcall start-itimer "pgg-run-at-time" |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
68 'ignore 5))) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
69 (sleep-for 0.1) ;; Accept the timeout interrupt. |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
70 (prog1 |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
71 (> (funcall itimer-value itimer) 0) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
72 (funcall delete-itimer itimer)))) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
73 (error nil)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
74 `(let ((time ,time)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
75 (apply #'start-itimer "pgg-run-at-time" |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
76 ,function (if time (max time 1e-9) 1e-9) |
110637
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
77 ,repeat nil t ,args)) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
78 `(let ((time ,time) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
79 (itimers (list nil))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
80 (setcar |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
81 itimers |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
82 (apply #'start-itimer "pgg-run-at-time" |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
83 (lambda (itimers repeat function &rest args) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
84 (let ((itimer (car itimers))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
85 (if repeat |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
86 (progn |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
87 (set-itimer-function |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
88 itimer |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
89 (lambda (itimer repeat function &rest args) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
90 (set-itimer-restart itimer repeat) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
91 (set-itimer-function itimer function) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
92 (set-itimer-function-arguments itimer args) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
93 (apply function args))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
94 (set-itimer-function-arguments |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
95 itimer |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
96 (append (list itimer repeat function) args))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
97 (set-itimer-function |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
98 itimer |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
99 (lambda (itimer function &rest args) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
100 (delete-itimer itimer) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
101 (apply function args))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
102 (set-itimer-function-arguments |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
103 itimer |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
104 (append (list itimer function) args))))) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
105 1e-9 (if time (max time 1e-9) 1e-9) |
494ea2fb03d7
Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
106 nil t itimers ,repeat ,function ,args))))))) |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
107 |
87300 | 108 (eval-and-compile |
109 (if (featurep 'xemacs) | |
110 (progn | |
111 (defun pgg-run-at-time (time repeat function &rest args) | |
112 "Emulating function run as `run-at-time'. | |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
113 TIME should be nil meaning now, or a number of seconds from now. |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
114 Return an itimer object which can be used in either `delete-itimer' |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
115 or `cancel-timer'." |
87300 | 116 (pgg-run-at-time-1 time repeat function args)) |
117 (defun pgg-cancel-timer (timer) | |
118 "Emulate cancel-timer for xemacs." | |
119 (let ((delete-itimer 'delete-itimer)) | |
120 (funcall delete-itimer timer)))) | |
121 (defalias 'pgg-run-at-time 'run-at-time) | |
122 (defalias 'pgg-cancel-timer 'cancel-timer))) | |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
123 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
124 (defun pgg-invoke (func scheme &rest args) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
125 (progn |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
126 (require (intern (format "pgg-%s" scheme))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
127 (apply 'funcall (intern (format "pgg-%s-%s" scheme func)) args))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
128 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
129 (put 'pgg-save-coding-system 'lisp-indent-function 2) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
130 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
131 (defmacro pgg-save-coding-system (start end &rest body) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
132 `(if (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
133 (let ((buffer (current-buffer))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
134 (with-temp-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
135 (let (buffer-undo-list) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
136 (insert-buffer-substring buffer ,start ,end) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
137 (encode-coding-region (point-min)(point-max) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
138 buffer-file-coding-system) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
139 (prog1 (save-excursion ,@body) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
140 (push nil buffer-undo-list) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
141 (ignore-errors (undo)))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
142 (save-restriction |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
143 (narrow-to-region ,start ,end) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
144 ,@body))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
145 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
146 (defun pgg-temp-buffer-show-function (buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
147 (let ((window (or (get-buffer-window buffer 'visible) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
148 (split-window-vertically)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
149 (set-window-buffer window buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
150 (shrink-window-if-larger-than-buffer window))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
151 |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
152 ;; XXX `pgg-display-output-buffer' is a horrible name for this function. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
153 ;; It should be something like `pgg-situate-output-or-display-error'. |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
154 (defun pgg-display-output-buffer (start end status) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
155 "Situate en/decryption results or pop up an error buffer. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
156 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
157 Text from START to END is replaced by contents of output buffer if STATUS |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
158 is true, or else the output buffer is displayed." |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
159 (if status |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
160 (pgg-situate-output start end) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
161 (pgg-display-error-buffer))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
162 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
163 (defun pgg-situate-output (start end) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
164 "Place en/decryption result in place of current text from START to END." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
165 (delete-region start end) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
166 (insert-buffer-substring pgg-output-buffer) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
167 (decode-coding-region start (point) buffer-file-coding-system)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
168 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
169 (defun pgg-display-error-buffer () |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
170 "Pop up an error buffer indicating the reason for an en/decryption failure." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
171 (let ((temp-buffer-show-function |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
172 (function pgg-temp-buffer-show-function))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
173 (with-output-to-temp-buffer pgg-echo-buffer |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
174 (set-buffer standard-output) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
175 (insert-buffer-substring pgg-errors-buffer)))) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
176 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
177 (defvar pgg-passphrase-cache (make-vector 7 0)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
178 |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
179 (defvar pgg-pending-timers (make-vector 7 0) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
180 "Hash table for managing scheduled pgg cache management timers. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
181 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
182 We associate key and timer, so the timer can be cancelled if a new |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
183 timeout for the key is set while an old one is still pending.") |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
184 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
185 (defun pgg-read-passphrase (prompt &optional key notruncate) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
186 "Using PROMPT, obtain passphrase for KEY from cache or user. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
187 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
188 Truncate the key to 8 trailing characters unless NOTRUNCATE is true |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
189 \(default false). |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
190 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
191 Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
192 regulate cache behavior." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
193 (or (pgg-read-passphrase-from-cache key notruncate) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
194 (read-passwd prompt))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
195 |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
196 (defun pgg-read-passphrase-from-cache (key &optional notruncate) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
197 "Obtain passphrase for KEY from time-limited passphrase cache. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
198 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
199 Truncate the key to 8 trailing characters unless NOTRUNCATE is true |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
200 \(default false). |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
201 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
202 Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
203 regulate cache behavior." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
204 (and pgg-cache-passphrase |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
205 key (or notruncate |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
206 (setq key (pgg-truncate-key-identifier key))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
207 (symbol-value (intern-soft key pgg-passphrase-cache)))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
208 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
209 (defun pgg-add-passphrase-to-cache (key passphrase &optional notruncate) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
210 "Associate KEY with PASSPHRASE in time-limited passphrase cache. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
211 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
212 Truncate the key to 8 trailing characters unless NOTRUNCATE is true |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
213 \(default false). |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
214 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
215 Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
216 regulate cache behavior." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
217 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
218 (let* ((key (if notruncate key (pgg-truncate-key-identifier key))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
219 (interned-timer-key (intern-soft key pgg-pending-timers)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
220 (old-timer (symbol-value interned-timer-key)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
221 new-timer) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
222 (when old-timer |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
223 (cancel-timer old-timer) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
224 (unintern interned-timer-key pgg-pending-timers)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
225 (set (intern key pgg-passphrase-cache) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
226 passphrase) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
227 (set (intern key pgg-pending-timers) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
228 (pgg-run-at-time pgg-passphrase-cache-expiry nil |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
229 #'pgg-remove-passphrase-from-cache |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
230 key notruncate)))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
231 |
72653 | 232 (if (fboundp 'clear-string) |
233 (defalias 'pgg-clear-string 'clear-string) | |
234 (defun pgg-clear-string (string) | |
235 (fillarray string ?_))) | |
236 | |
86496
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
237 (declare-function pgg-clear-string "pgg" (string)) |
e793ef63bdb9
(pgg-clear-string): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
238 |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
239 (defun pgg-remove-passphrase-from-cache (key &optional notruncate) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
240 "Omit passphrase associated with KEY in time-limited passphrase cache. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
241 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
242 Truncate the key to 8 trailing characters unless NOTRUNCATE is true |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
243 \(default false). |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
244 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
245 This is a no-op if there is not entry for KEY (eg, it's already expired. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
246 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
247 The memory for the passphrase is filled with underscores to clear any |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
248 references to it. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
249 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
250 Custom variables `pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
251 regulate cache behavior." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
252 (let* ((passphrase (pgg-read-passphrase-from-cache key notruncate)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
253 (key (if notruncate key (pgg-truncate-key-identifier key))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
254 (interned-timer-key (intern-soft key pgg-pending-timers)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
255 (old-timer (symbol-value interned-timer-key))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
256 (when passphrase |
72653 | 257 (pgg-clear-string passphrase) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
258 (unintern key pgg-passphrase-cache)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
259 (when old-timer |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
260 (pgg-cancel-timer old-timer) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
261 (unintern interned-timer-key pgg-pending-timers)))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
262 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
263 (defmacro pgg-convert-lbt-region (start end lbt) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
264 `(let ((pgg-conversion-end (set-marker (make-marker) ,end))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
265 (goto-char ,start) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
266 (case ,lbt |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
267 (CRLF |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
268 (while (progn |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
269 (end-of-line) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
270 (> (marker-position pgg-conversion-end) (point))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
271 (insert "\r") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
272 (forward-line 1))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
273 (LF |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
274 (while (re-search-forward "\r$" pgg-conversion-end t) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
275 (replace-match "")))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
276 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
277 (put 'pgg-as-lbt 'lisp-indent-function 3) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
278 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
279 (defmacro pgg-as-lbt (start end lbt &rest body) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
280 `(let ((inhibit-read-only t) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
281 buffer-read-only |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
282 buffer-undo-list) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
283 (pgg-convert-lbt-region ,start ,end ,lbt) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
284 (let ((,end (point))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
285 ,@body) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
286 (push nil buffer-undo-list) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
287 (ignore-errors (undo)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
288 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
289 (put 'pgg-process-when-success 'lisp-indent-function 0) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
290 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
291 (defmacro pgg-process-when-success (&rest body) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
292 `(with-current-buffer pgg-output-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
293 (if (zerop (buffer-size)) nil ,@body t))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
294 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
295 (defalias 'pgg-make-temp-file |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
296 (if (fboundp 'make-temp-file) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
297 'make-temp-file |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
298 (lambda (prefix &optional dir-flag) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
299 (let ((file (expand-file-name |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
300 (make-temp-name prefix) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
301 (if (fboundp 'temp-directory) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
302 (temp-directory) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
303 temporary-file-directory)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
304 (if dir-flag |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
305 (make-directory file)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
306 file)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
307 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
308 ;;; @ interface functions |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
309 ;;; |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
310 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
311 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
312 (defun pgg-encrypt-region (start end rcpts &optional sign passphrase) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
313 "Encrypt the current region between START and END for RCPTS. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
314 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
315 If optional argument SIGN is non-nil, do a combined sign and encrypt. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
316 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
317 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
318 passphrase cache or user." |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
319 (interactive |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
320 (list (region-beginning)(region-end) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
321 (split-string (read-string "Recipients: ") "[ \t,]+"))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
322 (let ((status |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
323 (pgg-save-coding-system start end |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
324 (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
325 (point-min) (point-max) rcpts sign passphrase)))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
326 (when (called-interactively-p 'interactive) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
327 (pgg-display-output-buffer start end status)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
328 status)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
329 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
330 ;;;###autoload |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
331 (defun pgg-encrypt-symmetric-region (start end &optional passphrase) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
332 "Encrypt the current region between START and END symmetric with passphrase. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
333 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
334 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
335 cache or user." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
336 (interactive "r") |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
337 (let ((status |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
338 (pgg-save-coding-system start end |
77932
491c39d86dc0
(pgg-sign-region, pgg-sign): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
75347
diff
changeset
|
339 (pgg-invoke "encrypt-symmetric-region" |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
340 (or pgg-scheme pgg-default-scheme) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
341 (point-min) (point-max) passphrase)))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
342 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
343 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
344 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
345 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
346 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
347 (defun pgg-encrypt-symmetric (&optional start end passphrase) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
348 "Encrypt the current buffer using a symmetric, rather than key-pair, cipher. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
349 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
350 If optional arguments START and END are specified, only encrypt within |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
351 the region. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
352 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
353 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
354 passphrase cache or user." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
355 (interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
356 (let* ((start (or start (point-min))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
357 (end (or end (point-max))) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
358 (status (pgg-encrypt-symmetric-region start end passphrase))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
359 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
360 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
361 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
362 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
363 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
364 (defun pgg-encrypt (rcpts &optional sign start end passphrase) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
365 "Encrypt the current buffer for RCPTS. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
366 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
367 If optional argument SIGN is non-nil, do a combined sign and encrypt. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
368 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
369 If optional arguments START and END are specified, only encrypt within |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
370 the region. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
371 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
372 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
373 passphrase cache or user." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
374 (interactive (list (split-string (read-string "Recipients: ") "[ \t,]+"))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
375 (let* ((start (or start (point-min))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
376 (end (or end (point-max))) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
377 (status (pgg-encrypt-region start end rcpts sign passphrase))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
378 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
379 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
380 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
381 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
382 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
383 (defun pgg-decrypt-region (start end &optional passphrase) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
384 "Decrypt the current region between START and END. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
385 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
386 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
387 passphrase cache or user." |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
388 (interactive "r") |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
389 (let* ((buf (current-buffer)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
390 (status |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
391 (pgg-save-coding-system start end |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
392 (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
393 (point-min) (point-max) passphrase)))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
394 (when (called-interactively-p 'interactive) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
395 (pgg-display-output-buffer start end status)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
396 status)) |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
397 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
398 ;;;###autoload |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
399 (defun pgg-decrypt (&optional start end passphrase) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
400 "Decrypt the current buffer. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
401 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
402 If optional arguments START and END are specified, only decrypt within |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
403 the region. |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
404 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
405 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
406 passphrase cache or user." |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
407 (interactive "") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
408 (let* ((start (or start (point-min))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
409 (end (or end (point-max))) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
410 (status (pgg-decrypt-region start end passphrase))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
411 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
412 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
413 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
414 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
415 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
416 (defun pgg-sign-region (start end &optional cleartext passphrase) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
417 "Make the signature from text between START and END. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
418 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
419 If the optional 3rd argument CLEARTEXT is non-nil, it does not create |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
420 a detached signature. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
421 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
422 If this function is called interactively, CLEARTEXT is enabled |
77932
491c39d86dc0
(pgg-sign-region, pgg-sign): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
75347
diff
changeset
|
423 and the output is displayed. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
424 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
425 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
426 passphrase cache or user." |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
427 (interactive "r") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
428 (let ((status (pgg-save-coding-system start end |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
429 (pgg-invoke "sign-region" (or pgg-scheme pgg-default-scheme) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
430 (point-min) (point-max) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
431 (or (called-interactively-p 'interactive) |
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
432 cleartext) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
433 passphrase)))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
434 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
435 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
436 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
437 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
438 ;;;###autoload |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
439 (defun pgg-sign (&optional cleartext start end passphrase) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
440 "Sign the current buffer. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
441 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
442 If the optional argument CLEARTEXT is non-nil, it does not create a |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
443 detached signature. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
444 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
445 If optional arguments START and END are specified, only sign data |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
446 within the region. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
447 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
448 If this function is called interactively, CLEARTEXT is enabled |
77932
491c39d86dc0
(pgg-sign-region, pgg-sign): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
75347
diff
changeset
|
449 and the output is displayed. |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
450 |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
451 If optional PASSPHRASE is not specified, it will be obtained from the |
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
452 passphrase cache or user." |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
453 (interactive "") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
454 (let* ((start (or start (point-min))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
455 (end (or end (point-max))) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
456 (status (pgg-sign-region start end |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
457 (or (called-interactively-p 'interactive) |
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
458 cleartext) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
459 passphrase))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
460 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
461 (pgg-display-output-buffer start end status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
462 status)) |
66519
20539524a670
(pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region.
Eli Zaretskii <eliz@gnu.org>
parents:
66383
diff
changeset
|
463 |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
464 ;;;###autoload |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
465 (defun pgg-verify-region (start end &optional signature fetch) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
466 "Verify the current region between START and END. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
467 If the optional 3rd argument SIGNATURE is non-nil, it is treated as |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
468 the detached signature of the current region. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
469 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
470 If the optional 4th argument FETCH is non-nil, we attempt to fetch the |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
471 signer's public key from `pgg-default-keyserver-address'." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
472 (interactive "r") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
473 (let* ((packet |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
474 (if (null signature) nil |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
475 (with-temp-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
476 (buffer-disable-undo) |
108287
c0d13767677a
Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
106815
diff
changeset
|
477 (unless (featurep 'xemacs) |
c0d13767677a
Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
106815
diff
changeset
|
478 (set-buffer-multibyte nil)) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
479 (insert-file-contents signature) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
480 (cdr (assq 2 (pgg-decode-armor-region |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
481 (point-min)(point-max))))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
482 (key (cdr (assq 'key-identifier packet))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
483 status keyserver) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
484 (and (stringp key) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
485 pgg-query-keyserver |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
486 (setq key (concat "0x" (pgg-truncate-key-identifier key))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
487 (null (pgg-lookup-key key)) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
488 (or fetch (called-interactively-p 'interactive)) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
489 (y-or-n-p (format "Key %s not found; attempt to fetch? " key)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
490 (setq keyserver |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
491 (or (cdr (assq 'preferred-key-server packet)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
492 pgg-default-keyserver-address)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
493 (pgg-fetch-key keyserver key)) |
77932
491c39d86dc0
(pgg-sign-region, pgg-sign): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
75347
diff
changeset
|
494 (setq status |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
495 (pgg-save-coding-system start end |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
496 (pgg-invoke "verify-region" (or pgg-scheme pgg-default-scheme) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
497 (point-min) (point-max) signature))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
498 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
499 (let ((temp-buffer-show-function |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
500 (function pgg-temp-buffer-show-function))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
501 (with-output-to-temp-buffer pgg-echo-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
502 (set-buffer standard-output) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
503 (insert-buffer-substring (if status pgg-output-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
504 pgg-errors-buffer))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
505 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
506 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
507 ;;;###autoload |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
508 (defun pgg-verify (&optional signature fetch start end) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
509 "Verify the current buffer. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
510 If the optional argument SIGNATURE is non-nil, it is treated as |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
511 the detached signature of the current region. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
512 If the optional argument FETCH is non-nil, we attempt to fetch the |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
513 signer's public key from `pgg-default-keyserver-address'. |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
514 If optional arguments START and END are specified, only verify data |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
515 within the region." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
516 (interactive "") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
517 (let* ((start (or start (point-min))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
518 (end (or end (point-max))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
519 (status (pgg-verify-region start end signature fetch))) |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
100908
diff
changeset
|
520 (when (called-interactively-p 'interactive) |
66383
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
521 (let ((temp-buffer-show-function |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
522 (function pgg-temp-buffer-show-function))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
523 (with-output-to-temp-buffer pgg-echo-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
524 (set-buffer standard-output) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
525 (insert-buffer-substring (if status pgg-output-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
526 pgg-errors-buffer))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
527 status)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
528 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
529 ;;;###autoload |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
530 (defun pgg-insert-key () |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
531 "Insert the ASCII armored public key." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
532 (interactive) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
533 (pgg-invoke "insert-key" (or pgg-scheme pgg-default-scheme))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
534 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
535 ;;;###autoload |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
536 (defun pgg-snarf-keys-region (start end) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
537 "Import public keys in the current region between START and END." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
538 (interactive "r") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
539 (pgg-save-coding-system start end |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
540 (pgg-invoke "snarf-keys-region" (or pgg-scheme pgg-default-scheme) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
541 start end))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
542 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
543 ;;;###autoload |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
544 (defun pgg-snarf-keys () |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
545 "Import public keys in the current buffer." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
546 (interactive "") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
547 (pgg-snarf-keys-region (point-min) (point-max))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
548 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
549 (defun pgg-lookup-key (string &optional type) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
550 (pgg-invoke "lookup-key" (or pgg-scheme pgg-default-scheme) string type)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
551 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
552 (defvar pgg-insert-url-function (function pgg-insert-url-with-w3)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
553 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
554 (defun pgg-insert-url-with-w3 (url) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
555 (ignore-errors |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
556 (require 'url) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
557 (let (buffer-file-name) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
558 (url-insert-file-contents url)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
559 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
560 (defvar pgg-insert-url-extra-arguments nil) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
561 (defvar pgg-insert-url-program nil) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
562 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
563 (defun pgg-insert-url-with-program (url) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
564 (let ((args (copy-sequence pgg-insert-url-extra-arguments)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
565 process) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
566 (insert |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
567 (with-temp-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
568 (setq process |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
569 (apply #'start-process " *PGG url*" (current-buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
570 pgg-insert-url-program (nconc args (list url)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
571 (set-process-sentinel process #'ignore) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
572 (while (eq 'run (process-status process)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
573 (accept-process-output process 5)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
574 (delete-process process) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
575 (if (and process (eq 'run (process-status process))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
576 (interrupt-process process)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
577 (buffer-string))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
578 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
579 (defun pgg-fetch-key (keyserver key) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
580 "Attempt to fetch a KEY from KEYSERVER for addition to PGP or GnuPG keyring." |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
581 (with-current-buffer (get-buffer-create pgg-output-buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
582 (buffer-disable-undo) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
583 (erase-buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
584 (let ((proto (if (string-match "^[a-zA-Z\\+\\.\\\\-]+:" keyserver) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
585 (substring keyserver 0 (1- (match-end 0)))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
586 (save-excursion |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
587 (funcall pgg-insert-url-function |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
588 (if proto keyserver |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
589 (format "http://%s:11371/pks/lookup?op=get&search=%s" |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
590 keyserver key)))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
591 (when (re-search-forward "^-+BEGIN" nil 'last) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
592 (delete-region (point-min) (match-beginning 0)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
593 (when (re-search-forward "^-+END" nil t) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
594 (delete-region (progn (end-of-line) (point)) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
595 (point-max))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
596 (insert "\n") |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
597 (with-temp-buffer |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
598 (insert-buffer-substring pgg-output-buffer) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
599 (pgg-snarf-keys-region (point-min)(point-max))))))) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
600 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
601 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
602 (provide 'pgg) |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
603 |
c82982d6cbc4
Moved pgg*.el files from lisp/gnus to lisp.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
604 ;;; pgg.el ends here |