From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederick Giasson Subject: [PATCH] expose nrepl's timeout setting in ob-clojure.el Date: Tue, 29 Mar 2016 13:38:22 -0400 Message-ID: <56FABD8E.2000705@fgiasson.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060509030005010609060405" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akxb3-00079D-Db for emacs-orgmode@gnu.org; Tue, 29 Mar 2016 13:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akxaz-0005uL-8n for emacs-orgmode@gnu.org; Tue, 29 Mar 2016 13:38:29 -0400 Received: from s052.panelboxmanager.com ([72.55.186.33]:43189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akxaz-0005tH-3d for emacs-orgmode@gnu.org; Tue, 29 Mar 2016 13:38:25 -0400 Received: from mailnull by s052.panelboxmanager.com with sa-checked (Exim 4.86_1) (envelope-from ) id 1akxau-003ecy-PU for emacs-orgmode@gnu.org; Tue, 29 Mar 2016 13:38:21 -0400 Received: from modemcable161.56-23-96.mc.videotron.ca ([96.23.56.161]:51827 helo=[192.168.0.13]) by s052.panelboxmanager.com with esmtpsa (TLSv1.2:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.86_1) (envelope-from ) id 1akxau-003ecR-DU for emacs-orgmode@gnu.org; Tue, 29 Mar 2016 13:38:20 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------060509030005010609060405 Content-Type: multipart/alternative; boundary="------------070404000908060804090105" --------------070404000908060804090105 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi everybody, I am starting to use org-mode to create literate applications in Clojure. So far so good, this is a terrific piece of software. One thing why I wanted to use org-mode is to use it to create Clojure Notebooks. The problem I had is that I have many functions that can take some time (more than 10 seconds) to complete. This means that I was often receiving that error from nrepl: =========== nrepl-send-sync-request: Sync nREPL request timed out (op eval session 57bdacff-b178-4952-8bf8-5e01ac9d745a code (def umbel (create-ontology-structure)) =========== The problem is that there is no way to define the nrepl timeout from Org-mode. What I did is to expose that nrepl setting in ob-clojure.el. This is the ob-clojure.el.diff patch I am proposing here. The name of the new setting is "org-babel-clojure-nrepl-timeout". If it is set to /nil/ then no timeout will occur, otherwise any integer will define a timeout value. This variable can be set from the /.emacs/ global setting file. It works fine from here, please modify as required. Thanks, Fred --------------070404000908060804090105 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi everybody,

I am starting to use org-mode to create literate applications in Clojure. So far so good, this is a terrific piece of software.

One thing why I wanted to use org-mode is to use it to create Clojure Notebooks. The problem I had is that I have many functions that can take some time (more than 10 seconds) to complete. This means that I was often receiving that error from nrepl:

===========
nrepl-send-sync-request: Sync nREPL request timed out (op eval session 57bdacff-b178-4952-8bf8-5e01ac9d745a code (def umbel (create-ontology-structure))
===========

The problem is that there is no way to define the nrepl timeout from Org-mode. What I did is to expose that nrepl setting in ob-clojure.el. This is the ob-clojure.el.diff patch I am proposing here.

The name of the new setting is "org-babel-clojure-nrepl-timeout". If it is set to /nil/ then no timeout will occur, otherwise any integer will define a timeout value.

This variable can be set from the /.emacs/ global setting file.

It works fine from here, please modify as required.

Thanks,

Fred
--------------070404000908060804090105-- --------------060509030005010609060405 Content-Type: text/plain; charset=UTF-8; name="ob-clojure.el.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ob-clojure.el.diff" ZGlmZiAtLWdpdCBhL2xpc3Avb2ItY2xvanVyZS5lbCBiL2xpc3Avb2ItY2xvanVyZS5lbA0K aW5kZXggODlhMDlhOS4uNDYwMzFlMSA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NCiAJIChyZXN1bHQtcGFyYW1zIChjZHIgKGFzc29jIDpy ZXN1bHQtcGFyYW1zIHBhcmFtcykpKQ0KIAkgKHByaW50LWxldmVsIG5pbCkgKHByaW50LWxl bmd0aCBuaWwpDQogCSAoYm9keSAob3JnLWJhYmVsLXRyaW0NCkBAIC05NCw4ICs5NSw5IEBA DQogICAgICAgIChsZXQgKChyZXN1bHQtcGFyYW1zIChjZHIgKGFzc29jIDpyZXN1bHQtcGFy YW1zIHBhcmFtcykpKSkNCiAJIChzZXRxIHJlc3VsdA0KIAkgICAgICAgKG5yZXBsLWRpY3Qt Z2V0DQotCQkobnJlcGwtc3luYy1yZXF1ZXN0OmV2YWwNCi0JCSBleHBhbmRlZCAoY2lkZXIt Y3VycmVudC1jb25uZWN0aW9uKSAoY2lkZXItY3VycmVudC1zZXNzaW9uKSkNCisJCShsZXQg KChucmVwbC1zeW5jLXJlcXVlc3QtdGltZW91dCBvcmctYmFiZWwtY2xvanVyZS1ucmVwbC10 aW1lb3V0KSkNCisJCSAgKG5yZXBsLXN5bmMtcmVxdWVzdDpldmFsDQorCQkgICBleHBhbmRl ZCAoY2lkZXItY3VycmVudC1jb25uZWN0aW9uKSAoY2lkZXItY3VycmVudC1zZXNzaW9uKSkp DQogCQkoaWYgKG9yIChtZW1iZXIgIm91dHB1dCIgcmVzdWx0LXBhcmFtcykNCiAJCQkobWVt YmVyICJwcCIgcmVzdWx0LXBhcmFtcykpDQogCQkgICAgIm91dCINCg0Kd2FybmluZzogTEYg d2lsbCBiZSByZXBsYWNlZCBieSBDUkxGIGluIGxpc3Avb2ItY2xvanVyZS5lbC4NClRoZSBm aWxlIHdpbGwgaGF2ZSBpdHMgb3JpZ2luYWwgbGluZSBlbmRpbmdzIGluIHlvdXIgd29ya2lu ZyBkaXJlY3RvcnkuDQo= --------------060509030005010609060405--