From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [bug] void-function org-babel-named-data-regexp-for-name Date: Sat, 03 Dec 2011 07:46:38 -0700 Message-ID: <87liqtlnas.fsf@gmx.com> References: <80ty5j73e7.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWqxe-0004ti-EN for emacs-orgmode@gnu.org; Sat, 03 Dec 2011 09:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWqxc-0003TB-9c for emacs-orgmode@gnu.org; Sat, 03 Dec 2011 09:53:06 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:35490) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RWqxc-0003T2-41 for emacs-orgmode@gnu.org; Sat, 03 Dec 2011 09:53:04 -0500 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org Hi Seb, The `org-babel-named-data-regexp-for-name' function is called by ob-ref.el which *does* require ob.el. I'm not sure why this require isn't being run on your system. Could you try a make clean and then restarting Emacs and see if the problem was caused by old inconsistent .elc files? Thanks, "Sebastien Vauban" writes: > Hello, > > When exporting a document containing calls to code blocks located in my L= OB > (here: `vc-indicator'), I have -- with latest Org version -- a new proble= m (I > mean, it wasn't there a couple of days ago): > > Debugger entered--Lisp error: (void-function org-babel-named-data-regex= p-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-= for-name) > (org-babel-named-data-regexp-for-name ref) > (let ((src-rx (org-babel-named-src-block-regexp-for-name ref)) (res-rx = (org-babel-named-data-regexp-for-name ref))) (or (re-search-forward src-rx = nil t) (re-search-forward res-rx nil t) (setq id (org-babel-ref-goto-headli= ne-id ref)) (setq lob-info (cdr (assoc (intern ref) org-babel-library-of-ba= bel))))) > (if (let ((src-rx (org-babel-named-src-block-regexp-for-name ref)) (res= -rx (org-babel-named-data-regexp-for-name ref))) (or (re-search-forward src= -rx nil t) (re-search-forward res-rx nil t) (setq id (org-babel-ref-goto-he= adline-id ref)) (setq lob-info (cdr (assoc (intern ref) org-babel-library-o= f-babel))))) (unless (or lob-info id) (goto-char (match-beginning 0))) (err= or "reference '%s' not found in this buffer" ref)) > (save-restriction (widen) (goto-char (point-min)) (if (let ((src-rx (or= g-babel-named-src-block-regexp-for-name ref)) (res-rx (org-babel-named-data= -regexp-for-name ref))) (or (re-search-forward src-rx nil t) (re-search-for= ward res-rx nil t) (setq id (org-babel-ref-goto-headline-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 fo= und in this buffer" ref)) (cond (lob-info (setq type (quote lob))) (id (set= q type (quote id))) ((and (looking-at org-babel-src-name-regexp) (save-excu= rsion (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 (not (setq type (org-babel-ref-at-ref-p))) (forward-line 1) (be= ginning-of-line) (if (or (=3D (point) (point-min)) (=3D (point) (point-max)= )) (error "reference not found"))))) (let ((params (append args (quote ((:r= esults . "silent")))))) (setq result (case type (results-line (org-babel-re= ad-result)) (table (org-babel-read-table)) (list (org-babel-read-list)) (fi= le (org-babel-read-link)) (source-block (org-babel-execute-src-block nil ni= l (if org-babel-update-intermediate nil params))) (lob (org-babel-execute-s= rc-block nil lob-info params)) (id (org-babel-ref-headline-body))))) (if (s= ymbolp result) (format "%S" result) (if (and index (listp result)) (org-bab= el-ref-index-list index result) result))) > (let ((case-fold-search t) type args new-refere new-header-args new-ref= erent result lob-info split-file split-ref index index-row index-col id) (w= hen (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((str (substring re= f 0 (match-beginning 0)))) (=3D (org-count 40 str) (org-count 41 str)))) (s= etq 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 (mat= ch-string 3 ref)) (setq new-referent (match-string 5 ref)) (when (> (length= new-refere) 0) (when (> (length new-referent) 0) (setq args (mapcar (lambd= a (ref) (cons :var ref)) (org-babel-ref-split-args new-referent)))) (when (= > (length new-header-args) 0) (setq args (append (org-babel-parse-header-ar= guments new-header-args) args))) (setq ref new-refere))) (when (string-matc= h "^\\(.+\\):\\(.+\\)$" ref) (setq split-file (match-string 1 ref)) (setq s= plit-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-b= abel-named-src-block-regexp-for-name ref)) (res-rx (org-babel-named-data-re= gexp-for-name ref))) (or (re-search-forward src-rx nil t) (re-search-forwar= d res-rx nil t) (setq id (org-babel-ref-goto-headline-id ref)) (setq lob-in= fo (cdr (assoc ... org-babel-library-of-babel))))) (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 (quot= e id))) ((and (looking-at org-babel-src-name-regexp) (save-excursion (forwa= rd-line 1) (or (looking-at org-babel-src-block-regexp) (looking-at org-babe= l-multi-line-header-regexp)))) (setq type (quote source-block))) (t (while = (not (setq type (org-babel-ref-at-ref-p))) (forward-line 1) (beginning-of-l= ine) (if (or (=3D ... ...) (=3D ... ...)) (error "reference not found")))))= (let ((params (append args (quote (...))))) (setq result (case type (resul= ts-line (org-babel-read-result)) (table (org-babel-read-table)) (list (org-= babel-read-list)) (file (org-babel-read-link)) (source-block (org-babel-exe= cute-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-head= line-body))))) (if (symbolp result) (format "%S" result) (if (and index (li= stp result)) (org-babel-ref-index-list index result) result)))) > (save-excursion (let ((case-fold-search t) type args new-refere new-hea= der-args new-referent result lob-info split-file split-ref index index-row = index-col id) (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ((s= tr (substring ref 0 ...))) (=3D (org-count 40 str) (org-count 41 str)))) (s= etq 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 (mat= ch-string 3 ref)) (setq new-referent (match-string 5 ref)) (when (> (length= new-refere) 0) (when (> (length new-referent) 0) (setq args (mapcar (lambd= a ... ...) (org-babel-ref-split-args new-referent)))) (when (> (length new-= header-args) 0) (setq args (append (org-babel-parse-header-arguments new-he= ader-args) args))) (setq ref new-refere))) (when (string-match "^\\(.+\\):\= \(.+\\)$" ref) (setq split-file (match-string 1 ref)) (setq split-ref (matc= h-string 2 ref)) (find-file split-file) (setq ref split-ref)) (save-restric= tion (widen) (goto-char (point-min)) (if (let ((src-rx (org-babel-named-src= -block-regexp-for-name ref)) (res-rx (org-babel-named-data-regexp-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 ...)))= ) (unless (or lob-info id) (goto-char (match-beginning 0))) (error "referen= ce '%s' not found in this buffer" ref)) (cond (lob-info (setq type (quote l= ob))) (id (setq type (quote id))) ((and (looking-at org-babel-src-name-rege= xp) (save-excursion (forward-line 1) (or ... ...))) (setq type (quote sourc= e-block))) (t (while (not (setq type ...)) (forward-line 1) (beginning-of-l= ine) (if (or ... ...) (error "reference not found"))))) (let ((params (appe= nd args (quote ...)))) (setq result (case type (results-line (org-babel-rea= d-result)) (table (org-babel-read-table)) (list (org-babel-read-list)) (fil= e (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-bab= el-ref-headline-body))))) (if (symbolp result) (format "%S" result) (if (an= d index (listp result)) (org-babel-ref-index-list index result) result))))) > (progn (save-excursion (let ((case-fold-search t) type args new-refere = new-header-args new-referent result lob-info split-file split-ref index ind= ex-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-beginning 0)))) (whe= n (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 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) (setq split-file = (match-string 1 ref)) (setq split-ref (match-string 2 ref)) (find-file spli= t-file) (setq ref split-ref)) (save-restriction (widen) (goto-char (point-m= in)) (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 ...))) (u= nless (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 ... ...)) (setq type (quote source-block))) (t (while (not = ...) (forward-line 1) (beginning-of-line) (if ... ...)))) (let ((params (ap= pend args ...))) (setq result (case type (results-line ...) (table ...) (li= st ...) (file ...) (source-block ...) (lob ...) (id ...)))) (if (symbolp re= sult) (format "%S" result) (if (and index (listp result)) (org-babel-ref-in= dex-list index result) result)))))) > (unwind-protect (progn (save-excursion (let ((case-fold-search t) type = args new-refere new-header-args new-referent result lob-info split-file spl= it-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 (mat= ch-string 1 ref)) (setq new-header-args (match-string 3 ref)) (setq new-ref= erent (match-string 5 ref)) (when (> (length new-refere) 0) (when (> ... 0)= (setq args ...)) (when (> ... 0) (setq args ...)) (setq ref new-refere))) = (when (string-match "^\\(.+\\):\\(.+\\)$" ref) (setq split-file (match-stri= ng 1 ref)) (setq split-ref (match-string 2 ref)) (find-file split-file) (se= tq ref split-ref)) (save-restriction (widen) (goto-char (point-min)) (if (l= et (... ...) (or ... ... ... ...)) (unless (or lob-info id) (goto-char ...)= ) (error "reference '%s' not found in this buffer" ref)) (cond (lob-info (s= etq type ...)) (id (setq type ...)) ((and ... ...) (setq type ...)) (t (whi= le ... ... ... ...))) (let ((params ...)) (setq result (case type ... ... .= .. ... ... ... ...))) (if (symbolp result) (format "%S" result) (if (and in= dex ...) (org-babel-ref-index-list index result) result)))))) (set-window-c= onfiguration wconfig)) > (let ((wconfig (current-window-configuration))) (unwind-protect (progn = (save-excursion (let ((case-fold-search t) type args new-refere new-header-= args new-referent result lob-info split-file split-ref index index-row inde= x-col id) (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref) (let ... ...= )) (setq index (match-string 1 ref)) (setq ref (substring ref 0 ...))) (whe= n (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 (> ... 0) (when ... .= ..) (when ... ...) (setq ref new-refere))) (when (string-match "^\\(.+\\):\= \(.+\\)$" ref) (setq split-file (match-string 1 ref)) (setq split-ref (matc= h-string 2 ref)) (find-file split-file) (setq ref split-ref)) (save-restric= tion (widen) (goto-char (point-min)) (if (let ... ...) (unless ... ...) (er= ror "reference '%s' not found in this buffer" ref)) (cond (lob-info ...) (i= d ...) (... ...) (t ...)) (let (...) (setq result ...)) (if (symbolp result= ) (format "%S" result) (if ... ... result)))))) (set-window-configuration w= config))) > (save-window-excursion (save-excursion (let ((case-fold-search t) type = args new-refere new-header-args new-referent result lob-info split-file spl= it-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-begi= nning 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 (> (l= ength 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) (= 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) (go= to-char (point-min)) (if (let ((src-rx ...) (res-rx ...)) (or (re-search-fo= rward src-rx nil t) (re-search-forward res-rx nil t) (setq id ...) (setq lo= b-info ...))) (unless (or lob-info id) (goto-char (match-beginning 0))) (er= ror "reference '%s' not found in this buffer" ref)) (cond (lob-info (setq t= ype (quote lob))) (id (setq type (quote id))) ((and (looking-at org-babel-s= rc-name-regexp) (save-excursion ... ...)) (setq type (quote source-block)))= (t (while (not ...) (forward-line 1) (beginning-of-line) (if ... ...)))) (= let ((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)) (= org-babel-ref-index-list index result) result)))))) > org-babel-ref-resolve("vc-indicator()") > #+end_src --=20 Eric Schulte http://cs.unm.edu/~eschulte/