From 49a656a409c705f79a70542265f87ec21e9d63c8 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 1 May 2015 14:28:15 +0200 Subject: [PATCH] ob-core: Remove `org-babel-src-name-w-name-regexp' * lisp/ob-core.el (org-babel-get-src-block-info): (org-babel-src-block-names): Use `org-babel-named-src-block-regexp-for-name' instead. --- lisp/ob-core.el | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c6a9046da..e4e1d9e51 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -187,14 +187,6 @@ This string must include a \"%s\" which will be replaced by the results." "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$" "Regular expression used to match multi-line header arguments.") -(defvar org-babel-src-name-w-name-regexp - (concat org-babel-src-name-regexp - "\\(" - org-babel-multi-line-header-regexp - "\\)*" - "\\([^()\f\t\n\r\v]+\\)") - "Regular expression matching source name lines with a name.") - (defvar org-babel-src-block-regexp (concat ;; (1) indentation (2) lang @@ -271,8 +263,8 @@ Returns a list (org-babel-merge-params (nth 2 info) (org-babel-parse-header-arguments (match-string 1))))) - (when (looking-at org-babel-src-name-w-name-regexp) - (setq name (org-no-properties (match-string 3))))) + (when (looking-at (org-babel-named-src-block-regexp-for-name)) + (setq name (org-match-string-no-properties 9)))) ;; inline source block (when (org-babel-get-inline-src-block-matches) (setq head (match-beginning 0)) @@ -1775,10 +1767,10 @@ to `org-babel-named-src-block-regexp'." (when file (find-file file)) (save-excursion (goto-char (point-min)) - (let (names) - (while (ignore-errors - (org-next-block 1 nil org-babel-src-name-w-name-regexp)) - (push (match-string 3) names)) + (let ((re (org-babel-named-src-block-regexp-for-name)) + names) + (while (ignore-errors (org-next-block 1 nil re)) + (push (org-match-string-no-properties 9) names)) names))) ;;;###autoload