From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.a.alfaro@gmail.com (Jorge A. Alfaro-Murillo) Subject: Re: An org password manager Date: Sun, 11 May 2014 13:13:39 -0400 Message-ID: <871tw0kzlo.fsf@gmail.com> References: <87d2fklwkv.fsf@gmail.com> <87iopcad7f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjXKC-0007oq-Jt for emacs-orgmode@gnu.org; Sun, 11 May 2014 13:14:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjXK4-0005Yk-E6 for emacs-orgmode@gnu.org; Sun, 11 May 2014 13:14:08 -0400 Received: from plane.gmane.org ([80.91.229.3]:43328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjXK4-0005Yg-6v for emacs-orgmode@gnu.org; Sun, 11 May 2014 13:14:00 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WjXK2-0004Oy-EX for emacs-orgmode@gnu.org; Sun, 11 May 2014 19:13:58 +0200 Received: from 66.87.125.201 ([66.87.125.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 May 2014 19:13:58 +0200 Received: from jorge.a.alfaro by 66.87.125.201 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 May 2014 19:13:58 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thanks Ramon, Regarding your question, probably the bug is related to running a for with all the buffers that are open. To get what you want you can try something creating a minor mode for gpg files and adding a hook that adds the buffer name of the gpg file that you open to a list of buffers to kill: #+BEGIN_SRC emacs-lisp (define-minor-mode gpg-killing-mode "A mode to kill gpg files" :after-hook (add-to-list 'gpg-buffers (buffer-name))) (add-to-list 'auto-mode-alist '("\\.gpg$" . gpg-killing-mode)) (setq gpg-buffers nil) (run-at-time t 120 '(lambda () (mapcar 'kill-buffer gpg-buffers) (setq gpg-buffers nil))) #+END_SRC Instead killing all at the same time, I would probably kill each one after a certain time, to avoid opening a file and have it right away killed it was close to the end of the 2 min cycle: #+BEGIN_SRC emacs-lisp (define-minor-mode gpg-killing-mode "A mode to kill gpg files" :after-hook (progn (setq gpg-buffers (append gpg-buffers (list (buffer-name)))) (run-at-time 120 nil '(lambda () (kill-buffer (car gpg-buffers)) (setq gpg-buffers (cdr gpg-buffers)))))) (add-to-list 'auto-mode-alist '("\\.gpg$" . gpg-killing-mode)) (setq gpg-buffers nil) #+END_SRC Best, Jorge.