diff options
| author | Richard M. Stallman | 2011-08-15 22:06:32 -0400 |
|---|---|---|
| committer | Richard M. Stallman | 2011-08-15 22:06:32 -0400 |
| commit | fe38beefade6a9c382aa6f6c1dd98edbfe4bceca (patch) | |
| tree | dee290e458d7e8ef3048d207c1c09c78bf946d0c | |
| parent | 3a99bf64df4071fc6910876070215a948c18aa01 (diff) | |
| download | emacs-fe38beefade6a9c382aa6f6c1dd98edbfe4bceca.tar.gz emacs-fe38beefade6a9c382aa6f6c1dd98edbfe4bceca.zip | |
Fix previous change.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/epa.el | 21 |
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 @@ | |||
| 1 | 2011-08-16 Richard Stallman <rms@gnu.org> | 1 | 2011-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. |
| 808 | If COPY-FUNCTION is non-nil, call it to copy the current buffer | 808 | |
| 809 | into some other buffer for the output; it should return that buffer. | 809 | If MAKE-BUFFER-FUNCTION is non-nil, call it to prepare an output buffer. |
| 810 | It should return that buffer. If it copies the input, it should | ||
| 811 | delete the text now being decrypted. It should leave point at the | ||
| 812 | proper place to insert the plaintext. | ||
| 810 | 813 | ||
| 811 | Be careful about using this command in Lisp programs! | 814 | Be careful about using this command in Lisp programs! |
| 812 | Since this function operates on regions, it does some tricks such | 815 | Since 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) |