summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2011-08-15 22:06:32 -0400
committerRichard M. Stallman <rms@gnu.org>2011-08-15 22:06:32 -0400
commitfe38beefade6a9c382aa6f6c1dd98edbfe4bceca (patch)
treedee290e458d7e8ef3048d207c1c09c78bf946d0c
parent3a99bf64df4071fc6910876070215a948c18aa01 (diff)
downloademacs-fe38beefade6a9c382aa6f6c1dd98edbfe4bceca.tar.gz
Fix previous change.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/epa.el21
2 files changed, 12 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 053f9d3bab6..400500998c3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,7 @@
2011-08-16 Richard Stallman <rms@gnu.org>
- * epa.el (epa-decrypt-region): New arg COPY-FUNCTION.
+ * epa.el (epa-decrypt-region): New arg MAKE-BUFFER-FUNCTION.
+ Don't bind buffer-read-only, just inhibit-read-only.
(epa--find-coding-system-for-mime-charset): Fix the non-xemacs case.
(epa-decrypt-armor-in-region): Make error message clearer.
diff --git a/lisp/epa.el b/lisp/epa.el
index 5611379ea51..8ab9e6006e6 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -803,10 +803,13 @@ If no one is selected, symmetric encryption will be performed. ")))
(file-name-nondirectory cipher))))
;;;###autoload
-(defun epa-decrypt-region (start end &optional copy-function)
+(defun epa-decrypt-region (start end &optional make-buffer-function)
"Decrypt the current region between START and END.
-If COPY-FUNCTION is non-nil, call it to copy the current buffer
-into some other buffer for the output; it should return that buffer.
+
+If MAKE-BUFFER-FUNCTION is non-nil, call it to prepare an output buffer.
+It should return that buffer. If it copies the input, it should
+delete the text now being decrypted. It should leave point at the
+proper place to insert the plaintext.
Be careful about using this command in Lisp programs!
Since this function operates on regions, it does some tricks such
@@ -841,17 +844,13 @@ For example:
(get-text-property start 'epa-coding-system-used)
'undecided)))
(if (y-or-n-p "Replace the original text? ")
- (let ((inhibit-read-only t)
- buffer-read-only)
+ (let ((inhibit-read-only t))
(delete-region start end)
(goto-char start)
(insert plain))
- (if copy-function
- (with-current-buffer (funcall copy-function)
- (let ((inhibit-read-only t)
- buffer-read-only)
- (delete-region start end)
- (goto-char start)
+ (if make-buffer-function
+ (with-current-buffer (funcall make-buffer-function)
+ (let ((inhibit-read-only t))
(insert plain)))
(with-output-to-temp-buffer "*Temp*"
(set-buffer standard-output)