Skip to content

Commit

Permalink
feat: add alive support
Browse files Browse the repository at this point in the history
https://github.com/nobody-famous/alive

The corresponding VSCode configuration:

```json
{
    "telemetry.telemetryLevel": "off",
    "alive.lsp.startCommand": [
        "calm",
        "sbcl",
        "--load",
        "s/dev/all/start-alive.lisp"
    ]
}
```
  • Loading branch information
VitoVan committed Jul 20, 2023
1 parent 3df68d6 commit bf7de79
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions build/build.sh
Expand Up @@ -13,6 +13,7 @@ build_fedora () {
./calm s dev fedora deps.sh && \
./calm s dev fedora sbcl.sh && \
./calm s dev all quicklisp.sh && \
./calm s dev all alive.sh && \
./calm s dev all copy-lib.sh && \
./calm s dev fedora config-lib.sh

Expand Down Expand Up @@ -42,6 +43,7 @@ build_darwin () {
./calm s dev darwin deps.sh && \
./calm s dev darwin sbcl.sh && \
./calm s dev all quicklisp.sh && \
./calm s dev all alive.sh && \
./calm s dev all copy-lib.sh && \
./calm s dev darwin config-lib.sh && \
./calm s dev darwin pack.sh && \
Expand All @@ -58,6 +60,7 @@ build_msys () {
./calm s dev msys deps.sh && \
./calm s dev msys sbcl.sh && \
./calm s dev all quicklisp.sh && \
./calm s dev all alive.sh && \
./calm s dev all copy-lib.sh && \
./calm s dev msys config-lib.sh

Expand Down
8 changes: 7 additions & 1 deletion s/README.md
@@ -1,11 +1,17 @@
ALl the scripts in this directory are only meant to be used by CALM Developers. Although the scripts in `usr` directory are prepared for the end-users, but the end-users shall not aware of their existence.
ALl the scripts in this directory are only meant to be called by CALM Developers. Although the scripts in `usr` directory are prepared for the end-users, but the end-users shall not aware of their existence.

All the scripts should NOT be executed directly, instead, use `calm` command, like this:

```bash
calm s usr macos init-msg.scpt
```

or

```bash
calm sbcl --load s/dev/all/start-alive.lisp
```

All the scripts are executed in the `CALM_HOME` directory,
with env `CALM_HOME` and `CALM_APP_DIR` provided,

Expand Down
5 changes: 5 additions & 0 deletions s/dev/all/alive.sh
@@ -0,0 +1,5 @@
echo "Downloading alive-lsp ..."
if ! [ -d quicklisp/local-projects/alive-lsp ]; then
git clone --depth 1 --branch v0.2.0 https://github.com/nobody-famous/alive-lsp.git quicklisp/local-projects/alive-lsp
./calm sbcl --load ./s/dev/all/load-calm.lisp --load ./s/dev/all/install-alive.lisp
fi
2 changes: 2 additions & 0 deletions s/dev/all/install-alive.lisp
@@ -0,0 +1,2 @@
(ql:quickload :alive-lsp)
(quit)
3 changes: 3 additions & 0 deletions s/dev/all/load-calm.lisp
@@ -1,4 +1,7 @@
;; the existence of this file is to avoid the tricky shitty escaping of quotation marks
#-quicklisp
(load "./quicklisp/setup.lisp")
#-calm
(load "./calm.asd")
#-calm
(ql:quickload :calm)
2 changes: 2 additions & 0 deletions s/dev/all/start-alive.lisp
@@ -0,0 +1,2 @@
(ql:quickload :alive-lsp)
(alive/server:start)
9 changes: 3 additions & 6 deletions s/usr/all/panic.lisp
Expand Up @@ -16,12 +16,9 @@

;;
;; the swank server is for debugging, for usage please check
;; Emacs:
;; https://slime.common-lisp.dev/
;; Visual Studio Code
;; https://lispcookbook.github.io/cl-cookbook/vscode-alive.html
;;
;; https://slime.common-lisp.dev/
;; uncomment the following line to enable SWANK Server
;;
;; (unless (str:starts-with? "dist" (uiop:getenv "CALM_CMD")) (swank:create-server))

;;
Expand All @@ -32,7 +29,7 @@
;; (setf (uiop:getenv "SDL_VIDEO_ALLOW_SCREENSAVER") "1")

;;
;; setting window properties, for more of this, please check
;; setting window properties, for others, please check
;; https://github.com/VitoVan/calm/blob/main/src/config.lisp
;;
(setf *calm-window-width* 600)
Expand Down
2 changes: 1 addition & 1 deletion src/calm.c
Expand Up @@ -4,7 +4,7 @@
* !!!! SHITTY CODE AHEAD !!!!
*
* I tried to replace Bash with C to get more compatibility
* on different OSes, but I suck at C programming.
* on different OSes, but iSuck@C.
* Now the bright side is that it worked,
* the dark side is that the code is worse than the Bash scripts.
*
Expand Down

0 comments on commit bf7de79

Please sign in to comment.