From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [PATCH] Footnote export to LaTeX "wrong number of arguments" error Date: Sun, 31 Jul 2011 11:07:31 +0200 Message-ID: <871ux6x1gs.fsf_-_@Rainer.invalid> References: <87ipqj4kb3.fsf@Rainer.invalid> <87ei174j2m.fsf@Rainer.invalid> <81zkjv7bdb.fsf@gmail.com> <81sjpn79zu.fsf@gmail.com> <87aabv4fzo.fsf@Rainer.invalid> <8762mj4fe7.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnRzz-0005pY-OB for emacs-orgmode@gnu.org; Sun, 31 Jul 2011 05:07:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnRzy-0007pW-2j for emacs-orgmode@gnu.org; Sun, 31 Jul 2011 05:07:51 -0400 Received: from lo.gmane.org ([80.91.229.12]:48241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnRzx-0007pG-Iz for emacs-orgmode@gnu.org; Sun, 31 Jul 2011 05:07:50 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QnRzw-00088p-5J for emacs-orgmode@gnu.org; Sun, 31 Jul 2011 11:07:48 +0200 Received: from p57aacf0f.dip.t-dialin.net ([87.170.207.15]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Jul 2011 11:07:48 +0200 Received: from Stromeko by p57aacf0f.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Jul 2011 11:07:48 +0200 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain John Hendy writes: > Would this have an effect if I don't ever run 'make install'? Since it is added to the load-path during compile it might have undesirable side-effects if an older org-mode resides at that path. But, I'm now getting these errors too since I have started Emacs freshly. The offending commit is 9ff7f80f51a by Eric Schulte, where he wraps the defvar definition into eval-when-compile. This change defines the variable during compile and gets rid of that error, but then it is not defined when loading org-mode the first time. If you do an org-reload this is rectified (which is why I didn't see the error yesterday. The original error during compile-time comes from using the variable in a macro expansion. I don't think this is the right thing to do since we would not want to expand the variable at compile time (it would not be variable anymore after compilation). The attached patch seems to correct this for me. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Prevent-runtime-error-introduced-by-commit-9ff7f80f5.patch >From f22e8eb7d7cced676471268a2eb7d69ad8e3e1b8 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 31 Jul 2011 10:53:54 +0200 Subject: [PATCH] Prevent runtime error introduced by commit 9ff7f80f51a * lisp/ob.el (defvar): revert wrapping into eval-when-compile since it makes the variable non-existent during initial load. * lisp/ob.el (org-babel-map-inline-src-blocks): un-comma use of variable org-babel-inline-src-block-regexp, since we don't want to expand it at compile-time TINYCHANGE --- lisp/ob.el | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 4961ceb..c5a877d 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -141,16 +141,15 @@ remove code block execution from the C-c C-c keybinding." "\\([^\000]*?\n\\)?[ \t]*#\\+end_src") "Regexp used to identify code blocks.") -(eval-when-compile - (defvar org-babel-inline-src-block-regexp - (concat - ;; (1) replacement target (2) lang - "[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)" - ;; (3,4) (unused, headers) - "\\(\\|\\[\\(.*?\\)\\]\\)" - ;; (5) body - "{\\([^\f\n\r\v]+?\\)}\\)") - "Regexp used to identify inline src-blocks.")) +(defvar org-babel-inline-src-block-regexp + (concat + ;; (1) replacement target (2) lang + "[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)" + ;; (3,4) (unused, headers) + "\\(\\|\\[\\(.*?\\)\\]\\)" + ;; (5) body + "{\\([^\f\n\r\v]+?\\)}\\)") + "Regexp used to identify inline src-blocks.") (defun org-babel-get-header (params key &optional others) "Select only header argument of type KEY from a list. @@ -750,7 +749,7 @@ buffer." If FILE is nil evaluate BODY forms on source blocks in current buffer." (declare (indent 1)) - `(org-babel-map-regexp ,org-babel-inline-src-block-regexp ,file ,@body)) + `(org-babel-map-regexp org-babel-inline-src-block-regexp ,file ,@body)) ;;;###autoload (defun org-babel-execute-buffer (&optional arg) -- 1.7.6 --=-=-= Content-Type: text/plain Let us know if that fixes things for you and I'll let Eric decide if he pushes that patch or something different, depending on what he really wanted to do. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Samples for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra --=-=-=--