diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2013-11-20 19:26:12 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-11-20 19:26:12 +0100 |
commit | 3e87d5893dcf3c796dee57452406ad0b05f04b3a (patch) | |
tree | 4a8f92ea028f4a7b2369c7ed4cfcf57a361deba5 | |
parent | c5aad89f5a7a5d3ea5ff4db3f099c828e9f76c42 (diff) | |
download | org-mode-3e87d5893dcf3c796dee57452406ad0b05f04b3a.tar.gz |
org-crypt.el: Fix warning
* org-crypt.el (org-encrypt-string, org-encrypt-entry)
(org-decrypt-entry): Fix warning.
TINYCHANGE
epg-context is let-bounded in org-crypt and then epg local set it in
this context. It should just be set as local var instead of being let
bounded.
See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15081
-rw-r--r-- | lisp/org-crypt.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/org-crypt.el b/lisp/org-crypt.el index b02a7ce..1fbcf8e 100644 --- a/lisp/org-crypt.el +++ b/lisp/org-crypt.el @@ -161,8 +161,8 @@ See `org-crypt-disable-auto-save'." (if (and (string= crypt-key (get-text-property 0 'org-crypt-key str)) (string= (sha1 str) (get-text-property 0 'org-crypt-checksum str))) (get-text-property 0 'org-crypt-text str) - (let ((epg-context (epg-make-context nil t t))) - (epg-encrypt-string epg-context str (epg-list-keys epg-context crypt-key))))) + (set (make-local-variable 'epg-context) (epg-make-context nil t t)) + (epg-encrypt-string epg-context str (epg-list-keys epg-context crypt-key)))) (defun org-encrypt-entry () "Encrypt the content of the current headline." @@ -170,11 +170,11 @@ See `org-crypt-disable-auto-save'." (require 'epg) (save-excursion (org-back-to-heading t) + (set (make-local-variable 'epg-context) (epg-make-context nil t t)) (let ((start-heading (point))) (forward-line) (when (not (looking-at "-----BEGIN PGP MESSAGE-----")) (let ((folded (outline-invisible-p)) - (epg-context (epg-make-context nil t t)) (crypt-key (org-crypt-key-for-heading)) (beg (point)) end encrypted-text) @@ -206,11 +206,11 @@ See `org-crypt-disable-auto-save'." (forward-line) (when (looking-at "-----BEGIN PGP MESSAGE-----") (org-crypt-check-auto-save) + (set (make-local-variable 'epg-context) (epg-make-context nil t t)) (let* ((end (save-excursion (search-forward "-----END PGP MESSAGE-----") (forward-line) (point))) - (epg-context (epg-make-context nil t t)) (encrypted-text (buffer-substring-no-properties (point) end)) (decrypted-text (decode-coding-string |