From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Zacchiroli Subject: Re: org-remember-AFTER-finalize-hook , anyone? Date: Sun, 31 Jan 2010 00:45:01 +0100 Message-ID: <20100130234501.GA16336@usha.takhisis.invalid> References: <20100130165419.GA9466@usha.takhisis.invalid> <2a4ba2fd1001301023g6ab70661l529733de212f2b64@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NbN00-0006ua-E1 for emacs-orgmode@gnu.org; Sat, 30 Jan 2010 18:45:08 -0500 Received: from [199.232.76.173] (port=49541 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbN00-0006uS-1O for emacs-orgmode@gnu.org; Sat, 30 Jan 2010 18:45:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NbMzy-00068E-J7 for emacs-orgmode@gnu.org; Sat, 30 Jan 2010 18:45:07 -0500 Received: from fettunta.fettunta.org ([67.207.129.222]:52962) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NbMzy-000688-8H for emacs-orgmode@gnu.org; Sat, 30 Jan 2010 18:45:06 -0500 Received: from usha.takhisis.invalid (unknown [10.17.0.10]) by fettunta.fettunta.org (Postfix) with ESMTPS id BE03C185CA for ; Sat, 30 Jan 2010 23:45:04 +0000 (UTC) Content-Disposition: inline In-Reply-To: <2a4ba2fd1001301023g6ab70661l529733de212f2b64@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Sat, Jan 30, 2010 at 10:23:20AM -0800, Ryan Thompson wrote: > Ooh, I solved this problem before, but then I accidentally deleted all = my > files. I have a backup, but I haven't gotten around to restoring everyt= hing > yet. I'll get back to you later. In the meantime, I've implemented a workaround, based on the following idea: (add-hook 'org-remember-mode-hook 'delete-other-windows) (defadvice org-remember-finalize (after delete-frame-at-end activate) "Delete frame at remember finalization" (delete-frame)) (defadvice org-remember-kill (after delete-frame-at-end activate) "Delete frame at remember abort" (delete-frame)) It works properly, but it assumes that org-remember is invoked only externally via org-protocol (i.e. if I invoke org-remember by hand I risk my frame). So I've conceived the following horror to constraint the effect to org-protocol invocation (yes, with a serious race condition involved): (add-hook 'org-remember-mode-hook 'delete-other-windows) (setq my-org-protocol-flag nil) (defadvice org-remember-finalize (after delete-frame-at-end activate) "Delete frame at remember finalization" (progn (if my-org-protocol-flag (delete-frame)) (setq my-org-protocol-flag nil))) (defadvice org-remember-kill (after delete-frame-at-end activate) "Delete frame at remember abort" (progn (if my-org-protocol-flag (delete-frame)) (setq my-org-protocol-flag nil))) (defadvice org-protocol-remember (before set-org-protocol-flag activate= ) (setq my-org-protocol-flag t)) Any suggestions on how to achieve the same result in a more proper way will be appreciated ... Cheers. --=20 Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'=E8 ..| . |. Et ne m'en veux pas si je te tutoi= e sempre uno zaino ...........| ..: |.... Je dis tu =E0 tous ceux que j'aim= e