[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el |
Date: |
Sun, 29 Aug 2021 11:31:12 -0400 (EDT) |
branch: elpa/scala-mode
commit 46bb948345f165ebffe6ff3116e36a3b8a3f219d
Author: Heikki Vesalainen <heikki.vesalainen@trademarknow.com>
Commit: Heikki Vesalainen <heikki.vesalainen@trademarknow.com>
Fix #155, remove ob-scala.el
---
ob-scala.el | 116 ------------------------------------------------------------
1 file changed, 116 deletions(-)
diff --git a/ob-scala.el b/ob-scala.el
deleted file mode 100644
index 6389b3a..0000000
--- a/ob-scala.el
+++ /dev/null
@@ -1,116 +0,0 @@
-;;; ob-scala.el --- org-babel functions for scala evaluation
-
-;; Copyright (C) Simon Hafner
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(require 'ensime)
-;; possibly require modes required for your language
-
-;; optionally define a file extension for this language
-(add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala"))
-
-;; optionally declare default header arguments for this language
-(defvar org-babel-default-header-args:scala '())
-
-(defun org-babel-expand-body:scala (body params &optional processed-params)
- "Expand BODY according to PARAMS, return the expanded body."
- (require 'ensime-inf)
- (let ((vars (assoc-default :vars (or processed-params
(org-babel-process-params params)))))
- (concat
- (mapconcat ;; define any variables
- (lambda (pair)
- (format "val %s=%S"
- (car pair) (org-babel-scala-var-to-scala (cdr pair)))) vars
"\n")
- "\n" body "\nprint(\"\\nob_scala_eol\")")))
-
-
-;; This is the main function which is called to evaluate a code
-;; block.
-;;
-;; So far, only result :output is supported. The session is always
-;; interactive. Manual start of `ensime-inf-buffer-name` via
-;; `ensime-inf-run-scala` is recommended.
-(defun org-babel-execute:scala (body params)
- "Execute a block of Scalacode with org-babel.
-This function is called by `org-babel-execute-src-block'"
- (message "executing Scala source code block")
- (let* ((processed-params (org-babel-process-params params))
- ;; set the session
- (session (org-babel-scala-initiate-session (assoc-default :session
processed-params)))
- ;; variables assigned for use in the block
- (vars (assoc-default :vars processed-params))
- (result-params (assoc-default :result-params processed-params))
- ;; either OUTPUT or VALUE which should behave as described above
- (result-type (assoc-default :result-type processed-params))
- ;; expand the body with `org-babel-expand-body:scala'
- (full-body (org-babel-expand-body:scala
- body params processed-params)))
- (ensime-inf-assert-running)
- (org-babel-scala-table-or-string
- (let ((temp-file (make-temp-file "scala-eval")))
- (message temp-file)
- (with-temp-file temp-file
- (insert full-body))
- (let ((output
- (org-babel-comint-with-output (ensime-inf-buffer-name
"ob_scala_eol")
- (ensime-inf-send-string (concat ":load " temp-file))
- (comint-send-input nil t )
- (sleep-for 0 5))))
- (delete-file temp-file)
- output)))))
-
-;; This function should be used to assign any variables in params in
-;; the context of the session environment.
-(defun org-babel-prep-session:scala (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- )
-
-(defun org-babel-scala-var-to-scala (var)
- "Convert an elisp var into a string of scala source code
-specifying a var of the same value."
- (format "%S" var))
-
-(defun org-babel-scala-table-or-string (results)
- "If the results look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (message (format "%S" results))
- (org-trim (mapconcat (lambda (element)
- (if (or
- (string-equal (org-trim element) "scala>")
- (string-equal (org-trim element)
"ob_scala_eol"))
- ""
- element))
- (cddr results)
- "")))
-
-(defun org-babel-scala-initiate-session (&optional session)
- "If there is not a current inferior-process-buffer in SESSION then create.
-Return the initialized session."
- (unless (get-buffer ensime-inf-buffer-name)
- (ensime-inf-run-scala))
- ensime-inf-buffer-name
- )
-
-(provide 'ob-scala)
-;;; ob-scala.el ends here
- [nongnu] elpa/scala-mode f03a582 141/217: Merge pull request #83 from ancane/master, (continued)
- [nongnu] elpa/scala-mode f03a582 141/217: Merge pull request #83 from ancane/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 461f9a5 134/217: Fix issue #63 and names with _ and reserved word, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ababc73 151/217: remove interactive, update filename., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 27efa44 019/217: updated README, added LICENSE, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d6f8cee 135/217: scala 2.10 preamble, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 03cfbe4 148/217: Add types to index items., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ed645d2 153/217: move create index function for imenu to big setq with everything else., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 618f0fb 163/217: remove 'scala-indent:indent-on-parentheses in preference of smartparens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is prefixed by an opcode. (#143), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a1ff6f3 202/217: feat: add Scala 3 keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el,
ELPA Syncer <=
- [nongnu] elpa/scala-mode a2a1b1d 208/217: compile mode with sbt thin client, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 54fa36f 200/217: Merge pull request #159 from kpbochenek/fix-files-association-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5058a85 204/217: doc: clarify Scala versions supported, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode fe5c2c4 031/217: Fixes #11: was still using the slow regexp, not faster, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1a3d958 029/217: forward/backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e30b35a 008/217: Indentation working, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 59cdd94 074/217: Add `scala-indent:use-javadoc-style` defcustom., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 347faeb 075/217: Add Evan Meagher to contributors list., ELPA Syncer, 2021/08/29