emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Footnote export to LaTeX "wrong number of arguments" err


From: Achim Gratz
Subject: Re: [O] [PATCH] Footnote export to LaTeX "wrong number of arguments" error
Date: Sun, 31 Jul 2011 11:07:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

John Hendy <address@hidden> 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.

>From f22e8eb7d7cced676471268a2eb7d69ad8e3e1b8 Mon Sep 17 00:00:00 2001
From: Achim Gratz <address@hidden>
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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]