* Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
@ 2012-01-12 17:46 Andrew Cheng
2012-01-13 6:09 ` Eric Schulte
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cheng @ 2012-01-12 17:46 UTC (permalink / raw)
To: emacs-orgmode
------------------------------------------------------------------------
Phil Hagelberg has said that the swank-clojure elisp package has been
deprecated and should not be used [1]. My version of ob-clojure.el
requires swank-clojure. If I don't have the swank-clojure package, I
get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
If I follow the instructions at [2] and get the swank-clojure package,
I get past this error. Is org using a deprecated package, and is this
a bug? Thanks in advance.
[1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
[2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
Emacs : GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.5)
of 2011-08-14 on rothera, modified by Debian
Package: Org-mode version 7.7
current state:
==============
(setq
org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
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 '(("clojure" . "clj") ("emacs-lisp" . "el"))
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-blank-before-new-entry nil
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-publish-project-alist '(("org-notes" :base-directory "/home/notroot/org/"
:base-extension "org" :publishing-directory
"/home/notroot/public_html/" :recursive t
:publishing-function org-publish-org-to-html
:headline-levels 4 :auto-preamble t)
("org-static" :base-directory
"/home/notroot/org/" :base-extension
"css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory "/home/notroot/public_html/" :recursive t
:publishing-function org-publish-attachment)
("org" :components ("org-notes" "org-static")))
org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
org-mode-hook '(#[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)
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-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-occur-hook '(org-first-headline-recenter)
org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
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))
)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
2012-01-12 17:46 Bug: ob-clojure.el depends on deprecated swank-clojure [7.7] Andrew Cheng
@ 2012-01-13 6:09 ` Eric Schulte
2012-01-13 19:28 ` Andrew Cheng
0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2012-01-13 6:09 UTC (permalink / raw)
To: Andrew Cheng; +Cc: emacs-orgmode
I personally no longer use Clojure (having graduated to Common Lisp :))
so I'm not abreast of the current Clojure environment.
The only function ob-clojure uses from swank-clojure is
`swank:interactive-eval-region' (used with `slime-eval') in the
`org-babel-execute:clojure' function. Which function would now be used
to evaluate a region of clojure code? Would `slime-eval-region'
suffice?
Thanks,
Andrew Cheng <achengs@gmail.com> writes:
> ------------------------------------------------------------------------
>
> Phil Hagelberg has said that the swank-clojure elisp package has been
> deprecated and should not be used [1]. My version of ob-clojure.el
> requires swank-clojure. If I don't have the swank-clojure package, I
> get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
> If I follow the instructions at [2] and get the swank-clojure package,
> I get past this error. Is org using a deprecated package, and is this
> a bug? Thanks in advance.
>
> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
>
> Emacs : GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.5)
> of 2011-08-14 on rothera, modified by Debian
> Package: Org-mode version 7.7
>
> current state:
> ==============
> (setq
> org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
> org-speed-command-hook '(org-speed-command-default-hook
> org-babel-speed-command-hook)
> 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 '(("clojure" . "clj") ("emacs-lisp" . "el"))
> 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-blank-before-new-entry nil
> 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-publish-project-alist '(("org-notes" :base-directory "/home/notroot/org/"
> :base-extension "org" :publishing-directory
> "/home/notroot/public_html/" :recursive t
> :publishing-function org-publish-org-to-html
> :headline-levels 4 :auto-preamble t)
> ("org-static" :base-directory
> "/home/notroot/org/" :base-extension
>
> "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
> :publishing-directory "/home/notroot/public_html/" :recursive t
> :publishing-function org-publish-attachment)
> ("org" :components ("org-notes" "org-static")))
> org-export-preprocess-before-normalizing-links-hook
> '(org-remove-file-link-modifiers)
> org-mode-hook '(#[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)
> 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-clock-out-hook '(org-clock-remove-empty-clock-drawer)
> org-occur-hook '(org-first-headline-recenter)
> org-export-preprocess-before-selecting-backend-code-hook
> '(org-beamer-select-beamer-code)
> 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))
> )
>
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
2012-01-13 6:09 ` Eric Schulte
@ 2012-01-13 19:28 ` Andrew Cheng
2012-01-13 19:48 ` Eric Schulte
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cheng @ 2012-01-13 19:28 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode
I passed the question along to Phil Hagelberg in that Clojure google
group thread. His reply:
"Yes, clojure-test-mode uses both slime-eval and slime-eval-async; he
should pick one of these like so:
(defun clojure-test-eval (string &optional handler)
(slime-eval-async `(swank:eval-and-grab-output ,string)
(or handler #'identity)))
(defun clojure-test-eval-sync (string)
(slime-eval `(swank:eval-and-grab-output ,string)))
Actually swank:interactive-eval-region and friends are not elisp
functions; they are Clojure functions."
(... end of reply) In case it helps, Stuart Sierra says he got
org-babel and clojure working together. His dotfiles are at
https://github.com/stuartsierra/dotfiles
On Fri, Jan 13, 2012 at 1:09 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
> I personally no longer use Clojure (having graduated to Common Lisp :))
> so I'm not abreast of the current Clojure environment.
>
> The only function ob-clojure uses from swank-clojure is
> `swank:interactive-eval-region' (used with `slime-eval') in the
> `org-babel-execute:clojure' function. Which function would now be used
> to evaluate a region of clojure code? Would `slime-eval-region'
> suffice?
>
> Andrew Cheng <achengs@gmail.com> writes:
>
>> ------------------------------------------------------------------------
>>
>> Phil Hagelberg has said that the swank-clojure elisp package has been
>> deprecated and should not be used [1]. My version of ob-clojure.el
>> requires swank-clojure. If I don't have the swank-clojure package, I
>> get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
>> If I follow the instructions at [2] and get the swank-clojure package,
>> I get past this error. Is org using a deprecated package, and is this
>> a bug? Thanks in advance.
>>
>> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
>> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
2012-01-13 19:28 ` Andrew Cheng
@ 2012-01-13 19:48 ` Eric Schulte
2012-01-13 19:58 ` Andrew Cheng
0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2012-01-13 19:48 UTC (permalink / raw)
To: Andrew Cheng; +Cc: emacs-orgmode, Eric Schulte
Alright,
if you load ob-clojure.el and then evaluate the following to over-ride
the existing definition of `org-babel-execute:clojure' does clojure code
evaluation work?
(defun org-babel-execute:clojure (body params)
"Execute a block of Clojure code with Babel."
(require 'slime)
(with-temp-buffer
(insert (org-babel-expand-body:clojure body params))
((lambda (result)
(let ((result-params (cdr (assoc :result-params params))))
(if (or (member "scalar" result-params)
(member "verbatim" result-params))
result
(condition-case nil (org-babel-script-escape result)
(error result)))))
(slime-eval
`(swank:eval-and-grab-output
,(buffer-substring-no-properties (point-min) (point-max)))
(cdr (assoc :package params))))))
Thanks,
Andrew Cheng <achengs@gmail.com> writes:
> I passed the question along to Phil Hagelberg in that Clojure google
> group thread. His reply:
>
> "Yes, clojure-test-mode uses both slime-eval and slime-eval-async; he
> should pick one of these like so:
>
> (defun clojure-test-eval (string &optional handler)
> (slime-eval-async `(swank:eval-and-grab-output ,string)
> (or handler #'identity)))
>
> (defun clojure-test-eval-sync (string)
> (slime-eval `(swank:eval-and-grab-output ,string)))
>
> Actually swank:interactive-eval-region and friends are not elisp
> functions; they are Clojure functions."
>
> (... end of reply) In case it helps, Stuart Sierra says he got
> org-babel and clojure working together. His dotfiles are at
> https://github.com/stuartsierra/dotfiles
>
> On Fri, Jan 13, 2012 at 1:09 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
>> I personally no longer use Clojure (having graduated to Common Lisp :))
>> so I'm not abreast of the current Clojure environment.
>>
>> The only function ob-clojure uses from swank-clojure is
>> `swank:interactive-eval-region' (used with `slime-eval') in the
>> `org-babel-execute:clojure' function. Which function would now be used
>> to evaluate a region of clojure code? Would `slime-eval-region'
>> suffice?
>>
>> Andrew Cheng <achengs@gmail.com> writes:
>>
>>> ------------------------------------------------------------------------
>>>
>>> Phil Hagelberg has said that the swank-clojure elisp package has been
>>> deprecated and should not be used [1]. My version of ob-clojure.el
>>> requires swank-clojure. If I don't have the swank-clojure package, I
>>> get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
>>> If I follow the instructions at [2] and get the swank-clojure package,
>>> I get past this error. Is org using a deprecated package, and is this
>>> a bug? Thanks in advance.
>>>
>>> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
>>> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
2012-01-13 19:48 ` Eric Schulte
@ 2012-01-13 19:58 ` Andrew Cheng
2012-01-13 20:10 ` Eric Schulte
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cheng @ 2012-01-13 19:58 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode
I think so. Here's *Messages* after (def ^:dynamic *state* {}) ...
org-babel-execute:clojure
Evaluate this clojure code block (state) on your system? (y or n)
executing Clojure code block (state)...
("" "#'user/*state*")
On Fri, Jan 13, 2012 at 2:48 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Alright,
>
> if you load ob-clojure.el and then evaluate the following to over-ride
> the existing definition of `org-babel-execute:clojure' does clojure code
> evaluation work?
>
> (defun org-babel-execute:clojure (body params)
> "Execute a block of Clojure code with Babel."
> (require 'slime)
> (with-temp-buffer
> (insert (org-babel-expand-body:clojure body params))
> ((lambda (result)
> (let ((result-params (cdr (assoc :result-params params))))
> (if (or (member "scalar" result-params)
> (member "verbatim" result-params))
> result
> (condition-case nil (org-babel-script-escape result)
> (error result)))))
> (slime-eval
> `(swank:eval-and-grab-output
> ,(buffer-substring-no-properties (point-min) (point-max)))
> (cdr (assoc :package params))))))
>
> Thanks,
>
> Andrew Cheng <achengs@gmail.com> writes:
>
>> I passed the question along to Phil Hagelberg in that Clojure google
>> group thread. His reply:
>>
>> "Yes, clojure-test-mode uses both slime-eval and slime-eval-async; he
>> should pick one of these like so:
>>
>> (defun clojure-test-eval (string &optional handler)
>> (slime-eval-async `(swank:eval-and-grab-output ,string)
>> (or handler #'identity)))
>>
>> (defun clojure-test-eval-sync (string)
>> (slime-eval `(swank:eval-and-grab-output ,string)))
>>
>> Actually swank:interactive-eval-region and friends are not elisp
>> functions; they are Clojure functions."
>>
>> (... end of reply) In case it helps, Stuart Sierra says he got
>> org-babel and clojure working together. His dotfiles are at
>> https://github.com/stuartsierra/dotfiles
>>
>> On Fri, Jan 13, 2012 at 1:09 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
>>> I personally no longer use Clojure (having graduated to Common Lisp :))
>>> so I'm not abreast of the current Clojure environment.
>>>
>>> The only function ob-clojure uses from swank-clojure is
>>> `swank:interactive-eval-region' (used with `slime-eval') in the
>>> `org-babel-execute:clojure' function. Which function would now be used
>>> to evaluate a region of clojure code? Would `slime-eval-region'
>>> suffice?
>>>
>>> Andrew Cheng <achengs@gmail.com> writes:
>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> Phil Hagelberg has said that the swank-clojure elisp package has been
>>>> deprecated and should not be used [1]. My version of ob-clojure.el
>>>> requires swank-clojure. If I don't have the swank-clojure package, I
>>>> get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
>>>> If I follow the instructions at [2] and get the swank-clojure package,
>>>> I get past this error. Is org using a deprecated package, and is this
>>>> a bug? Thanks in advance.
>>>>
>>>> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
>>>> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7]
2012-01-13 19:58 ` Andrew Cheng
@ 2012-01-13 20:10 ` Eric Schulte
0 siblings, 0 replies; 6+ messages in thread
From: Eric Schulte @ 2012-01-13 20:10 UTC (permalink / raw)
To: Andrew Cheng; +Cc: emacs-orgmode
OK, I've just pushed up this change, please do test it out locally on
some more code blocks and let me know if you run into any more problems.
Thanks,
Andrew Cheng <achengs@gmail.com> writes:
> I think so. Here's *Messages* after (def ^:dynamic *state* {}) ...
>
> org-babel-execute:clojure
> Evaluate this clojure code block (state) on your system? (y or n)
> executing Clojure code block (state)...
> ("" "#'user/*state*")
>
> On Fri, Jan 13, 2012 at 2:48 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
>> Alright,
>>
>> if you load ob-clojure.el and then evaluate the following to over-ride
>> the existing definition of `org-babel-execute:clojure' does clojure code
>> evaluation work?
>>
>> (defun org-babel-execute:clojure (body params)
>> "Execute a block of Clojure code with Babel."
>> (require 'slime)
>> (with-temp-buffer
>> (insert (org-babel-expand-body:clojure body params))
>> ((lambda (result)
>> (let ((result-params (cdr (assoc :result-params params))))
>> (if (or (member "scalar" result-params)
>> (member "verbatim" result-params))
>> result
>> (condition-case nil (org-babel-script-escape result)
>> (error result)))))
>> (slime-eval
>> `(swank:eval-and-grab-output
>> ,(buffer-substring-no-properties (point-min) (point-max)))
>> (cdr (assoc :package params))))))
>>
>> Thanks,
>>
>> Andrew Cheng <achengs@gmail.com> writes:
>>
>>> I passed the question along to Phil Hagelberg in that Clojure google
>>> group thread. His reply:
>>>
>>> "Yes, clojure-test-mode uses both slime-eval and slime-eval-async; he
>>> should pick one of these like so:
>>>
>>> (defun clojure-test-eval (string &optional handler)
>>> (slime-eval-async `(swank:eval-and-grab-output ,string)
>>> (or handler #'identity)))
>>>
>>> (defun clojure-test-eval-sync (string)
>>> (slime-eval `(swank:eval-and-grab-output ,string)))
>>>
>>> Actually swank:interactive-eval-region and friends are not elisp
>>> functions; they are Clojure functions."
>>>
>>> (... end of reply) In case it helps, Stuart Sierra says he got
>>> org-babel and clojure working together. His dotfiles are at
>>> https://github.com/stuartsierra/dotfiles
>>>
>>> On Fri, Jan 13, 2012 at 1:09 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
>>>> I personally no longer use Clojure (having graduated to Common Lisp :))
>>>> so I'm not abreast of the current Clojure environment.
>>>>
>>>> The only function ob-clojure uses from swank-clojure is
>>>> `swank:interactive-eval-region' (used with `slime-eval') in the
>>>> `org-babel-execute:clojure' function. Which function would now be used
>>>> to evaluate a region of clojure code? Would `slime-eval-region'
>>>> suffice?
>>>>
>>>> Andrew Cheng <achengs@gmail.com> writes:
>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> Phil Hagelberg has said that the swank-clojure elisp package has been
>>>>> deprecated and should not be used [1]. My version of ob-clojure.el
>>>>> requires swank-clojure. If I don't have the swank-clojure package, I
>>>>> get "org-babel-execute:clojure:Cannot open load file: swank-clojure".
>>>>> If I follow the instructions at [2] and get the swank-clojure package,
>>>>> I get past this error. Is org using a deprecated package, and is this
>>>>> a bug? Thanks in advance.
>>>>>
>>>>> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE
>>>>> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.html
>>
>> --
>> Eric Schulte
>> http://cs.unm.edu/~eschulte/
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-13 20:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12 17:46 Bug: ob-clojure.el depends on deprecated swank-clojure [7.7] Andrew Cheng
2012-01-13 6:09 ` Eric Schulte
2012-01-13 19:28 ` Andrew Cheng
2012-01-13 19:48 ` Eric Schulte
2012-01-13 19:58 ` Andrew Cheng
2012-01-13 20:10 ` Eric Schulte
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.