summaryrefslogtreecommitdiffhomepage
path: root/lib/prog
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-09-06 15:36:38 +0100
committerjao <jao@gnu.org>2026-09-06 15:36:38 +0100
commit0f8eb65fb807a125dd601cd6b3ee746e6c7b6020 (patch)
tree1d394cf0023d0d4e9df41a28c1d4376769c91d77 /lib/prog
parent21c34f24c110e57a6c90126c87fee9cd71e85817 (diff)
downloadelibs-0f8eb65fb807a125dd601cd6b3ee746e6c7b6020.tar.gz
elibs-0f8eb65fb807a125dd601cd6b3ee746e6c7b6020.tar.bz2
a slew of little fixes courtesy of the byte compiler
Diffstat (limited to 'lib/prog')
-rw-r--r--lib/prog/jao-clojure.el7
-rw-r--r--lib/prog/jao-rust.el7
-rw-r--r--lib/prog/jao-sloc.el2
-rw-r--r--lib/prog/jao-vterm-repl.el130
4 files changed, 12 insertions, 134 deletions
diff --git a/lib/prog/jao-clojure.el b/lib/prog/jao-clojure.el
index 8faa6b1..7de62ba 100644
--- a/lib/prog/jao-clojure.el
+++ b/lib/prog/jao-clojure.el
@@ -1,6 +1,6 @@
;;; jao-clojure.el --- Clojure utilities -*- lexical-binding: t; -*-
-;; Copyright (C) 2025 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2025, 2026 Jose Antonio Ortega Ruiz
;; Author: Jose Antonio Ortega Ruiz <mail@jao.io>
;; Keywords: languages
@@ -28,6 +28,7 @@
(require 'project)
(require 'cider-test)
(require 'jao-skel)
+(require 'jao-compilation)
;;;; Jumping between implementation and test files
(defun jao-clojure--ext-dir (prefix)
@@ -107,7 +108,7 @@
(jao-clojure-jump-to-implementation)
(jao-clojure-jump-to-test)))
-(defun jao-clojure--setup-compilation (&optional ns)
+(defun jao-clojure--setup-compilation (&optional _ns)
;; (set (make-local-variable 'compile-command) (jao-clojure--test-str ns))
)
@@ -131,7 +132,7 @@
"[clojure.test.check.generators :as gen]\n "
"[clojure.test.check.properties :as prop :include-macros true]\n"))
-(defun jao-clojure--cljs-test-reqs (prefix-cmp last-cmp test-check)
+(defun jao-clojure--cljs-test-reqs (prefix-cmp last-cmp _test-check)
(concat " (:require [cljs.test :as t :refer-macros [is deftest async]]"
"\n [" prefix-cmp "." last-cmp " :as " last-cmp "])"))
diff --git a/lib/prog/jao-rust.el b/lib/prog/jao-rust.el
index b2549ab..53b0058 100644
--- a/lib/prog/jao-rust.el
+++ b/lib/prog/jao-rust.el
@@ -20,6 +20,13 @@
;;; Code:
+(declare-function rustic-cargo-bin "rustic")
+(declare-function rustic-run-cargo-command "rustic")
+(defvar rustic-cargo-test-runner)
+(defvar rustic-cargo-use-last-stored-arguments)
+(defvar rustic-default-test-arguments)
+(defvar rustic-test-arguments)
+
(defun jao-rust--root ()
(locate-dominating-file default-directory "Cargo.toml"))
diff --git a/lib/prog/jao-sloc.el b/lib/prog/jao-sloc.el
index 1f0e9ab..a325871 100644
--- a/lib/prog/jao-sloc.el
+++ b/lib/prog/jao-sloc.el
@@ -1,4 +1,4 @@
-;; sloc.el -- LOC utilities
+;; sloc.el -- LOC utilities -*- lexical-binding: t; -*-
;;;###autoload
(defun count-sloc-region (beg end kind)
diff --git a/lib/prog/jao-vterm-repl.el b/lib/prog/jao-vterm-repl.el
deleted file mode 100644
index 699ff39..0000000
--- a/lib/prog/jao-vterm-repl.el
+++ /dev/null
@@ -1,130 +0,0 @@
-;;; jao-vterm-repl.el --- vterm-based repls -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020, 2021 jao
-
-;; Author: jao <mail@jao.io>
-;; Keywords: terminals
-
-;; 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 of the License, 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 this program. If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Helpers to launch reply things such as erlang shells inside a vterm.
-;; For instance, to declare an erl repl for rebar projects, one would call:
-;;
-;; (jao-vterm-repl-register "rebar.config" "rebar3 shell" "^[0-9]+> ")
-
-;;; Code:
-
-(require 'jao-compilation)
-
-(declare-function 'vterm-copy-mode "vterm")
-(declare-function 'vterm-send-string "vterm")
-(declare-function 'vterm-send-return "vterm")
-
-(defun jao-vterm-repl--buffer-name (&optional dir)
- (format "*vterm -- repl - %s*" (or dir (jao-compilation-root))))
-
-(defvar jao-vterm-repl-repls nil)
-(defvar jao-vterm-repl-prompts nil)
-(defvar-local jao-vterm-repl--name nil)
-(defvar-local jao-vterm-repl--last-buffer nil)
-(defvar-local jao-vterm-repl--prompt-rx "^[0-9]+> ")
-
-(setq vterm-buffer-name-string nil)
-
-(defun jao-vterm-repl--exec (cmd &optional name)
- (vterm name)
- (when name
- (vterm-send-string "unset PROMPT_COMMAND\n\n"))
- (vterm-send-string cmd)
- (vterm-send-return)
- (when name (rename-buffer name t)))
-
-;;;###autoload
-(defun jao-vterm-repl-previous-prompt ()
- (interactive)
- (when (derived-mode-p 'vterm-mode)
- (vterm-copy-mode 1)
- (forward-line 0)
- (when (re-search-backward jao-vterm-repl--prompt-rx nil t)
- (goto-char (match-end 0)))))
-
-;;;###autoload
-(defun jao-vterm-repl-next-prompt ()
- (interactive)
- (when (derived-mode-p 'vterm-mode)
- (vterm-copy-mode 1)
- (or (re-search-forward jao-vterm-repl--prompt-rx nil t)
- (vterm-copy-mode -1))
- (unless (save-excursion
- (re-search-forward jao-vterm-repl--prompt-rx nil t))
- (vterm-copy-mode -1))))
-
-;;;###autoload
-(define-minor-mode jao-vterm-repl-mode "repl-aware vterm" nil nil
- '(("\C-c\C-p" . jao-vterm-repl-previous-prompt)
- ("\C-c\C-n" . jao-vterm-repl-next-prompt)
- ("\C-c\C-z" . jao-vterm-repl-pop-to-src)))
-
-;;;###autoload
-(defun jao-vterm-repl ()
- (let* ((dir (jao-compilation-root))
- (vname (jao-vterm-repl--buffer-name dir))
- (root-name (jao-compilation-root-file))
- (buffer (seq-find `(lambda (b)
- (string=
- (buffer-local-value 'jao-vterm-repl--name
- b)
- ,vname))
- (buffer-list))))
- (or buffer
- (let ((default-directory dir)
- (prompt (cdr (assoc root-name jao-vterm-repl-prompts)))
- (cmd (or (cdr (assoc root-name jao-vterm-repl-repls))
- (read-string "REPL command: ")))
- (bname (format "* vrepl - %s/%s *"
- (file-name-base (string-remove-suffix "/" dir))
- root-name)))
- (jao-vterm-repl--exec cmd bname)
- (jao-vterm-repl-mode)
- (setq-local jao-vterm-repl--name vname)
- (when prompt (setq-local jao-vterm-repl--prompt-rx prompt))
- (current-buffer)))))
-
-;;;###autoload
-(defun jao-vterm-repl-register (build-file repl-cmd prompt-rx)
- (jao-compilation-add-dominating build-file)
- (add-to-list 'jao-vterm-repl-repls (cons build-file repl-cmd))
- (add-to-list 'jao-vterm-repl-prompts (cons build-file prompt-rx)))
-
-;;;###autoload
-(defun jao-vterm-repl-pop-to-repl ()
- (interactive)
- (let ((bn (current-buffer)))
- (pop-to-buffer (jao-vterm-repl))
- (setq-local jao-vterm-repl--last-buffer bn)))
-
-;;;###autoload
-(defun jao-vterm-repl-pop-to-src ()
- (interactive)
- (when (buffer-live-p jao-vterm-repl--last-buffer)
- (pop-to-buffer jao-vterm-repl--last-buffer)))
-
-;;;###autoload
-(defun jao-vterm-repl-send (cmd)
- (with-current-buffer (jao-vterm-repl) (vterm-send-string cmd)))
-
-(provide 'jao-vterm-repl)
-;;; jao-vterm-repl.el ends here