From: Ramon Diaz-Uriarte <rdiaz02@gmail.com>
To: "Jorge A. Alfaro-Murillo" <jorge.a.alfaro@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: An org password manager
Date: Mon, 12 May 2014 10:22:15 +0200 [thread overview]
Message-ID: <87fvkf9zk8.fsf@gmail.com> (raw)
In-Reply-To: <87siogjkp2.fsf@gmail.com>
Hola Jorge,
On Sun, 11-05-2014, at 19:20, Jorge A. Alfaro-Murillo <jorge.a.alfaro@gmail.com> wrote:
> jorge.a.alfaro@gmail.com (Jorge A. Alfaro-Murillo) writes:
>
> I forgot to mention that what org-passwords.el does is to set a timer
> each time that the password file is opened (analogous to the second
> option in my previous message) rather than having just one timer with
> repeat.
You are right! (I've been using this for over 3 years and hadn't realized
the obvious). The timer is always running (even before any gpg file is
opened), so I can end up with the unlikely coincidence of it firing right
when I open a gpg file.
It won't if I do as you suggest. Thanks!!!
Best,
R.
>
> Jorge.
>
>> 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.
--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-25
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain
Phone: +34-91-497-2412
Email: rdiaz02@gmail.com
ramon.diaz@iib.uam.es
http://ligarto.org/rdiaz
next prev parent reply other threads:[~2014-05-12 8:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 5:21 An org password manager Jorge A. Alfaro-Murillo
2014-05-11 5:47 ` Igor Sosa Mayor
2014-05-11 9:15 ` Ramon Diaz-Uriarte
2014-05-11 13:56 ` Colin Baxter
2014-05-12 8:20 ` Ramon Diaz-Uriarte
2014-05-12 14:35 ` Colin Baxter
2014-05-12 22:12 ` Ramon Diaz-Uriarte
2014-05-13 11:51 ` Colin Baxter
2014-05-13 12:40 ` Jorge A. Alfaro-Murillo
2014-05-14 10:01 ` Colin Baxter
2014-05-16 13:03 ` Ramon Diaz-Uriarte
2014-05-11 17:13 ` Jorge A. Alfaro-Murillo
2014-05-11 17:20 ` Jorge A. Alfaro-Murillo
2014-05-12 8:22 ` Ramon Diaz-Uriarte [this message]
2014-05-12 20:51 ` Cayetano Santos
2014-05-21 7:32 ` Bastien
2014-05-21 11:53 ` Michael Albinus
2014-06-05 14:36 ` Jorge A. Alfaro-Murillo
2014-06-06 9:39 ` Michael Albinus
2014-05-31 16:09 ` Jorge A. Alfaro-Murillo
2014-06-01 19:17 ` Bastien
2014-06-02 17:38 ` Bastien
2014-06-02 17:53 ` Jorge A. Alfaro-Murillo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fvkf9zk8.fsf@gmail.com \
--to=rdiaz02@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=jorge.a.alfaro@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).