From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "armando.fella" Newsgroups: gmane.emacs.help Subject: auto encrypt .gpg file Date: Wed, 5 Jun 2013 10:33:42 -0700 (PDT) Message-ID: <1370453622565-287896.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1370454171 14673 80.91.229.3 (5 Jun 2013 17:42:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2013 17:42:51 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 05 19:42:52 2013 Return-path: Envelope-to: geh-help-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 1UkHjY-0004iH-0D for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jun 2013 19:42:52 +0200 Original-Received: from localhost ([::1]:32908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkHjX-0004dg-M1 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jun 2013 13:42:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkHaq-0000fy-5F for Help-gnu-emacs@gnu.org; Wed, 05 Jun 2013 13:33:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkHai-0002rW-57 for Help-gnu-emacs@gnu.org; Wed, 05 Jun 2013 13:33:52 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:40435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkHai-0002r4-09 for Help-gnu-emacs@gnu.org; Wed, 05 Jun 2013 13:33:44 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UkHag-0007nx-IS for Help-gnu-emacs@gnu.org; Wed, 05 Jun 2013 10:33:42 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Wed, 05 Jun 2013 13:41:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91329 Archived-At: Hi all, I inserted the following code lines in the init.el to obtain an auto decryption on editing .gpg files and an auto encrypt at seve/close file tim= e with emacs-24.2-18.fc18.x86_64 on a fedora 18. - emacs asks for the passphrase. Afterword reports the following message after =E2=80=9CPackage pgg-gpg is obsolete!=E2=80=9D=20 - I edited the decrypted file in emacs=20 - When I save it emacs reports: =E2=80=9CSymbol=E2=80=99s value as variable= is void: pgg-text-mode=E2=80=9D and forced me to quit without saving the file conten= t Do you have any hint to solve the problem? Thanks a lot, Armando (defvar pgg-gpg-user-id "YOUR-ID-HERE") (autoload 'pgg-make-temp-file "pgg" "PGG") (autoload 'pgg-gpg-decrypt-region "pgg-gpg" "PGG GnuPG") (define-generic-mode 'gpg-file-mode (list ?#)=20 nil nil '(".gpg\\'" ".gpg-encrypted\\'") (list (lambda () =09 (add-hook 'before-save-hook (lambda ()=20 (let ((pgg-output-buffer (current-buffer))) (pgg-gpg-encrypt-region (point-min) (point-max) (list pgg-gpg-user-id)))) nil t) =09 (add-hook 'after-save-hook=20 =09=09 (lambda () (let ((pgg-output-buffer (current-buffer))) (pgg-gpg-decrypt-region (point-min) (point-max))) =09=09=09(set-buffer-modified-p nil) =09=09=09(auto-save-mode nil)) =09=09 nil t) (let ((pgg-output-buffer (current-buffer))) (pgg-gpg-decrypt-region (point-min) (point-max))) =09 (auto-save-mode nil) =09 (set-buffer-modified-p nil))) "Mode for gpg encrypted files") source: http://www.emacswiki.org/emacs/AutoEncryption -- View this message in context: http://emacs.1067599.n5.nabble.com/auto-encry= pt-gpg-file-tp287896.html Sent from the Emacs - Help mailing list archive at Nabble.com.