emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Footnote export to LaTeX "wrong number of arguments" error
Date: Sun, 31 Jul 2011 11:07:31 +0200	[thread overview]
Message-ID: <871ux6x1gs.fsf_-_@Rainer.invalid> (raw)
In-Reply-To: CA+M2ft8h+pT9q5XbO_HGcBrrU3Vpmg5RUD0K5Eq_3W1B1DaRQg@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

John Hendy <jw.hendy@gmail.com> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Prevent-runtime-error-introduced-by-commit-9ff7f80f5.patch --]
[-- Type: text/x-patch, Size: 2022 bytes --]

From f22e8eb7d7cced676471268a2eb7d69ad8e3e1b8 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
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


[-- Attachment #3: Type: text/plain, Size: 343 bytes --]


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	other threads:[~2011-07-31  9:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30 19:45 Footnote export to LaTeX "wrong number of arguments" error John Hendy
2011-07-30 19:53 ` Achim Gratz
2011-07-30 20:00   ` John Hendy
2011-07-30 20:01     ` John Hendy
2011-07-30 20:20     ` Achim Gratz
2011-07-30 20:31       ` John Hendy
2011-07-30 20:38         ` Jambunathan K
2011-07-30 20:45           ` John Hendy
2011-07-30 21:07             ` Jambunathan K
2011-07-30 21:17               ` John Hendy
2011-07-30 21:26               ` Achim Gratz
2011-07-30 21:34                 ` John Hendy
2011-07-30 21:39                   ` Achim Gratz
2011-07-30 21:42                     ` John Hendy
2011-07-31  9:07                       ` Achim Gratz [this message]
2011-08-01 14:11                         ` [PATCH] " John Hendy
2011-07-30 20:34 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ux6x1gs.fsf_-_@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).