Dear all, The follwing Maxima code block does not work: #+begin_src maxima 1+1; #+end_src #+results: #+begin_example incorrect syntax: / is not a prefix operator incorrect syntax: GuM is not an infix operator parser: incomplete number; missing exponent? -- an error. To debug this try: debugmode(true); incorrect syntax: Too many )'s incorrect syntax: Premature termination of input at $. Maxima encountered a Lisp error: parser: end of file while scanning expression. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. #+end_example Thanks, Bernd Emacs : GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) of 2011-03-10 on 3249CTO Package: Org-mode version 7.5 (release_7.5.435.gd3100) current state: ============== (setq org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars) org-export-latex-listings t org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-agenda-custom-commands '(("c" "conferences" ((tags "CONFERENCE")) ((org-tags-match-list-sublevels nil)) ((org-columns-default-format "%DATE %LOCATION"))) ("d" "Upcoming deadlines" agenda "" ((org-agenda-time-grid nil) (org-deadline-warning-days 365) (org-agenda-entry-types (quote (:deadline)))) ) ("W" "Weekly Review" ((agenda "" ((org-agenda-ndays 14))) (todo "WRITING"))) ) org-agenda-files '("e:/projects/org/agendas/") org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent) org-src-fontify-natively t org-babel-load-languages '((emacs-lisp . t) (maxima . t) (R . t) (python . t) (latex . t) (dot . t) (sh . t)) org-metaup-hook '(org-babel-load-in-session-maybe) org-after-todo-state-change-hook '(org-clock-out-if-current) org-babel-tangle-lang-exts '(("latex" . "tex") ("python" . "py") ("emacs-lisp" . "el")) org-edit-src-content-indentation 0 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) org-export-latex-format-toc-function 'org-export-latex-format-toc-default org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-shell-link-function 'yes-or-no-p org-export-first-hook '(org-beamer-initialize-open-trackers) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-export-latex-packages-alist '(("" "color") ("" "listings")) org-default-notes-file "e:/projects/org/agendas/capture.org" org-directory "e:/projects/org/" org-babel-pre-tangle-hook '(save-buffer) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers) org-mode-hook '(org-mode-reftex-setup #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes turn-on-org-cdlatex turn-on-auto-fill turn-on-font-lock turn-on-visual-line-mode) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks)) org-enforce-todo-dependencies t org-occur-hook '(org-first-headline-recenter) org-from-is-user-regexp nil org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code) org-confirm-babel-evaluate nil org-hierarchical-checkbox-statistics nil org-src-tab-acts-natively t org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames org-beamer-place-default-actions-for-lists) org-metadown-hook '(org-babel-pop-to-session-maybe) org-export-blocks '((src org-babel-exp-src-block nil) (comment org-export-blocks-format-comment t) (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil)) )
Bernd Weiss <bernd.weiss@uni-koeln.de> writes: > Dear all, > > The follwing Maxima code block does not work: > > #+begin_src maxima > 1+1; > #+end_src > #+results: > #+begin_example > incorrect syntax: / is not a prefix operator > incorrect syntax: GuM is not an infix operator > parser: incomplete number; missing exponent? > -- an error. To debug this try: debugmode(true); > incorrect syntax: Too many )'s > incorrect syntax: Premature termination of input at $. > Maxima encountered a Lisp error: > parser: end of file while scanning expression. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > #+end_example Strange. I don't get this at all. In fact, I get no output at all with your example. If I change the code to: #+begin_src maxima a: 1+1; print(a); #+end_src then I get: #+results: : 2 > Package: Org-mode version 7.5 (release_7.5.435.gd3100) I am running a newer version of org than you are so maybe update? I am also on emacs 24. HTH, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.457.g85ca)
Am 27.06.2011 04:34, schrieb Eric S Fraga: > Bernd Weiss <bernd.weiss@uni-koeln.de> writes: > >> Dear all, >> >> The follwing Maxima code block does not work: >> >> #+begin_src maxima >> 1+1; >> #+end_src >> #+results: >> #+begin_example >> incorrect syntax: / is not a prefix operator >> incorrect syntax: GuM is not an infix operator >> parser: incomplete number; missing exponent? >> -- an error. To debug this try: debugmode(true); >> incorrect syntax: Too many )'s >> incorrect syntax: Premature termination of input at $. >> Maxima encountered a Lisp error: >> parser: end of file while scanning expression. >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. >> #+end_example > > Strange. I don't get this at all. In fact, I get no output at all with > your example. If I change the code to: Hi Eric, Thanks for your answer! > #+begin_src maxima > a: 1+1; > print(a); > #+end_src > > then I get: > > #+results: > : 2 > > >> Package: Org-mode version 7.5 (release_7.5.435.gd3100) > > I am running a newer version of org than you are so maybe update? I am > also on emacs 24. I updated org (again, now it's Org-mode version 7.5 (release_7.5.461.g6d18)), I switched to Emacs 24 but to no avail. I also tried to use the debugger but this does not seem to be an error... Debug on Error enabled globally executing Maxima code block... executing Maxima source code block maxima --very-quiet -r 'batchload("c:/Users/weiss/AppData/Local/Temp/babel-209000BH/maxima-20900VN1")$' nil Code block evaluation complete. I also realized that the 'error message' changes every time I try to run the code block: #+results: : incorrect syntax: / is not a prefix operator : incorrect syntax: aLH is not an infix operator : incorrect syntax: hCp is not an infix operator : incorrect syntax: Premature termination of input at $. : Maxima encountered a Lisp error: : parser: end of file while scanning expression. : Automatically continuing. : To enable the Lisp debugger set *debugger-hook* to nil. This message is 'related' (see lines 3 "aLH is not an infix operator" and 4 "hCp is not an infix operator") to the following Maxima call ("aLH/maxima-17716hCp"): maxima --very-quiet -r 'batchload("c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp")$' nil Unfortunately, my elisp knowledge is too low to understand what's going on in ob-maxima.el. Is it a MS-Windows-thing ('/' vs '\')? To be honest, running Maxima in org in not so important for me. As long as R works, everything is fine :-) Thanks, Bernd
Bernd Weiss <bernd.weiss@uni-koeln.de> writes: [...] > #+results: > : incorrect syntax: / is not a prefix operator > : incorrect syntax: aLH is not an infix operator > : incorrect syntax: hCp is not an infix operator > : incorrect syntax: Premature termination of input at $. > : Maxima encountered a Lisp error: > : parser: end of file while scanning expression. > : Automatically continuing. > : To enable the Lisp debugger set *debugger-hook* to nil. > > This message is 'related' (see lines 3 "aLH is not an infix operator" > and 4 "hCp is not an infix operator") to the following Maxima call > ("aLH/maxima-17716hCp"): > > maxima --very-quiet -r > 'batchload("c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp")$' > nil The error messages look like maxima is trying to evaluate the actual string within double quotes! > Unfortunately, my elisp knowledge is too low to understand what's going > on in ob-maxima.el. Is it a MS-Windows-thing ('/' vs '\')? Good question. Has anybody else used maxima with org babel on Windows? I don't even have such a system to try... My guess would be that the "shell" command required to invoke maxima on Windows needs to be significantly different than what we are using here (which works on Linux). Then again, I've never really used Windows (beyond starting Word on somebody else's document on somebody else's machine... ;-) so I don't have a clue what Windows expects... -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.458.g1642)
Am 27.06.2011 10:32, schrieb Eric S Fraga:
> Bernd Weiss <bernd.weiss@uni-koeln.de> writes:
>
> [...]
>
>> #+results:
>> : incorrect syntax: / is not a prefix operator
>> : incorrect syntax: aLH is not an infix operator
>> : incorrect syntax: hCp is not an infix operator
>> : incorrect syntax: Premature termination of input at $.
>> : Maxima encountered a Lisp error:
>> : parser: end of file while scanning expression.
>> : Automatically continuing.
>> : To enable the Lisp debugger set *debugger-hook* to nil.
>>
>> This message is 'related' (see lines 3 "aLH is not an infix operator"
>> and 4 "hCp is not an infix operator") to the following Maxima call
>> ("aLH/maxima-17716hCp"):
>>
>> maxima --very-quiet -r
>> 'batchload("c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp")$'
>> nil
>
> The error messages look like maxima is trying to evaluate the actual
> string within double quotes!
>
>> Unfortunately, my elisp knowledge is too low to understand what's going
>> on in ob-maxima.el. Is it a MS-Windows-thing ('/' vs '\')?
>
> Good question. Has anybody else used maxima with org babel on Windows?
> I don't even have such a system to try...
>
> My guess would be that the "shell" command required to invoke maxima on
> Windows needs to be significantly different than what we are using here
> (which works on Linux). Then again, I've never really used Windows
> (beyond starting Word on somebody else's document on somebody else's
> machine... ;-) so I don't have a clue what Windows expects...
Hi Eric,
Again, thanks a lot for your help!
Okay, it definitely is a Windows problem. If I run the following command
in a cygwin shell, everything works as expected:
maxima --very-quiet -r
'batchload("c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp")$'
nil
However, it does not work in a Windows shell. But this is no longer an
org issue.
Bernd
Bernd Weiss <bernd.weiss@uni-koeln.de> writes: [...] > Hi Eric, > > Again, thanks a lot for your help! You're very welcome! > Okay, it definitely is a Windows problem. If I run the following command > in a cygwin shell, everything works as expected: > > maxima --very-quiet -r > 'batchload("c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp")$' > nil > > However, it does not work in a Windows shell. But this is no longer an > org issue. > > Bernd Actually, it is still an org issue, albeit one which requires input from those with much more Windows knowledge than I have. It's an org issue because I think we do (or should) strive to have org, as a whole, work on any system that runs Emacs? There are only two arguments to the maxima invocation above: =--very-quiet= to minimise the amount of superfluous output and =-r= to ask maxima to execute the following maxima command ("batchload(...)") which is what tells maxima to execute commands from the file that babel creates. If you (anybody) can figure out the magic incantation necessary to invoke maxima on Windows and have it execute commands from a file, it should be straightforward to upgrade the =ob-maximal.el= file to use the right incantation depending on the operating system. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.510.g56080)