From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [PATCH] Don't ask "File changed on disk" in org-babel-post-tangle-hook Date: Fri, 07 Jun 2013 15:47:31 +0200 Message-ID: <87r4gejamk.fsf@krugs.de> References: <878v2omz5g.fsf@krugs.de> <51af4bfd.0c95ec0a.2372.097e@mx.google.com> <87ehcf6xey.fsf@gmail.com> <87ehcewdye.fsf@krugs.de> <87wqq6uxrg.fsf@krugs.de> <87fvwufat5.fsf_-_@gmail.com> <87zjv2uk9u.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukx9Q-00072v-32 for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukx9N-0002lA-06 for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:56:20 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:50347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukx0x-0008Pn-5B for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:47:35 -0400 Received: by mail-wg0-f43.google.com with SMTP id x12so3160379wgg.22 for ; Fri, 07 Jun 2013 06:47:34 -0700 (PDT) In-Reply-To: <87zjv2uk9u.fsf@gmail.com> (Eric Schulte's message of "Fri, 07 Jun 2013 07:23:41 -0600") 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: Eric Schulte Cc: Vitalie Spinu , emacs-orgmode@gnu.org Eric Schulte writes: > Vitalie Spinu writes: > >> The problem with org-babel-post-tangle-hook is that user is always asked >> yes-or-no-p for file reversion. Calling auto revert (as Rainer tried) >> will not help. >> >> The problem is in find-file-noselect in org-babel-find-file-noselect-refresh. >> >> The following patch fixes it by silencing find-file-noselect. Besides >> reversion question, there are a couple of other warning/questions that >> are silenced, but given that org-babel-find-file-noselect-refresh is >> used only for reverting tangled files, this is probably not an issue. >> > > Applied. Thanks, Thanks a lot. Will update then and try later. Thanks, Rainer > >> >> Vitalie >> >> >> From 2f408019b940c7e3b742dd2941f725f97645b868 Mon Sep 17 00:00:00 2001 >> From: Vitalie Spinu >> Date: Fri, 7 Jun 2013 12:43:55 +0200 >> Subject: [PATCH] avoid file warnings in org-babel-post-tangle-hook >> >> * lisp/ob-tangle.el (org-babel-find-file-noselect-refresh): call >> find-file-noselect with 'nowarn argument to surpress yes-or-no-p >> reversion message. >> --- >> lisp/ob-tangle.el | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el >> index 95d518a..82f2c10 100644 >> --- a/lisp/ob-tangle.el >> +++ b/lisp/ob-tangle.el >> @@ -114,7 +114,7 @@ result. The default value is `org-babel-trim'." >> (defun org-babel-find-file-noselect-refresh (file) >> "Find file ensuring that the latest changes on disk are >> represented in the file." >> - (find-file-noselect file) >> + (find-file-noselect file 'nowarn) >> (with-current-buffer (get-file-buffer file) >> (revert-buffer t t t))) <#secure method=pgpmime mode=sign> -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug