From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [bug] void-function org-babel-named-data-regexp-for-name Date: Fri, 02 Dec 2011 10:02:08 +0100 Message-ID: <80ty5j73e7.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, When exporting a document containing calls to code blocks located in my LOB (here: `vc-indicator'), I have -- with latest Org version -- a new problem = (I mean, it wasn't there a couple of days ago): Debugger entered--Lisp error: (void-function org-babel-named-data-regexp-= for-name) It seems to me that there is a missing (require 'ob) in org-export (?). Loading manually `ob.el' does solve that particular problem. Best regards, Seb #+begin_src text Debugger entered--Lisp error: (void-function org-babel-named-data-regexp-fo= r-name) (org-babel-named-data-regexp-for-name ref) (let ((src-rx (org-babel-named-src-block-regexp-for-name ref)) (res-rx (o= rg-babel-named-data-regexp-for-name ref))) (or (re-search-forward src-rx ni= l t) (re-search-forward res-rx nil t) (setq id (org-babel-ref-goto-headline= -id ref)) (setq lob-info (cdr (assoc (intern ref) org-babel-library-of-babe= l))))) (if (let ((src-rx (org-babel-named-src-block-regexp-for-name ref)) (res-r= x (org-babel-named-data-regexp-for-name ref))) (or (re-search-forward src-r= x nil t) (re-search-forward res-rx nil t) (setq id (org-babel-ref-goto-head= line-id ref)) (setq lob-info (cdr (assoc (intern ref) org-babel-library-of-= babel))))) (unless (or lob-info id) (goto-char (match-beginning 0))) (error= "reference '%s' not found in this buffer" ref)) (save-restriction (widen) (goto-char (point-min)) (if (let ((src-rx (org-= babel-named-src-block-regexp-for-name ref)) (res-rx (org-babel-named-data-r= egexp-for-name ref))) (or (re-search-forward src-rx nil t) (re-search-forwa= rd res-rx nil t) (setq id (org-babel-ref-goto-headline-id ref)) (setq lob-i= nfo (cdr (assoc (intern ref) org-babel-library-of-babel))))) (unless (or lo= b-info id) (goto-char (match-beginning 0))) (error "reference '%s' not foun= d in this buffer" ref)) (cond (lob-info (setq type (quote lob))) (id (setq = type (quote id))) ((and (looking-at org-babel-src-name-regexp) (save-excurs= ion (forward-line 1) (or (looking-at org-babel-src-block-regexp) (looking-a= t org-babel-multi-line-header-regexp)))) (setq type (quote source-block))) = (t (while (not (setq type (org-babel-ref-at-ref-p))) (forward-line 1) (begi= nning-of-line) (if (or (=3D (point) (point-min)) (=3D (point) (point-max)))= (error "reference not found"))))) (let ((params (append args (quote ((:res= ults . "silent")))))) (setq result (case type (results-line (org-babel-read= -result)) (table (org-babel-read-table)) (list (org-babel-read-list)) (file= (org-babel-read-link)) (source-block (org-babel-execute-src-block nil nil = (if org-babel-update-intermediate nil params))) (lob (org-babel-execute-src= -block nil lob-info params)) (id (org-babel-ref-headline-body))))) (if (sym= bolp result) (format "%S" result) (if (and index (listp result)) (org-babel= -ref-index-list index result) result))) (let ((case-fold-search t) type args new-refere new-header-args new-refer= ent result lob-info split-file split-ref index index-row index-col id) (whe= n (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str (substring ref = 0 (match-beginning 0)))) (=3D (org-count 40 str) (org-count 41 str)))) (set= q index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0= )))) (when (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))= $" ref) (setq new-refere (match-string 1 ref)) (setq new-header-args (match= -string 3 ref)) (setq new-referent (match-string 5 ref)) (when (> (length n= ew-refere) 0) (when (> (length new-referent) 0) (setq args (mapcar (lambda = (ref) (cons :var ref)) (org-babel-ref-split-args new-referent)))) (when (> = (length new-header-args) 0) (setq args (append (org-babel-parse-header-argu= ments new-header-args) args))) (setq ref new-refere))) (when (string-match = "^\\(.+\\):\\(.+\\)$" ref) (setq split-file (match-string 1 ref)) (setq spl= it-ref (match-string 2 ref)) (find-file split-file) (setq ref split-ref)) (= save-restriction (widen) (goto-char (point-min)) (if (let ((src-rx (org-bab= el-named-src-block-regexp-for-name ref)) (res-rx (org-babel-named-data-rege= xp-for-name ref))) (or (re-search-forward src-rx nil t) (re-search-forward = res-rx nil t) (setq id (org-babel-ref-goto-headline-id ref)) (setq lob-info= (cdr (assoc ... org-babel-library-of-babel))))) (unless (or lob-info id) (= goto-char (match-beginning 0))) (error "reference '%s' not found in this bu= ffer" ref)) (cond (lob-info (setq type (quote lob))) (id (setq type (quote = id))) ((and (looking-at org-babel-src-name-regexp) (save-excursion (forward= -line 1) (or (looking-at org-babel-src-block-regexp) (looking-at org-babel-= multi-line-header-regexp)))) (setq type (quote source-block))) (t (while (n= ot (setq type (org-babel-ref-at-ref-p))) (forward-line 1) (beginning-of-lin= e) (if (or (=3D ... ...) (=3D ... ...)) (error "reference not found"))))) (= let ((params (append args (quote (...))))) (setq result (case type (results= -line (org-babel-read-result)) (table (org-babel-read-table)) (list (org-ba= bel-read-list)) (file (org-babel-read-link)) (source-block (org-babel-execu= te-src-block nil nil (if org-babel-update-intermediate nil params))) (lob (= org-babel-execute-src-block nil lob-info params)) (id (org-babel-ref-headli= ne-body))))) (if (symbolp result) (format "%S" result) (if (and index (list= p result)) (org-babel-ref-index-list index result) result)))) (save-excursion (let ((case-fold-search t) type args new-refere new-heade= r-args new-referent result lob-info split-file split-ref index index-row in= dex-col id) (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str= (substring ref 0 ...))) (=3D (org-count 40 str) (org-count 41 str)))) (set= q index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0= )))) (when (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))= $" ref) (setq new-refere (match-string 1 ref)) (setq new-header-args (match= -string 3 ref)) (setq new-referent (match-string 5 ref)) (when (> (length n= ew-refere) 0) (when (> (length new-referent) 0) (setq args (mapcar (lambda = ... ...) (org-babel-ref-split-args new-referent)))) (when (> (length new-he= ader-args) 0) (setq args (append (org-babel-parse-header-arguments new-head= er-args) args))) (setq ref new-refere))) (when (string-match "^\\(.+\\):\\(= .+\\)$" ref) (setq split-file (match-string 1 ref)) (setq split-ref (match-= string 2 ref)) (find-file split-file) (setq ref split-ref)) (save-restricti= on (widen) (goto-char (point-min)) (if (let ((src-rx (org-babel-named-src-b= lock-regexp-for-name ref)) (res-rx (org-babel-named-data-regexp-for-name re= f))) (or (re-search-forward src-rx nil t) (re-search-forward res-rx nil t) = (setq id (org-babel-ref-goto-headline-id ref)) (setq lob-info (cdr ...)))) = (unless (or lob-info id) (goto-char (match-beginning 0))) (error "reference= '%s' not found in this buffer" ref)) (cond (lob-info (setq type (quote lob= ))) (id (setq type (quote id))) ((and (looking-at org-babel-src-name-regexp= ) (save-excursion (forward-line 1) (or ... ...))) (setq type (quote source-= block))) (t (while (not (setq type ...)) (forward-line 1) (beginning-of-lin= e) (if (or ... ...) (error "reference not found"))))) (let ((params (append= args (quote ...)))) (setq result (case type (results-line (org-babel-read-= result)) (table (org-babel-read-table)) (list (org-babel-read-list)) (file = (org-babel-read-link)) (source-block (org-babel-execute-src-block nil nil .= ..)) (lob (org-babel-execute-src-block nil lob-info params)) (id (org-babel= -ref-headline-body))))) (if (symbolp result) (format "%S" result) (if (and = index (listp result)) (org-babel-ref-index-list index result) result))))) (progn (save-excursion (let ((case-fold-search t) type args new-refere ne= w-header-args new-referent result lob-info split-file split-ref index index= -row index-col id) (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (le= t ((str ...)) (=3D (org-count 40 str) (org-count 41 str)))) (setq index (ma= tch-string 1 ref)) (setq ref (substring ref 0 (match-beginning 0)))) (when = (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (se= tq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 r= ef)) (setq new-referent (match-string 5 ref)) (when (> (length new-refere) = 0) (when (> (length new-referent) 0) (setq args (mapcar ... ...))) (when (>= (length new-header-args) 0) (setq args (append ... args))) (setq ref new-r= efere))) (when (string-match "^\\(.+\\):\\(.+\\)$" ref) (setq split-file (m= atch-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-= file) (setq ref split-ref)) (save-restriction (widen) (goto-char (point-min= )) (if (let ((src-rx ...) (res-rx ...)) (or (re-search-forward src-rx nil t= ) (re-search-forward res-rx nil t) (setq id ...) (setq lob-info ...))) (unl= ess (or lob-info id) (goto-char (match-beginning 0))) (error "reference '%s= ' not found in this buffer" ref)) (cond (lob-info (setq type (quote lob))) = (id (setq type (quote id))) ((and (looking-at org-babel-src-name-regexp) (s= ave-excursion ... ...)) (setq type (quote source-block))) (t (while (not ..= .) (forward-line 1) (beginning-of-line) (if ... ...)))) (let ((params (appe= nd args ...))) (setq result (case type (results-line ...) (table ...) (list= ...) (file ...) (source-block ...) (lob ...) (id ...)))) (if (symbolp resu= lt) (format "%S" result) (if (and index (listp result)) (org-babel-ref-inde= x-list index result) result)))))) (unwind-protect (progn (save-excursion (let ((case-fold-search t) type ar= gs new-refere new-header-args new-referent result lob-info split-file split= -ref index index-row index-col id) (when (and (string-match "\\[\\([^\\[]+\= \)\\]$" ref) (let (...) (=3D ... ...))) (setq index (match-string 1 ref)) (= setq ref (substring ref 0 (match-beginning 0)))) (when (string-match "^\\(.= +?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (setq new-refere (match= -string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-refer= ent (match-string 5 ref)) (when (> (length new-refere) 0) (when (> ... 0) (= setq args ...)) (when (> ... 0) (setq args ...)) (setq ref new-refere))) (w= hen (string-match "^\\(.+\\):\\(.+\\)$" ref) (setq split-file (match-string= 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (setq= ref split-ref)) (save-restriction (widen) (goto-char (point-min)) (if (let= (... ...) (or ... ... ... ...)) (unless (or lob-info id) (goto-char ...)) = (error "reference '%s' not found in this buffer" ref)) (cond (lob-info (set= q type ...)) (id (setq type ...)) ((and ... ...) (setq type ...)) (t (while= ... ... ... ...))) (let ((params ...)) (setq result (case type ... ... ...= ... ... ... ...))) (if (symbolp result) (format "%S" result) (if (and inde= x ...) (org-babel-ref-index-list index result) result)))))) (set-window-con= figuration wconfig)) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (s= ave-excursion (let ((case-fold-search t) type args new-refere new-header-ar= gs new-referent result lob-info split-file split-ref index index-row index-= col id) (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ... ...))= (setq index (match-string 1 ref)) (setq ref (substring ref 0 ...))) (when = (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref) (se= tq new-refere (match-string 1 ref)) (setq new-header-args (match-string 3 r= ef)) (setq new-referent (match-string 5 ref)) (when (> ... 0) (when ... ...= ) (when ... ...) (setq ref new-refere))) (when (string-match "^\\(.+\\):\\(= .+\\)$" ref) (setq split-file (match-string 1 ref)) (setq split-ref (match-= string 2 ref)) (find-file split-file) (setq ref split-ref)) (save-restricti= on (widen) (goto-char (point-min)) (if (let ... ...) (unless ... ...) (erro= r "reference '%s' not found in this buffer" ref)) (cond (lob-info ...) (id = ...) (... ...) (t ...)) (let (...) (setq result ...)) (if (symbolp result) = (format "%S" result) (if ... ... result)))))) (set-window-configuration wco= nfig))) (save-window-excursion (save-excursion (let ((case-fold-search t) type ar= gs new-refere new-header-args new-referent result lob-info split-file split= -ref index index-row index-col id) (when (and (string-match "\\[\\([^\\[]+\= \)\\]$" ref) (let ((str ...)) (=3D (org-count 40 str) (org-count 41 str))))= (setq index (match-string 1 ref)) (setq ref (substring ref 0 (match-beginn= ing 0)))) (when (string-match "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.= *\\))$" ref) (setq new-refere (match-string 1 ref)) (setq new-header-args (= match-string 3 ref)) (setq new-referent (match-string 5 ref)) (when (> (len= gth new-refere) 0) (when (> (length new-referent) 0) (setq args (mapcar ...= ...))) (when (> (length new-header-args) 0) (setq args (append ... args)))= (setq ref new-refere))) (when (string-match "^\\(.+\\):\\(.+\\)$" ref) (se= tq split-file (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (= find-file split-file) (setq ref split-ref)) (save-restriction (widen) (goto= -char (point-min)) (if (let ((src-rx ...) (res-rx ...)) (or (re-search-forw= ard src-rx nil t) (re-search-forward res-rx nil t) (setq id ...) (setq lob-= info ...))) (unless (or lob-info id) (goto-char (match-beginning 0))) (erro= r "reference '%s' not found in this buffer" ref)) (cond (lob-info (setq typ= e (quote lob))) (id (setq type (quote id))) ((and (looking-at org-babel-src= -name-regexp) (save-excursion ... ...)) (setq type (quote source-block))) (= t (while (not ...) (forward-line 1) (beginning-of-line) (if ... ...)))) (le= t ((params (append args ...))) (setq result (case type (results-line ...) (= table ...) (list ...) (file ...) (source-block ...) (lob ...) (id ...)))) (= if (symbolp result) (format "%S" result) (if (and index (listp result)) (or= g-babel-ref-index-list index result) result)))))) org-babel-ref-resolve("vc-indicator()") #+end_src --=20 Sebastien Vauban