* Org-babel: Maxima invocation fix
@ 2012-05-07 19:12 Simon Thum
2012-05-07 21:02 ` Achim Gratz
0 siblings, 1 reply; 5+ messages in thread
From: Simon Thum @ 2012-05-07 19:12 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
Hi all,
I'm sure there is a better way to fix this, but the attached patch helps
me to not get something like "Warning: argument nil not recognized"
spoiling every maxima result.
I guess I might also fix this by adding explicit :cmdline amendments,
but was too lazy to double-check.
Cheers,
Simon
[-- Attachment #2: 0001-fix-maxima-invocation-without-explicit-parameters.patch --]
[-- Type: text/x-patch, Size: 1000 bytes --]
From c2a506dd076d0ddb4a7eb925ff5276fdd60abe58 Mon Sep 17 00:00:00 2001
From: Simon Thum <simon.thum@gmx.de>
Date: Mon, 7 May 2012 21:05:16 +0200
Subject: [PATCH] fix maxima invocation without explicit parameters
Signed-off-by: Simon Thum <simon.thum@gmx.de>
---
lisp/ob-maxima.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index b092e13..fdd0804 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -73,7 +73,7 @@ called by `org-babel-execute-src-block'."
(let* ((cmdline (cdr (assoc :cmdline params)))
(in-file (org-babel-temp-file "maxima-" ".max"))
(cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
- org-babel-maxima-command in-file cmdline)))
+ org-babel-maxima-command in-file (if cmdline cmdline ""))))
(with-temp-file in-file (insert (org-babel-maxima-expand body params)))
(message cmd)
((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Org-babel: Maxima invocation fix
2012-05-07 19:12 Org-babel: Maxima invocation fix Simon Thum
@ 2012-05-07 21:02 ` Achim Gratz
2012-05-08 11:38 ` Simon Thum
0 siblings, 1 reply; 5+ messages in thread
From: Achim Gratz @ 2012-05-07 21:02 UTC (permalink / raw)
To: emacs-orgmode
Simon Thum writes:
> I'm sure there is a better way to fix this, but the attached patch
> helps me to not get something like "Warning: argument nil not
> recognized" spoiling every maxima result.
I'd rather do this directly in the let form:
- (let* ((cmdline (cdr (assoc :cmdline params)))
+ (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
And please provide a changelog with your patch.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
DIY Stuff:
http://Synth.Stromeko.net/DIY.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-babel: Maxima invocation fix
2012-05-07 21:02 ` Achim Gratz
@ 2012-05-08 11:38 ` Simon Thum
2012-05-08 12:15 ` Bastien
0 siblings, 1 reply; 5+ messages in thread
From: Simon Thum @ 2012-05-08 11:38 UTC (permalink / raw)
To: Achim Gratz; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
Hi,
attached the new fix. Does the "v2" line count as changelog?
Cheers,
Simon
On 05/07/2012 11:02 PM, Achim Gratz wrote:
> Simon Thum writes:
>> I'm sure there is a better way to fix this, but the attached patch
>> helps me to not get something like "Warning: argument nil not
>> recognized" spoiling every maxima result.
>
> I'd rather do this directly in the let form:
>
> - (let* ((cmdline (cdr (assoc :cmdline params)))
> + (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
>
> And please provide a changelog with your patch.
>
>
> Regards,
> Achim.
[-- Attachment #2: 0001-Org-Babel-fix-maxima-invocation-without-explicit-par.patch --]
[-- Type: text/x-patch, Size: 1017 bytes --]
From 63e9747d81f07abdc05db2f7754c8f7adbb1b2c6 Mon Sep 17 00:00:00 2001
From: Simon Thum <simon.thum@gmx.de>
Date: Tue, 8 May 2012 13:31:11 +0200
Subject: [PATCH] Org-Babel: fix maxima invocation without explicit parameters
v2: fix in the let form as suggested by Achim Gratz
Signed-off-by: Simon Thum <simon.thum@gmx.de>
---
lisp/ob-maxima.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index b092e13..21bae78 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -70,7 +70,7 @@ called by `org-babel-execute-src-block'."
(message "executing Maxima source code block")
(let ((result-params (split-string (or (cdr (assoc :results params)) "")))
(result
- (let* ((cmdline (cdr (assoc :cmdline params)))
+ (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
(in-file (org-babel-temp-file "maxima-" ".max"))
(cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
org-babel-maxima-command in-file cmdline)))
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Org-babel: Maxima invocation fix
2012-05-08 11:38 ` Simon Thum
@ 2012-05-08 12:15 ` Bastien
2012-05-08 15:19 ` Simon Thum
0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2012-05-08 12:15 UTC (permalink / raw)
To: Simon Thum; +Cc: Achim Gratz, emacs-orgmode
Hi Simon,
Simon Thum <simon.thum@gmx.de> writes:
> attached the new fix. Does the "v2" line count as changelog?
Not really -- but thanks for the new patch anyway. I applied
it and added a better ChangeLog. Please check it here:
http://orgmode.org/w/?p=org-mode.git;a=commit;h=925aee
The idea is to use `C-x 4 a' to create an Emacs-ready ChangeLog
then to add it to your commit message. Also avoid mentionning
contextual element in the Emacs ChangeLog itself, put it at the
end of the commit log, and use TINYCHANGE to make clear it is a
tiny change.
Thanks!
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-babel: Maxima invocation fix
2012-05-08 12:15 ` Bastien
@ 2012-05-08 15:19 ` Simon Thum
0 siblings, 0 replies; 5+ messages in thread
From: Simon Thum @ 2012-05-08 15:19 UTC (permalink / raw)
To: Bastien; +Cc: Achim Gratz, emacs-orgmode
Hi,
thanks for the swift inclusion. I've read through the how to contribute
now to do better itf.
On 05/08/2012 02:15 PM, Bastien wrote:
> Hi Simon,
>
> Simon Thum<simon.thum@gmx.de> writes:
>
>> attached the new fix. Does the "v2" line count as changelog?
>
> Not really -- but thanks for the new patch anyway. I applied
> it and added a better ChangeLog. Please check it here:
>
> http://orgmode.org/w/?p=org-mode.git;a=commit;h=925aee
>
> The idea is to use `C-x 4 a' to create an Emacs-ready ChangeLog
> then to add it to your commit message. Also avoid mentionning
> contextual element in the Emacs ChangeLog itself, put it at the
> end of the commit log, and use TINYCHANGE to make clear it is a
> tiny change.
>
> Thanks!
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-08 15:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 19:12 Org-babel: Maxima invocation fix Simon Thum
2012-05-07 21:02 ` Achim Gratz
2012-05-08 11:38 ` Simon Thum
2012-05-08 12:15 ` Bastien
2012-05-08 15:19 ` Simon Thum
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).