From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#15081: 24.3; org-crypt: Making epg-context local to *epg* while let-bound! Date: Tue, 13 Aug 2013 10:50:06 +0200 Message-ID: <877gfqkm9t.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376383879 10058 80.91.229.3 (13 Aug 2013 08:51:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Aug 2013 08:51:19 +0000 (UTC) To: 15081@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 13 10:51:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V9AJx-00042v-GW for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2013 10:51:17 +0200 Original-Received: from localhost ([::1]:45843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AJw-0001kH-PP for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Aug 2013 04:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AJo-0001k0-2O for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:51:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9AJi-0001Jn-Mm for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:51:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AJi-0001Jj-I5 for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V9AJi-0003xa-7k for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2013 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15081 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137638384315188 (code B ref -1); Tue, 13 Aug 2013 08:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Aug 2013 08:50:43 +0000 Original-Received: from localhost ([127.0.0.1]:56122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9AJN-0003ws-Va for submit@debbugs.gnu.org; Tue, 13 Aug 2013 04:50:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49505) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9AJL-0003wa-1q for submit@debbugs.gnu.org; Tue, 13 Aug 2013 04:50:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9AJA-0001BO-BD for submit@debbugs.gnu.org; Tue, 13 Aug 2013 04:50:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AJ9-0001BA-Nh for submit@debbugs.gnu.org; Tue, 13 Aug 2013 04:50:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AJ4-0001aX-0t for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:50:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9AIy-00019A-DN for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:50:21 -0400 Original-Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:41402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9AIy-00018l-4m for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2013 04:50:16 -0400 Original-Received: by mail-wg0-f47.google.com with SMTP id j13so6404527wgh.14 for ; Tue, 13 Aug 2013 01:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=3SZh8l4TyIMygBKWx1428GoXzYC1m9RGACBm6kJ0H1s=; b=Y460yVaQC2x34xmIyWz7ZpDpN7P+h6UmR+kSl6obRmGwVY5NKE3ZaZjiDqGPAJxm9E VwILuEhZQV00QlLMZ/kD6NwLuQCo8pdTUJvBSWYBQx5vr+RpP40r/5p+5u/UmfTyk4kI 9vC35mFvfuhI5PaO/Fcn/7zBYUGP0rtqJxJ2XVXdN1ZlvMyJngZir5qThBKOJsFyOmmJ xgnial3IhLtxo6iB5Y6S8fWu7gjcPXL3ELyYAEDhUBv+PvJJmEL6Yc2HfxImPyiVZSGJ pELorSDMEEoSTOHdWYFAOvW/NaLW2fh4aliGsdkGgmjV9ueLUC0NX3hZUCZglf5kUNU9 zI5g== X-Received: by 10.180.72.47 with SMTP id a15mr1902975wiv.63.1376383814930; Tue, 13 Aug 2013 01:50:14 -0700 (PDT) Original-Received: from dell-14z ([37.160.4.60]) by mx.google.com with ESMTPSA id nb12sm1831276wic.3.2013.08.13.01.50.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 01:50:14 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77307 Archived-At: Hi, as subject says, epg-context is let-bounded in org-crypt and then epg local set it in this context. Probably is should just be set as local var instead of being let bounded. diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index 2dfc4ad..bb77dc6 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/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 In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit) of 2013-06-20 on dell-14z Windowing system distributor `The X.Org Foundation', version 11.0.11103000 System Description: Ubuntu 12.04.2 LTS Configured using: `configure '--with-x-toolkit=lucid' '--without-toolkit-scroll-bars' '--without-gconf' '--without-gsettings'' Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: fr_FR.UTF-8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: recentf-mode: t TeX-PDF-mode: t git-gutter-mode: t winner-mode: t global-undo-tree-mode: t undo-tree-mode: t auto-image-file-mode: t show-paren-mode: t display-time-mode: t savehist-mode: t golden-ratio-mode: t minibuffer-depth-indicate-mode: t eldoc-mode: t diff-auto-refine-mode: t helm-mode: t helm-descbinds-mode: t shell-dirtrack-mode: t helm-adaptative-mode: t helm-match-plugin-mode: t tooltip-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f e n c C-c d C-x C-s C-x C-b C-x C-d C-z C-j C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-w q M-x r e p o r t Recent messages: org-decrypt: Enabling re-encryption on auto-save. Saving file /home/thierry/Encrypted/pwdthierry.org... Wrote /home/thierry/Encrypted/pwdthierry.org Loading /home/thierry/.emacs.d/recentf...done Cleaning up the recentf list...done (0 removed) Finding changes in /home/thierry/labo/emacs-savanah-git/lisp/org/org-crypt.el...done Finding changes in /home/thierry/labo/emacs-savanah-git/lisp/org/org-crypt.el...done Mark set byte-code: End of buffer [6 times] Saved text from "diff --git a/lisp/org/org-crypt.el b/lis" Load-path shadows: /usr/local/share/emacs/24.3/lisp/gnus/.dir-locals hides ~/elisp/magit/.dir-locals ~/elisp/auctex/lpath hides ~/elisp/emacs-wget/lpath ~/elisp/Emacs-wgrep/wgrep-ack hides ~/elisp/jenkins/emacs-wgrep/wgrep-ack ~/elisp/Emacs-wgrep/wgrep-helm hides ~/elisp/jenkins/emacs-wgrep/wgrep-helm ~/elisp/Emacs-wgrep/wgrep-test hides ~/elisp/jenkins/emacs-wgrep/wgrep-test ~/elisp/Emacs-wgrep/wgrep hides ~/elisp/jenkins/emacs-wgrep/wgrep /usr/local/share/emacs/24.3/lisp/emacs-lisp/tq hides ~/elisp/emms/lisp/tq ~/.emacs.d/.gnus hides ~/.emacs.d/emacs-config-laptop/.gnus Features: (shadow gnus-dired nnir mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win helm-ring emacsbug helm-command vc recentf ido preview prv-emacs tex-buf reftex-dcr reftex-auc reftex imenu reftex-vars font-latex latex tex-style tex dbus latexenc cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs conf-mode sh-script smie executable vc-dispatcher vc-rcs vc-git naquadah-theme em-smart em-unix em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-groups eshell esh-module esh-mode align-let git-gutter server package winner undo-tree diff slime-xref-browser slime-banner slime-tramp slime-asdf slime-fancy slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-parse slime-repl image-file newsticker newst-treeview tree-widget newst-plainview newst-reader newst-ticker newst-backend xdvi-search preview-latex pcomplete-extension em-term term disp-table ehelp electric helm-ipython helm-elisp helm-eval python rx whitespace paren time avoid savehist emamux golden-ratio smtpmail-async smtpmail sendmail helm-async persistent-sessions config-w3m w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util w3m-load boxquote markdown-mode iterator google-maps google-maps-static google-maps-geocode google-maps-base json simple-call-tree iedit-rect rect iedit iedit-lib zop-to-char smallurl mm-url gnus gnus-ems nnheader rectangle-utils ledger-config ledger esh-arg esh-util tv-utils async pcvs pcvs-parse pcvs-info pcvs-defs ewoc mb-depth ioccur cl-info slime hyperspec slime-autoloads tex-site auto-loads esh-toggle flymake eldoc-eval eldoc no-word dired-extension emms-mpd-config emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url hl-line emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mplayer emms-info emms-streams later-do emms-source-playlist emms-source-file emms-player-simple emms-setup emms emms-compat magit-blame magit-stgit magit-cherry magit-bisect magit-log-edit log-edit pcvs-util add-log magit-key-mode magit diff-mode magit-compat htmlize-hack htmlize muse-colors muse-docbook muse-texinfo texnfo-upd texinfo muse-latex muse-html muse-xml-common muse-wiki cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps wid-edit muse muse-nested-tags muse-mode muse-autoloads org-config-thierry ob-sh cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs vc-hg org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-agenda appt diary-lib diary-loaddefs org-annotation-helper org-capture org-mks remember org-remember org-datetree addressbook-bookmark message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader firefox-protocol bookmark-firefox-handler bookmark-extensions bookmark pp init-helm-thierry helm-mode helm-ls-git helm-descbinds helm-ls-hg helm-files image-dired tramp tramp-compat tramp-loaddefs shell dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap helm-plugin helm-help helm-match-plugin helm-grep wgrep-helm wgrep helm-regexp grep helm-external helm-utils dired compile helm-locate helm helm-config helm-aliases epa-file epa derived epg epg-config auth-source eieio gnus-util mm-util mail-prsvr password-cache usage-memo w3m-wget info cl-macs gv edmacro kmacro org-crypt org byte-opt warnings bytecomp byte-compile cconv ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-entities time-date noutline outline easy-mmode org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs format-spec find-func cal-menu easymenu calendar cal-loaddefs advice help-fns advice-preload net-utils cl cl-lib tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting font-render-setting x-toolkit x multi-tty emacs) -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997