From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: org-babel-post-tangle-hook just opening tangled file Date: Wed, 08 Sep 2010 11:41:10 -0600 Message-ID: <87y6bcxhe1.fsf@gmail.com> References: <497246.59949.qm@web29013.mail.ird.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=58883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtOyn-00060g-Tw for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 14:02:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtOeH-0001SC-26 for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 13:41:30 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:38135) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtOeG-0001S7-W7 for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 13:41:29 -0400 Received: by vws16 with SMTP id 16so363819vws.0 for ; Wed, 08 Sep 2010 10:41:28 -0700 (PDT) In-Reply-To: <497246.59949.qm@web29013.mail.ird.yahoo.com> (Miguel Ruiz's message of "Wed, 8 Sep 2010 09:46:44 +0000 (GMT)") 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: Miguel Ruiz Cc: emacs-orgmode@gnu.org Hi Miguel, The hook is run as part of the tangle process, and the tangle process ensures that if the tangled file was not open before tangling it will not be open after tangling, so the code you pasted below will have no effect. You could use the following function instead of ob-tangle to get the behavior you've described. (defun schulte/tangle-then-open () (interactive) (mapc #'find-file (org-babel-tangle))) Best -- Eric Miguel Ruiz writes: > Hi > > Should > > (add-hook 'org-babel-post-tangle-hook > (lambda () (save-window-excursion > (find-file (buffer-file-name))))) > > work in .emacs? > > The purpose is simply opening the tangled file but I think the opening > happens before the tangled file has finished of being written. > > I have tried > > (add-hook 'org-babel-post-tangle-hook > (lambda () (save-window-excursion > (find-file "anyfile")))) > > and no problem, but the first code does nothing, apparently. > > I am a beginner with elisp, so I beg your pardon. > > Miguel Ruiz. > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode