[O] [PATCH] Don't prompt for bad links during babel export.

2011-05-05 Thread rpgoldman
From: Robert P. Goldman rpgold...@real-time.com

Previously, when trying to look for the header of a source block during
export, org would prompt the user to add a new heading if it couldn't
find a match.  This prompt is not appropriate for non-interactive use.

Patch to org-babel-exp-in-export-file macro to bind
org-link-search-inhibit-query.
---

Here's a patch I found the need for while I was debugging the org-babel
export on included files.  When org-babel was unable to find a link during
its search for header arguments, it would inappropriately 
prompt me to create that header!

 lisp/ob-exp.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 20a7cda..d700f6d 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -93,7 +93,8 @@ source block function.)
(set-buffer (get-file-buffer org-current-export-file))
(save-restriction
 (condition-case nil
-(org-open-link-from-string link)
+(let ((org-link-search-inhibit-query t))
+  (org-open-link-from-string link))
   (error (when heading
(goto-char (point-min))
(re-search-forward (regexp-quote heading) nil t
-- 
1.7.3.5




Re: [O] [PATCH] Don't prompt for bad links during babel export.

2011-05-05 Thread Eric Schulte
Applied.  Thanks for the patch -- Eric

rpgold...@sift.info writes:

 From: Robert P. Goldman rpgold...@real-time.com

 Previously, when trying to look for the header of a source block during
 export, org would prompt the user to add a new heading if it couldn't
 find a match.  This prompt is not appropriate for non-interactive use.

 Patch to org-babel-exp-in-export-file macro to bind
 org-link-search-inhibit-query.
 ---

 Here's a patch I found the need for while I was debugging the org-babel
 export on included files.  When org-babel was unable to find a link during
 its search for header arguments, it would inappropriately 
 prompt me to create that header!

  lisp/ob-exp.el |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

 diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
 index 20a7cda..d700f6d 100644
 --- a/lisp/ob-exp.el
 +++ b/lisp/ob-exp.el
 @@ -93,7 +93,8 @@ source block function.)
 (set-buffer (get-file-buffer org-current-export-file))
 (save-restriction
(condition-case nil
 -  (org-open-link-from-string link)
 +  (let ((org-link-search-inhibit-query t))
 +(org-open-link-from-string link))
  (error (when heading
   (goto-char (point-min))
   (re-search-forward (regexp-quote heading) nil t

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/