Browse Source

customizable parameter to raise more noweb errors

* lisp/ob-core.el (org-babel-noweb-error-all-langs): Raise noweb
  errors regardless of language.
  (org-babel-expand-noweb-references): Make use of the new
  `org-babel-noweb-error-all-langs' variable.
Eric Schulte 10 years ago
parent
commit
6900ec41e3
1 changed files with 9 additions and 2 deletions
  1. 9 2
      lisp/ob-core.el

+ 9 - 2
lisp/ob-core.el

@@ -570,11 +570,17 @@ block.  Otherwise the output is marked as literal by inserting
 colons at the starts of the lines.  This variable only takes
 colons at the starts of the lines.  This variable only takes
 effect if the :results output option is in effect.")
 effect if the :results output option is in effect.")
 
 
+(defvar org-babel-noweb-error-all-langs nil
+  "Raise errors when noweb references don't resolve.
+Also see `org-babel-noweb-error-langs' to control noweb errors on
+a language by language bases.")
+
 (defvar org-babel-noweb-error-langs nil
 (defvar org-babel-noweb-error-langs nil
   "Languages for which Babel will raise literate programming errors.
   "Languages for which Babel will raise literate programming errors.
 List of languages for which errors should be raised when the
 List of languages for which errors should be raised when the
 source code block satisfying a noweb reference in this language
 source code block satisfying a noweb reference in this language
-can not be resolved.")
+can not be resolved.  Also see `org-babel-noweb-error-all-langs'
+to raise errors for all languages.")
 
 
 (defvar org-babel-hash-show 4
 (defvar org-babel-hash-show 4
   "Number of initial characters to show of a hidden results hash.")
   "Number of initial characters to show of a hidden results hash.")
@@ -2645,7 +2651,8 @@ block but are passed literally to the \"example-block\"."
                     (and expansion
                     (and expansion
                          (mapconcat #'identity (nreverse (cdr expansion)) "")))
                          (mapconcat #'identity (nreverse (cdr expansion)) "")))
                   ;; Possibly raise an error if named block doesn't exist.
                   ;; Possibly raise an error if named block doesn't exist.
-                  (if (member lang org-babel-noweb-error-langs)
+                  (if (or org-babel-noweb-error-all-langs
+			  (member lang org-babel-noweb-error-langs))
                       (error "%s" (concat
                       (error "%s" (concat
                                    (org-babel-noweb-wrap source-name)
                                    (org-babel-noweb-wrap source-name)
                                    "could not be resolved (see "
                                    "could not be resolved (see "