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.
This commit is contained in:
Nicolas Goaziou 2015-05-01 14:28:15 +02:00
parent cec47a635e
commit 49a656a409
1 changed files with 6 additions and 14 deletions

View File

@ -187,14 +187,6 @@ This string must include a \"%s\" which will be replaced by the results."
"^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$" "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$"
"Regular expression used to match multi-line header arguments.") "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 (defvar org-babel-src-block-regexp
(concat (concat
;; (1) indentation (2) lang ;; (1) indentation (2) lang
@ -271,8 +263,8 @@ Returns a list
(org-babel-merge-params (org-babel-merge-params
(nth 2 info) (nth 2 info)
(org-babel-parse-header-arguments (match-string 1))))) (org-babel-parse-header-arguments (match-string 1)))))
(when (looking-at org-babel-src-name-w-name-regexp) (when (looking-at (org-babel-named-src-block-regexp-for-name))
(setq name (org-no-properties (match-string 3))))) (setq name (org-match-string-no-properties 9))))
;; inline source block ;; inline source block
(when (org-babel-get-inline-src-block-matches) (when (org-babel-get-inline-src-block-matches)
(setq head (match-beginning 0)) (setq head (match-beginning 0))
@ -1775,10 +1767,10 @@ to `org-babel-named-src-block-regexp'."
(when file (find-file file)) (when file (find-file file))
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(let (names) (let ((re (org-babel-named-src-block-regexp-for-name))
(while (ignore-errors names)
(org-next-block 1 nil org-babel-src-name-w-name-regexp)) (while (ignore-errors (org-next-block 1 nil re))
(push (match-string 3) names)) (push (org-match-string-no-properties 9) names))
names))) names)))
;;;###autoload ;;;###autoload