Browse Source

adding default argument to org-babel-noweb-wrap

This makes it easier to keep consistent behavior.

* lisp/ob-tangle.el (org-babel-tangle-clean): Just use default value.
* lisp/ob.el (org-babel-noweb-wrap): Add default value.
  (org-babel-expand-noweb-references): Just use default value.
Eric Schulte 9 years ago
parent
commit
4b59c36b03
2 changed files with 6 additions and 6 deletions
  1. 1 1
      lisp/ob-tangle.el
  2. 5 5
      lisp/ob.el

+ 1 - 1
lisp/ob-tangle.el

@@ -281,7 +281,7 @@ references."
   (interactive)
   (goto-char (point-min))
   (while (or (re-search-forward "\\[\\[file:.*\\]\\[.*\\]\\]" nil t)
-             (re-search-forward (org-babel-noweb-wrap "[^[:space:]]*") nil t))
+             (re-search-forward (org-babel-noweb-wrap) nil t))
     (delete-region (save-excursion (beginning-of-line 1) (point))
                    (save-excursion (end-of-line 1) (forward-char 1) (point)))))
 

+ 5 - 5
lisp/ob.el

@@ -132,8 +132,10 @@ See also `org-babel-noweb-wrap-start'."
   :group 'org-babel
   :type 'string)
 
-(defun org-babel-noweb-wrap (regexp)
-  (concat org-babel-noweb-wrap-start regexp org-babel-noweb-wrap-end))
+(defun org-babel-noweb-wrap (&optional regexp)
+  (concat org-babel-noweb-wrap-start
+	  (or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)")
+	  org-babel-noweb-wrap-end))
 
 (defvar org-babel-src-name-regexp
   "^[ \t]*#\\+name:[ \t]*"
@@ -2178,9 +2180,7 @@ block but are passed literally to the \"example-block\"."
       (with-temp-buffer
         (insert body) (goto-char (point-min))
         (setq index (point))
-        (while (and (re-search-forward (org-babel-noweb-wrap
-					"\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)")
-				       nil t))
+        (while (and (re-search-forward (org-babel-noweb-wrap) nil t))
           (save-match-data (setf source-name (match-string 1)))
           (save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
           (save-match-data