aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 @@
12011-08-16 Richard Stallman <rms@gnu.org> 12011-08-16 Richard Stallman <rms@gnu.org>
2 2
3 * epa.el (epa-decrypt-region): New arg COPY-FUNCTION. 3 * epa.el (epa-decrypt-region): New arg MAKE-BUFFER-FUNCTION.
4 Don't bind buffer-read-only, just inhibit-read-only.
4 (epa--find-coding-system-for-mime-charset): Fix the non-xemacs case. 5 (epa--find-coding-system-for-mime-charset): Fix the non-xemacs case.
5 (epa-decrypt-armor-in-region): Make error message clearer. 6 (epa-decrypt-armor-in-region): Make error message clearer.
6 7
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. ")))
803 (file-name-nondirectory cipher)))) 803 (file-name-nondirectory cipher))))
804 804
805;;;###autoload 805;;;###autoload
806(defun epa-decrypt-region (start end &optional copy-function) 806(defun epa-decrypt-region (start end &optional make-buffer-function)
807 "Decrypt the current region between START and END. 807 "Decrypt the current region between START and END.
808If COPY-FUNCTION is non-nil, call it to copy the current buffer 808
809into some other buffer for the output; it should return that buffer. 809If MAKE-BUFFER-FUNCTION is non-nil, call it to prepare an output buffer.
810It should return that buffer. If it copies the input, it should
811delete the text now being decrypted. It should leave point at the
812proper place to insert the plaintext.
810 813
811Be careful about using this command in Lisp programs! 814Be careful about using this command in Lisp programs!
812Since this function operates on regions, it does some tricks such 815Since this function operates on regions, it does some tricks such
@@ -841,17 +844,13 @@ For example:
841 (get-text-property start 'epa-coding-system-used) 844 (get-text-property start 'epa-coding-system-used)
842 'undecided))) 845 'undecided)))
843 (if (y-or-n-p "Replace the original text? ") 846 (if (y-or-n-p "Replace the original text? ")
844 (let ((inhibit-read-only t) 847 (let ((inhibit-read-only t))
845 buffer-read-only)
846 (delete-region start end) 848 (delete-region start end)
847 (goto-char start) 849 (goto-char start)
848 (insert plain)) 850 (insert plain))
849 (if copy-function 851 (if make-buffer-function
850 (with-current-buffer (funcall copy-function) 852 (with-current-buffer (funcall make-buffer-function)
851 (let ((inhibit-read-only t) 853 (let ((inhibit-read-only t))
852 buffer-read-only)
853 (delete-region start end)
854 (goto-char start)
855 (insert plain))) 854 (insert plain)))
856 (with-output-to-temp-buffer "*Temp*" 855 (with-output-to-temp-buffer "*Temp*"
857 (set-buffer standard-output) 856 (set-buffer standard-output)