# HG changeset patch # User Richard Westhaver # Date 1726891473 14400 # Node ID 39170f311b8c9682ec40103125c1c6532da4ded6 # Parent da507f0274b33608147ef1b1e55159996eb718d0 add sk-def and sk-bind diff -r da507f0274b3 -r 39170f311b8c emacs/lib/publish.el --- a/emacs/lib/publish.el Fri Sep 20 22:18:48 2024 -0400 +++ b/emacs/lib/publish.el Sat Sep 21 00:04:33 2024 -0400 @@ -26,6 +26,7 @@ (setq org-html-style-default "" ;; org-html-scripts "" + org-html-htmlize-output-type 'css org-export-htmlize-output-type 'css org-export-allow-bind-keywords t @@ -35,7 +36,17 @@ org-src-fontify-natively t make-backup-files nil debug-on-error t - org-id-link-to-org-use-id t) + org-id-link-to-org-use-id t + org-html-klipsify-src nil) + +(setq org-html-klipse-selection-script + "window.klipse_settings = {selector_eval_html: '.src-html', + selector_eval_js: '.src-js', + selector_eval_python_client: '.src-python', + selector_eval_scheme: '.src-scheme', + selector: '.src-clojure', + selector_eval_ruby: '.src-ruby', + selector_eval_clisp: '.src-lisp'};") (setq org-html-link-home url) diff -r da507f0274b3 -r 39170f311b8c lisp/ffi/readline/readline.lisp --- a/lisp/ffi/readline/readline.lisp Fri Sep 20 22:18:48 2024 -0400 +++ b/lisp/ffi/readline/readline.lisp Sat Sep 21 00:04:33 2024 -0400 @@ -323,6 +323,10 @@ (define-alien-routine "rl_filename_completion_function" c-string (name c-string) (i int)) (define-alien-routine "rl_completion_mode" int (function (* rl-command-func))) +;; state +(define-alien-routine "rl_save_state" int (state (* readline-state))) +(define-alien-routine "rl_restore_state" int (state (* readline-state))) + ;; history.h (define-alien-routine "using_history" void) (define-alien-routine "add_history" void (line c-string)) @@ -331,26 +335,13 @@ (define-alien-routine "unstifle_history" int) (define-alien-routine "history_is_stifled" int) (define-alien-routine "history_list" (array (* rl-hist-entry))) - -(define-alien-routine "rl_save_state" int (state (* readline-state))) -(define-alien-routine "rl_restore_state" int (state (* readline-state))) +(define-alien-routine "previous_history" (* rl-hist-entry)) +(define-alien-routine "next_history" (* rl-hist-entry)) (defvar +c-buffer-size+ 256 "How many bytes to allocate per Lisp string when converting list of Lisp strings into array of C strings.") -(defun decode-version (version) - "Transform VERSION into two values representing major and minor numbers of -Readline library version." - (values (ldb (byte 8 8) version) - (ldb (byte 8 0) version))) - -;; (mapcan (lambda (index keyword) -;; (when (logbitp index state) -;; (list keyword))) -;; (iota (length +states+)) -;; +states+)) - (defmacro produce-callback (function return-type &optional func-arg-list) "Return pointer to callback that calls FUNCTION. RETURN-TYPE specifies return type of the function and FUNC-ARG-LIST is list of argument types (it diff -r da507f0274b3 -r 39170f311b8c lisp/lib/cli/clap/pkg.lisp --- a/lisp/lib/cli/clap/pkg.lisp Fri Sep 20 22:18:48 2024 -0400 +++ b/lisp/lib/cli/clap/pkg.lisp Sat Sep 21 00:04:33 2024 -0400 @@ -76,6 +76,6 @@ (pkg:defpkg :cli/clap (:nicknames :clap) - (:use-reexport :cli/clap/obj :cli/clap/vars :cli/clap/proto + (:use-reexport :cli/clap/proto :cli/clap/obj :cli/clap/vars :cli/clap/simple :cli/clap/util :cli/clap/macs :cli/clap/ast :cli/clap/vars)) diff -r da507f0274b3 -r 39170f311b8c lisp/lib/skel/core/obj.lisp --- a/lisp/lib/skel/core/obj.lisp Fri Sep 20 22:18:48 2024 -0400 +++ b/lisp/lib/skel/core/obj.lisp Sat Sep 21 00:04:33 2024 -0400 @@ -365,6 +365,7 @@ (store :initarg :store :accessor sk-store :type pathname) (components :initform #() :initarg :components :accessor sk-components :type (vector sk-component)) (bind :initarg :bind :initform nil :accessor sk-bind :type list) + (def :initarg :def :initform nil :accessor sk-def :type list) (env :initarg :env :initform nil :accessor sk-env :type list) (phases :initarg :phases :initform (make-hash-table) @@ -425,7 +426,7 @@ (probe-file (merge-pathnames (sk-src self) *skel-path*)) (error 'invalid-argument :reason "project source not found" :item (sk-src self)))) - (setf (sk-src self) (or (sk-dir self) *default-pathname-defaults*))) + (setf (sk-src self) (sk-dir self))) (setq *skel-path* (or (sk-src self) *default-pathname-defaults*)) (let ((*default-pathname-defaults* (make-pathname :defaults (namestring *skel-path*)))) (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (the simple-string (sk-stash self))))) @@ -470,7 +471,14 @@ (list (cons (sb-int:keywordicate (car e)) (cadr e))))) env))) - ;; BIND + ;; BIND is always just a list evaluated only in the body of a WITH-SK-BINDINGS form. + + ;; DEF is a list of function definitions which are compiled. + (when-let ((defs (sk-def self))) + (let ((ret)) + (setf (sk-def self) + (dolist (def defs ret) + (push (compile (car def) `(lambda ,(cadr def) ,@(cddr def))) ret))))) ;; RULES (when-let ((rules (sk-rules self))) (setf (sk-rules self) diff -r da507f0274b3 -r 39170f311b8c lisp/tests.lisp --- a/lisp/tests.lisp Fri Sep 20 22:18:48 2024 -0400 +++ b/lisp/tests.lisp Sat Sep 21 00:04:33 2024 -0400 @@ -17,4 +17,4 @@ (mapcar (lambda (x) (do-tests x force)) (remove *test-suite* *test-suite-list*))) (deftest all () - (do-tests *test-suite-list* + (run-all-tests)) diff -r da507f0274b3 -r 39170f311b8c skelfile --- a/skelfile Fri Sep 20 22:18:48 2024 -0400 +++ b/skelfile Sat Sep 21 00:04:33 2024 -0400 @@ -10,6 +10,8 @@ :include ("lisp.sk" "rust.sk" "emacs.sk") :vc (:hg "https://vc.compiler.company/core") :env ((cc "clang")) +:def nil +:bind nil :components ((:dir-locals ".dir-locals") (:org "readme")) :rules