[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode bc446e7 120/217: sbt support is now in sbt-mode
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode bc446e7 120/217: sbt support is now in sbt-mode |
Date: |
Sun, 29 Aug 2021 11:30:56 -0400 (EDT) |
branch: elpa/scala-mode
commit bc446e79010ff54bfd01346808b111203c0e15d2
Author: Heikki Vesalainen <heikkivesalainen@yahoo.com>
Commit: Heikki Vesalainen <heikkivesalainen@yahoo.com>
sbt support is now in sbt-mode
---
scala-mode2-sbt.el | 113 +----------------------------------------------------
1 file changed, 2 insertions(+), 111 deletions(-)
diff --git a/scala-mode2-sbt.el b/scala-mode2-sbt.el
index 9bac026..3ef5e33 100644
--- a/scala-mode2-sbt.el
+++ b/scala-mode2-sbt.el
@@ -4,116 +4,7 @@
(require 'comint)
-(defcustom scala-sbt:sbt-command "sbt"
- "The name of the sbt script to run. This must be either a
-command on path or in the sbt root."
- :type 'string
- :group 'scala)
-
-(defcustom scala-sbt:default-command "test:compile"
- "The default command to run with scala-sbt:command."
- :type 'string
- :group 'scala)
-
-(defvar scala-sbt:previous-command scala-sbt:default-command)
-
-(defun scala-sbt:find-root-impl (name-or-pred &optional dir best-root)
- (when (null dir) (setq dir default-directory))
- (let ((parent (if (string-match locate-dominating-stop-dir-regexp dir) nil
- (file-name-directory (directory-file-name dir)))))
- (cond ((or (null parent)
- (equal dir parent))
- best-root)
- ((if (stringp name-or-pred)
- (file-exists-p (expand-file-name name-or-pred dir))
- (funcall name-or-pred dir))
- (scala-sbt:find-root-impl name-or-pred parent dir))
- ('t
- (scala-sbt:find-root-impl name-or-pred parent best-root)))))
-
-(defun scala-sbt:find-root ()
- "Starting from the current default-directory, find the top-most
-parent directory that is an sbt root. An sbt root directory is
-identified by the following rules:
-
- - a directory containing a 'project/build.properties' in it.
-
- - a directory that contains a file matching one of the patterns
- '*.sbt' or 'project/*.scala' file in it.
-
-The first rule is applied first and the second is used only if it
-fails to find the sbt root."
- (or
- (scala-sbt:find-root-impl "project/build.properties")
- (scala-sbt:find-root-impl
- (lambda (dir)
- (or (directory-files dir nil ".+\\.sbt$")
- (and (file-exists-p (concat dir "project"))
- (directory-files (concat dir "project") nil ".+\\.scala$")))))))
-
-(defun scala-sbt:start ()
- "Start sbt in a buffer called *sbt*, stops any existing sbt
-running in the same buffer."
- (interactive)
- (let ((project-root (scala-sbt:find-root))
- (compilation-buffer-name-function (lambda (m) "*sbt*")))
- (when (null project-root)
- (error "Could not find project root, type `C-h f scala-sbt:find-root`
for help."))
-
- (when (not (or (executable-find scala-sbt:sbt-command)
- (file-executable-p (concat project-root
scala-sbt:sbt-command))))
- (error "Could not find %s in %s or on PATH" scala-sbt:sbt-command
project-root))
-
- ;; kill existing sbt
- (when (get-buffer "*sbt*") (kill-buffer "*sbt*"))
-
- ;; start new sbt
- (with-current-buffer (get-buffer-create "*sbt*")
- (display-buffer (current-buffer))
- (buffer-disable-undo)
- (cd project-root)
- (comint-mode)
- (compilation-shell-minor-mode)
- (setq compilation-error-regexp-alist
- `((,(rx line-start
- ?[ (or (group "error") (group "warn") (group "info")) ?]
- " " (group (1+ (not (any ": "))))
- ?: (group (1+ digit)) ?:)
- 4 5 nil (2 . 3))))
-
- (comint-exec (current-buffer) "sbt" scala-sbt:sbt-command nil nil))))
-
-(defun scala-sbt:command (&optional command)
- "Send a command to the sbt running in the '*sbt*'
-buffer. Prompts for the command to send when in interactive
-mode.
-
-This command does the following:
- - displays the buffer without moving focus to it
- - erases the buffer
- - forgets about compilation errors
-
-The command is most usefull for running a compilation command
-that outputs errors."
- (interactive)
-
- (when (not (get-buffer "*sbt*"))
- (message "Running scala-sbt:start ...")
- (scala-sbt:start)
- (sit-for 5))
-
- (when (null command)
- (setq command (read-string (format "Command to run (default %s): "
- scala-sbt:previous-command)
- nil nil scala-sbt:previous-command)))
-
- (save-some-buffers)
- (let ((buffer (get-buffer "*sbt*")))
- (with-current-buffer buffer
- (display-buffer (current-buffer))
- (compilation-forget-errors)
- (erase-buffer)
- (comint-send-string buffer (concat "\n" command "\n")))
- (setq scala-sbt:previous-command command)))
+(define-obsolete-function-alias 'scala-sbt:start 'sbt-start "2013-11-16"
"scala-sbt:start has been obsoleted. Please use the sbt-start from the sbt-mode
package directly")
+(define-obsolete-function-alias 'scala-sbt:command 'sbt-command "2013-11-16"
"scala-sbt:command has been obsolted. Please use the sbt-command from the
sbt-mode package directly")
(provide 'scala-mode2-sbt)
- [nongnu] elpa/scala-mode a78716d 046/217: Update README.md, (continued)
- [nongnu] elpa/scala-mode a78716d 046/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ac13b94 061/217: post-self-insert-hooks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 2201b1c 092/217: Interact nicely with global-font-lock-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 98d22a5 099/217: Added programming languages to README.md code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 453c012 106/217: fixed bug in string escapes marking, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6116127 042/217: Updated README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 11a710d 044/217: Correct annotation highlighting., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 49bd528 045/217: working on README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d357a77 038/217: New 'scala-indent:align-parameters' customization variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode af0e387 053/217: Fixes #18: highlight escapes in strings after chars, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode bc446e7 120/217: sbt support is now in sbt-mode,
ELPA Syncer <=
- [nongnu] elpa/scala-mode 597d421 145/217: Seems the imenu var needs to be set in a very local way., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c154f16 139/217: better join-line and fixup-whitespace, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e277378 143/217: WIP on end-of-defun and beggining of defun which should make writing imenu functionality much easier., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 811494f 155/217: Support nesting of classes in imenu index creation function., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d4885ac 159/217: Use [[:space:]] instead of literal space in syntax end/beggining of, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c5ab657 160/217: Merge pull request #82 from IvanMalison/support_imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b8e835f 161/217: scala-mode:goto-start-of-code close #90, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e8c8a51 169/217: Couple imenu-related issues (#95), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3989897 174/217: bump version (#111), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 360b5ba 162/217: Merge pull request #92 from fommil/master, ELPA Syncer, 2021/08/29