# HG changeset patch # User Richard Westhaver # Date 1727556175 14400 # Node ID 5e8b1855f866e56d49bad383b7ee341e1d2cdf03 # Parent 77cd10dfa212851253e9a7b77c7a1be7c8b7a216 lisp fixes diff -r 77cd10dfa212 -r 5e8b1855f866 emacs/init.el --- a/emacs/init.el Fri Sep 27 20:42:20 2024 -0400 +++ b/emacs/init.el Sat Sep 28 16:42:55 2024 -0400 @@ -6,9 +6,9 @@ (add-to-list 'load-path (expand-file-name "lib" user-emacs-directory)) (dolist (x '("util.el" "default.el" "keys.el")) - (let ((y (concat user-emacs-directory x)) - (byte-compile-warnings nil) - (native-comp-async-warnings-errors-kind nil)) + (let ((y (concat user-emacs-directory x))) + (setf byte-compile-warnings nil + native-comp-async-warnings-errors-kind nil) (if (and (native-comp-available-p) (not (eq system-type 'darwin))) (native-compile y) (byte-compile-file y)) diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/bin/bin.asd --- a/lisp/bin/bin.asd Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/bin/bin.asd Sat Sep 28 16:42:55 2024 -0400 @@ -35,7 +35,7 @@ :build-pathname "skc" :entry-point "bin/skc::start-skc" :components ((:file "skc")) - :depends-on (:std :cli)) + :depends-on (:std :cli :vc)) (defsystem :bin/packy :build-operation program-op diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/bin/skc.lisp --- a/lisp/bin/skc.lisp Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/bin/skc.lisp Sat Sep 28 16:42:55 2024 -0400 @@ -9,10 +9,11 @@ (:nicknames :skc)) (in-package :bin/skc) -(define-cli *skc-cli* +(cli:define-cli *skc-cli* :name "skc" - :version #.(format nil "0.1.1:~A" (read-line (sb-ext:process-output (vc:run-hg-command "id" '("-i") :stream))))) + :version #.(format nil "0.1.1:~A" (read-line (sb-ext:process-output (vc:run-hg-command "id" '("-i") :stream)))) + :thunk 'cli:args) -(defmain start-skc () - (with-cli (*skc-cli* opts cmds) (cli:args) - (do-cmd *skc-cli*))) +(cli:defmain start-skc () + (cli:with-cli (*skc-cli* opts cmds) (cli:args) + (cli:do-cmd *skc-cli*))) diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/bin/skel.lisp --- a/lisp/bin/skel.lisp Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/bin/skel.lisp Sat Sep 28 16:42:55 2024 -0400 @@ -14,7 +14,7 @@ (in-readtable :shell) (defopt skc-help (print-help *cli*)) -(defopt skc-version (print-version *cli*)) +(defopt skc-version (print-version *cli* t)) (defopt skc-level *log-level* (setq *log-level* (if *arg* (if (stringp *arg*) (sb-int:keywordicate (string-upcase *arg*)) @@ -242,8 +242,9 @@ (define-cli *skel-cli* :name "skel" :version #.(format nil "0.1.1:~A" (read-line (sb-ext:process-output (vc:run-hg-command "id" '("-i") :stream)))) + ;; :help t :description "A hacker's project compiler." - :thunk 'skc-show + :thunk skc-show :opts ((:name "help" :global t :description "print this message" :thunk skc-help) (:name "version" :global t :description "print version" @@ -279,7 +280,7 @@ :description "inspect the project skelfile" :opts ((:name "file" :description "path to skelfile" :kind file)) :thunk skc-inspect) - #+tools + #+gui (:name view :description "view an object in a new GUI window" :thunk skc-view) diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/lib/cli/clap/cli.lisp --- a/lisp/lib/cli/clap/cli.lisp Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/lib/cli/clap/cli.lisp Sat Sep 28 16:42:55 2024 -0400 @@ -14,7 +14,7 @@ ((eql kind :cmd) (apply #'make-instance 'cli-cmd slots)) (t (apply #'make-instance kind slots)))) -(defmacro define-cli (sym &key name version description thunk opts cmds) +(defmacro define-cli (sym &key name version #+nil (help t) description thunk opts cmds) "Define a symbol NAME bound to a top-level CLI object." (with-gensyms (%name %class) (if (atom sym) @@ -22,6 +22,7 @@ %class :cli) (setq %name (car sym) %class (cdr sym))) + ;; (when help) `(,*default-cli-def* ,%name (make-cli ,%class :name ,name :version ,version :description ,description diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/lib/rdb/err.lisp --- a/lisp/lib/rdb/err.lisp Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/lib/rdb/err.lisp Sat Sep 28 16:42:55 2024 -0400 @@ -5,12 +5,11 @@ ;;; Code: (in-package :rdb) -(eval-always - (deferror rdb-error () - ((message :initarg :message - :reader rdb-error-message)) - (:auto t) - (:documentation "Error signaled by the RDB system."))) +(deferror rdb-error () + ((message :initarg :message + :reader rdb-error-message)) + (:auto t) + (:documentation "Error signaled by the RDB system.")) (define-condition rocksdb-alien-error (rdb-error) ((db :initarg :db :reader rdb-error-db)) diff -r 77cd10dfa212 -r 5e8b1855f866 lisp/std/condition.lisp --- a/lisp/std/condition.lisp Fri Sep 27 20:42:20 2024 -0400 +++ b/lisp/std/condition.lisp Sat Sep 28 16:42:55 2024 -0400 @@ -39,12 +39,12 @@ "Define an error condition." (let ((fun (member :auto options :test #'car-eql))) (when fun (setq options (remove (car fun) options))) - `(prog1 - (define-condition ,name ,(or parent-types '(std-error)) ,slot-specs ,@options) - (when ',fun - (if (member 'simple-error ',parent-types) - (def-simple-error-reporter ,name) - (def-error-reporter ,name)))))) + `(eval-when (:compile-toplevel :load-toplevel :execute) (prog1 + (define-condition ,name ,(or parent-types '(std-error)) ,slot-specs ,@options) + (when ',fun + (if (member 'simple-error ',parent-types) + (def-simple-error-reporter ,name) + (def-error-reporter ,name))))))) (defmacro def-error-reporter (err) `(defun ,err (&rest args)