changeset 661: |
39170f311b8c |
parent 660: |
da507f0274b3 |
child 662: |
a53be64410c5 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sat, 21 Sep 2024 00:04:33 -0400 |
files: |
emacs/lib/publish.el lisp/ffi/readline/readline.lisp lisp/lib/cli/clap/pkg.lisp lisp/lib/skel/core/obj.lisp lisp/tests.lisp skelfile |
description: |
add sk-def and sk-bind |
1.1--- a/emacs/lib/publish.el Fri Sep 20 22:18:48 2024 -0400
1.2+++ b/emacs/lib/publish.el Sat Sep 21 00:04:33 2024 -0400
1.3@@ -26,6 +26,7 @@
1.4
1.5 (setq org-html-style-default ""
1.6 ;; org-html-scripts ""
1.7+
1.8 org-html-htmlize-output-type 'css
1.9 org-export-htmlize-output-type 'css
1.10 org-export-allow-bind-keywords t
1.11@@ -35,7 +36,17 @@
1.12 org-src-fontify-natively t
1.13 make-backup-files nil
1.14 debug-on-error t
1.15- org-id-link-to-org-use-id t)
1.16+ org-id-link-to-org-use-id t
1.17+ org-html-klipsify-src nil)
1.18+
1.19+(setq org-html-klipse-selection-script
1.20+ "window.klipse_settings = {selector_eval_html: '.src-html',
1.21+ selector_eval_js: '.src-js',
1.22+ selector_eval_python_client: '.src-python',
1.23+ selector_eval_scheme: '.src-scheme',
1.24+ selector: '.src-clojure',
1.25+ selector_eval_ruby: '.src-ruby',
1.26+ selector_eval_clisp: '.src-lisp'};")
1.27
1.28 (setq org-html-link-home url)
1.29
2.1--- a/lisp/ffi/readline/readline.lisp Fri Sep 20 22:18:48 2024 -0400
2.2+++ b/lisp/ffi/readline/readline.lisp Sat Sep 21 00:04:33 2024 -0400
2.3@@ -323,6 +323,10 @@
2.4 (define-alien-routine "rl_filename_completion_function" c-string (name c-string) (i int))
2.5 (define-alien-routine "rl_completion_mode" int (function (* rl-command-func)))
2.6
2.7+;; state
2.8+(define-alien-routine "rl_save_state" int (state (* readline-state)))
2.9+(define-alien-routine "rl_restore_state" int (state (* readline-state)))
2.10+
2.11 ;; history.h
2.12 (define-alien-routine "using_history" void)
2.13 (define-alien-routine "add_history" void (line c-string))
2.14@@ -331,26 +335,13 @@
2.15 (define-alien-routine "unstifle_history" int)
2.16 (define-alien-routine "history_is_stifled" int)
2.17 (define-alien-routine "history_list" (array (* rl-hist-entry)))
2.18-
2.19-(define-alien-routine "rl_save_state" int (state (* readline-state)))
2.20-(define-alien-routine "rl_restore_state" int (state (* readline-state)))
2.21+(define-alien-routine "previous_history" (* rl-hist-entry))
2.22+(define-alien-routine "next_history" (* rl-hist-entry))
2.23
2.24 (defvar +c-buffer-size+ 256
2.25 "How many bytes to allocate per Lisp string when converting list of
2.26 Lisp strings into array of C strings.")
2.27
2.28-(defun decode-version (version)
2.29- "Transform VERSION into two values representing major and minor numbers of
2.30-Readline library version."
2.31- (values (ldb (byte 8 8) version)
2.32- (ldb (byte 8 0) version)))
2.33-
2.34-;; (mapcan (lambda (index keyword)
2.35-;; (when (logbitp index state)
2.36-;; (list keyword)))
2.37-;; (iota (length +states+))
2.38-;; +states+))
2.39-
2.40 (defmacro produce-callback (function return-type &optional func-arg-list)
2.41 "Return pointer to callback that calls FUNCTION. RETURN-TYPE specifies
2.42 return type of the function and FUNC-ARG-LIST is list of argument types (it
3.1--- a/lisp/lib/cli/clap/pkg.lisp Fri Sep 20 22:18:48 2024 -0400
3.2+++ b/lisp/lib/cli/clap/pkg.lisp Sat Sep 21 00:04:33 2024 -0400
3.3@@ -76,6 +76,6 @@
3.4
3.5 (pkg:defpkg :cli/clap
3.6 (:nicknames :clap)
3.7- (:use-reexport :cli/clap/obj :cli/clap/vars :cli/clap/proto
3.8+ (:use-reexport :cli/clap/proto :cli/clap/obj :cli/clap/vars
3.9 :cli/clap/simple :cli/clap/util :cli/clap/macs :cli/clap/ast
3.10 :cli/clap/vars))
4.1--- a/lisp/lib/skel/core/obj.lisp Fri Sep 20 22:18:48 2024 -0400
4.2+++ b/lisp/lib/skel/core/obj.lisp Sat Sep 21 00:04:33 2024 -0400
4.3@@ -365,6 +365,7 @@
4.4 (store :initarg :store :accessor sk-store :type pathname)
4.5 (components :initform #() :initarg :components :accessor sk-components :type (vector sk-component))
4.6 (bind :initarg :bind :initform nil :accessor sk-bind :type list)
4.7+ (def :initarg :def :initform nil :accessor sk-def :type list)
4.8 (env :initarg :env :initform nil :accessor sk-env :type list)
4.9 (phases :initarg :phases
4.10 :initform (make-hash-table)
4.11@@ -425,7 +426,7 @@
4.12 (probe-file (merge-pathnames (sk-src self) *skel-path*))
4.13 (error 'invalid-argument :reason "project source not found"
4.14 :item (sk-src self))))
4.15- (setf (sk-src self) (or (sk-dir self) *default-pathname-defaults*)))
4.16+ (setf (sk-src self) (sk-dir self)))
4.17 (setq *skel-path* (or (sk-src self) *default-pathname-defaults*))
4.18 (let ((*default-pathname-defaults* (make-pathname :defaults (namestring *skel-path*))))
4.19 (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (the simple-string (sk-stash self)))))
4.20@@ -470,7 +471,14 @@
4.21 (list
4.22 (cons (sb-int:keywordicate (car e)) (cadr e)))))
4.23 env)))
4.24- ;; BIND
4.25+ ;; BIND is always just a list evaluated only in the body of a WITH-SK-BINDINGS form.
4.26+
4.27+ ;; DEF is a list of function definitions which are compiled.
4.28+ (when-let ((defs (sk-def self)))
4.29+ (let ((ret))
4.30+ (setf (sk-def self)
4.31+ (dolist (def defs ret)
4.32+ (push (compile (car def) `(lambda ,(cadr def) ,@(cddr def))) ret)))))
4.33 ;; RULES
4.34 (when-let ((rules (sk-rules self)))
4.35 (setf (sk-rules self)
5.1--- a/lisp/tests.lisp Fri Sep 20 22:18:48 2024 -0400
5.2+++ b/lisp/tests.lisp Sat Sep 21 00:04:33 2024 -0400
5.3@@ -17,4 +17,4 @@
5.4 (mapcar (lambda (x) (do-tests x force)) (remove *test-suite* *test-suite-list*)))
5.5
5.6 (deftest all ()
5.7- (do-tests *test-suite-list*
5.8+ (run-all-tests))
6.1--- a/skelfile Fri Sep 20 22:18:48 2024 -0400
6.2+++ b/skelfile Sat Sep 21 00:04:33 2024 -0400
6.3@@ -10,6 +10,8 @@
6.4 :include ("lisp.sk" "rust.sk" "emacs.sk")
6.5 :vc (:hg "https://vc.compiler.company/core")
6.6 :env ((cc "clang"))
6.7+:def nil
6.8+:bind nil
6.9 :components ((:dir-locals ".dir-locals")
6.10 (:org "readme"))
6.11 :rules