1.1--- a/emacs/default.el Sun Jun 16 02:22:07 2024 +0000
1.2+++ b/emacs/default.el Sun Jun 16 18:26:21 2024 -0400
1.3@@ -32,9 +32,6 @@
1.4 shr-image-animate nil
1.5 shr-discard-aria-hidden t
1.6 bookmark-default-file (expand-file-name "bookmarks" user-emacs-directory)
1.7- project-list-file (expand-file-name "projects" user-emacs-directory)
1.8- project-mode-line t
1.9- project-file-history-behavior 'relativize
1.10 tempo-interactive t
1.11 emms-directory (expand-file-name "emms" user-emacs-directory)
1.12 gnus-cache-directory (expand-file-name "gnus" user-emacs-directory)
1.13@@ -45,11 +42,8 @@
1.14 ediff-floating-control-frame t
1.15 register-use-preview nil
1.16 shr-use-xwidgets-for-media t
1.17- browse-url-browser-function 'browse-url-default-browser
1.18- eww-auto-rename-buffer 'title
1.19- eww-search-prefix "https://duckduckgo.com/html?q="
1.20 view-read-only t)
1.21-(browse-url-default-browser "")
1.22+
1.23 ;;; Variables
1.24 (defvar user-emacs-lib-directory (expand-file-name (join-paths user-emacs-directory "lib")))
1.25 (defvar user-custom-file (expand-file-name (format "%s.el" user-login-name) user-emacs-directory))
1.26@@ -70,7 +64,7 @@
1.27 ;;; Theme
1.28 (defun load-default-theme () (interactive) (load-theme default-theme))
1.29
1.30-(add-hook 'after-init-hook #'load-default-theme)
1.31+;; (add-hook 'after-init-hook #'load-default-theme)
1.32
1.33 ;;; Packages
1.34 (with-eval-after-load 'package
1.35@@ -81,19 +75,13 @@
1.36 use-package-always-ensure t
1.37 use-package-expand-minimally t)
1.38 (add-packages
1.39- eglot-x ;; LSP extensions
1.40+ ;; eglot-x ;; LSP extensions
1.41 org-web-tools ;; web parsing
1.42 citeproc ;; citations
1.43 all-the-icons all-the-icons-dired all-the-icons-ibuffer ;; icons
1.44 hide-mode-line ;; ui
1.45- corfu orderless cape ;; completion
1.46- slime ;; common lisp server
1.47- graphviz-dot-mode
1.48- bbdb
1.49- slime-company
1.50- which-key ;; key helper
1.51- ;; langs
1.52- rust-mode)
1.53+ ;; bbdb
1.54+ which-key)
1.55 (package-install-selected-packages t))
1.56
1.57 ;;; Env
1.58@@ -111,12 +99,10 @@
1.59 (add-to-list 'exec-path "/usr/local/sbin/")
1.60
1.61 ;;; Completions
1.62-(use-package corfu
1.63- :init (global-corfu-mode))
1.64+;; (use-package corfu
1.65+;; :init (global-corfu-mode))
1.66
1.67 (use-package cape
1.68- ;; Bind dedicated completion commands
1.69- ;; Alternative prefix keys: C-c p, M-p, M-+, ...
1.70 :bind (("C-c p p" . completion-at-point) ;; capf
1.71 ("C-c p t" . complete-tag) ;; etags
1.72 ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion
1.73@@ -140,7 +126,7 @@
1.74 ;; first function returning a result wins. Note that the list of buffer-local
1.75 ;; completion functions takes precedence over the global list.
1.76 ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
1.77- (add-to-list 'completion-at-point-functions #'cape-abbrev)
1.78+ ;; (add-to-list 'completion-at-point-functions #'cape-abbrev)
1.79 ;; (add-to-list 'completion-at-point-functions #'cape-history)
1.80 ;; (add-to-list 'completion-at-point-functions #'cape-keyword)
1.81 ;; (add-to-list 'completion-at-point-functions #'cape-file)
1.82@@ -155,6 +141,7 @@
1.83 )
1.84
1.85 (use-package orderless
1.86+ :ensure t
1.87 :custom
1.88 (completion-styles '(orderless basic partial-completion shorthand flex))
1.89 (completion-category-overrides '((file (styles basic partial-completion)))))
1.90@@ -174,6 +161,13 @@
1.91 (setq hg-binary "~/.local/bin/rhg"))
1.92
1.93 ;;; Dired
1.94+;;; Projects
1.95+(setopt project-list-file (expand-file-name "projects" user-emacs-directory)
1.96+ project-mode-line t
1.97+ project-file-history-behavior 'relativize)
1.98+
1.99+;;; Tabs
1.100+(add-hook 'tab-bar-mode-hook #'tab-bar-history-mode)
1.101
1.102 ;;; Lisp
1.103 (use-package slime
1.104@@ -262,10 +256,11 @@
1.105 (unless (package-installed-p 'eglot-x)
1.106 (package-vc-install '(eglot-x :url "https://vc.compiler.company/packy/eglot-x.git")))
1.107 (require 'eglot-x)
1.108- (add-to-list 'eglot-server-programs
1.109- '((rust-ts-mode rust-mode) .
1.110- ("rust-analyzer" :initializationOptions (:check (:command "clippy")))))
1.111- (eglot-x-setup))
1.112+ (with-eval-after-load 'eglot-x
1.113+ (add-to-list 'eglot-server-programs
1.114+ '((rust-ts-mode rust-mode) .
1.115+ ("rust-analyzer" :initializationOptions (:check (:command "clippy")))))
1.116+ (eglot-x-setup)))
1.117
1.118 ;;; Rust
1.119 (add-hook 'rust-mode-hook 'eglot-ensure)
1.120@@ -376,7 +371,7 @@
1.121 (string (format "%s %s: " keyword (format-time-string date)))
1.122 (beg (point)))
1.123 (cond
1.124- ((or (eq beg (point-at-bol))
1.125+ ((or (eq beg (pos-bol))
1.126 (default-line-regexp-p 'empty))
1.127 (let* ((maybe-newline (unless (default-line-regexp-p 'empty 1) "\n")))
1.128 ;; NOTE 2021-07-24: we use this `insert' instead of
1.129@@ -517,7 +512,7 @@
1.130 (save-excursion
1.131 (insert text)
1.132 (goto-char (point-min))
1.133- (comment-region (point-at-bol) (point-at-eol)))
1.134+ (comment-region (pos-bol) (pos-eol)))
1.135 (vertical-motion 2))
1.136 (pop-to-buffer buf)))
1.137
1.138@@ -636,12 +631,16 @@
1.139 (delete-dups
1.140 (ring-elements eshell-history-ring)))))
1.141
1.142+;;; Eww
1.143+(setopt
1.144+ browse-url-browser-function 'eww
1.145+ eww-auto-rename-buffer 'title
1.146+ eww-search-prefix "https://google.com/search?q=")
1.147+
1.148 ;;; Tramp
1.149 (setopt tramp-default-method "ssh"
1.150 tramp-default-user user-login-name
1.151 tramp-default-host "localhost")
1.152-(with-eval-after-load "tramp"
1.153- (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
1.154
1.155 ;;; Org
1.156 ;; todos
1.157@@ -655,7 +654,8 @@
1.158 (type "GOTO(g!)" "HACK(h!)" "NOTE(n!)" "CODE(c!)" "LINK(l!)" "|")
1.159 (type "KLUDGE(k@!)" "|")
1.160 (sequence "|" "DONE(d!)" "NOPE(x@!)" "FOUND(f@!)")))
1.161-;; captures
1.162+
1.163+;; capture templates
1.164 (setq org-capture-templates
1.165 '(("t" "task" entry (file "inbox.org") "* %^{title}\n- %?" :prepend t)
1.166 ("1" "current-task-item" item (clock) "%i%?")
1.167@@ -670,7 +670,7 @@
1.168 ("r" "research" entry (file "inbox.org") "* RESEARCH %?\n:notes:\n:end:\n- _refs_" :prepend t)))
1.169 (setq org-html-htmlize-output-type 'css
1.170 org-html-head-include-default-style nil
1.171- ;; comp2 default
1.172+ ;; cc default
1.173 org-ascii-text-width 80)
1.174
1.175 (org-crypt-use-before-save-magic)
1.176@@ -767,7 +767,7 @@
1.177 (if (re-search-forward
1.178 (format org-complex-heading-regexp-format (regexp-quote hd))
1.179 nil t)
1.180- (goto-char (point-at-bol))
1.181+ (goto-char (line-beginning-position))
1.182 (goto-char (point-max))
1.183 (or (bolp) (insert "\n"))
1.184 (insert "* " hd "\n")))
1.185@@ -841,7 +841,7 @@
1.186 (goto-char (point-min))
1.187 (command-execute 'outline-next-visible-heading)
1.188 ;; disable (message) that org-set-tags generates
1.189- (flet ((message (&rest ignored) nil))
1.190+ (cl-flet ((message (&rest ignored) nil))
1.191 (org-set-tags 1 t))
1.192 (set-buffer-modified-p b-m-p))
1.193 (error nil)))))
1.194@@ -881,7 +881,7 @@
1.195 ;;;###autoload
1.196 (defun org-agenda-reschedule-to-today ()
1.197 (interactive)
1.198- (flet ((org-read-date (&rest rest) (current-time)))
1.199+ (cl-flet ((org-read-date (&rest rest) (current-time)))
1.200 (call-interactively 'org-agenda-schedule)))
1.201
1.202 ;; Patch org-mode to use vertical splitting
1.203@@ -905,11 +905,11 @@
1.204 (goto-char (point-min))
1.205 (while (setq pos (next-single-property-change (point) 'duration))
1.206 (goto-char pos)
1.207- (when (and (not (equal pos (point-at-eol)))
1.208+ (when (and (not (equal pos (pos-bol)))
1.209 (setq duration (org-get-at-bol 'duration)))
1.210 ;; larger duration bar height
1.211 (let ((line-height (if (< duration 15) 1.0 (+ 0.5 (/ duration 30))))
1.212- (ov (make-overlay (point-at-bol) (1+ (point-at-eol)))))
1.213+ (ov (make-overlay (pos-bol) (1+ (pos-eol)))))
1.214 (overlay-put ov 'face `(:background ,(car colors) :foreground "black"))
1.215 (setq colors (cdr colors))
1.216 (overlay-put ov 'line-height line-height)
2.1--- a/emacs/lib/publish.el Sun Jun 16 02:22:07 2024 +0000
2.2+++ b/emacs/lib/publish.el Sun Jun 16 18:26:21 2024 -0400
2.3@@ -14,7 +14,7 @@
2.4 (defvar vc-url "https://vc.compiler.company")
2.5 (defvar packy-url "https://packy.compiler.company")
2.6 (defvar html-nav (format "<div class=\"nav\" id=\"nav\"><h2 id=\"index\">*</h2><div id=\"text-index\"> (<a href = \"%s\">~</a><br> (<a href = \"%s/blog\">blog</a> <a href = \"%s/docs\">docs</a> <a href = \"%s/plan\">plan</a> <a href = \"%s/notes\">notes</a>)<br> (<a href = \"%s\">vc</a> <a href = \"%s\">packy</a>))</div></div>"
2.7- url url url url url vc-url packy-url))
2.8+ url url url url url vc-url packy-url))
2.9
2.10 (defvar html-foot "<footer><p>updated %C</p></footer>")
2.11
2.12@@ -47,7 +47,7 @@
2.13 :htmlized-source t
2.14 :footnote-section-p t
2.15 :html-doctype "<!doctype html>"
2.16- :html-preamble ,html-nav
2.17+ ;; :html-preamble ,html-nav
2.18 :html-postamble ,html-foot
2.19 :publishing-directory ,publish-dir
2.20 :publishing-function org-html-publish-to-html)
3.1--- a/emacs/util.el Sun Jun 16 02:22:07 2024 +0000
3.2+++ b/emacs/util.el Sun Jun 16 18:26:21 2024 -0400
3.3@@ -5,14 +5,14 @@
3.4
3.5 ;;; Helpers
3.6 (defun group (source n)
3.7- "This is Paul Graham's group utility from 'On Lisp'.
3.8+ "This is Paul Graham's group utility from On Lisp.
3.9
3.10 Group a list of arguments SOURCE by any provided grouping amount
3.11 N.
3.12
3.13 For example:
3.14-(group '(foo 2 bar 4) 2) ;=> ((foo 2) (bar 4))
3.15-(group '(a b c d e f) 3) ;=> ((a b c) (d e f))
3.16+(group (quote (foo 2 bar 4)) 2) ;=> ((foo 2) (bar 4))
3.17+(group (quote (a b c d e f)) 3) ;=> ((a b c) (d e f))
3.18 "
3.19 (when (zerop n) (error "zero length"))
3.20 (cl-labels ((rec (source acc)
3.21@@ -26,9 +26,9 @@
3.22 (when source (rec source nil))))
3.23
3.24 (defun flatten (x)
3.25- "Paul Graham's flatten utility from 'On Lisp'.
3.26+ "Paul Graham's flatten utility from On Lisp.
3.27
3.28-Given a tree X, return all the 'leaves' of the tree."
3.29+Given a tree X, return all the leaves of the tree."
3.30 (cl-labels ((rec (x acc)
3.31 (cond ((null x) acc)
3.32 ((atom x) (cons x acc))
3.33@@ -38,7 +38,7 @@
3.34 (rec x nil)))
3.35
3.36 (defun mkstr (&rest args)
3.37- "Paul Graham's mkstr utility from 'On Lisp'.
3.38+ "Paul Graham's mkstr utility from On Lisp.
3.39
3.40 Coerce ARGS into a single string and return it."
3.41 (let* ((s ""))
3.42@@ -51,7 +51,7 @@
3.43 s))
3.44
3.45 (defun symb (&rest args)
3.46- "Paul Graham's symb utility from 'On Lisp'.
3.47+ "Paul Graham's symb utility from On Lisp.
3.48
3.49 Concat ARGS and return a newly interned symbol."
3.50 (intern (apply #'mkstr args)))
3.51@@ -88,7 +88,7 @@
3.52 (setq result (concat (file-name-as-directory result) dir)))
3.53 result))
3.54
3.55-(defun wc (&optional start end)
3.56+(defun wc ()
3.57 "Return a 3-element list with lines, words and characters in
3.58 region or whole buffer."
3.59 (interactive)
3.60@@ -116,7 +116,7 @@
3.61 expression.
3.62 With optional N, search in the Nth line from point."
3.63 (save-excursion
3.64- (goto-char (point-at-bol))
3.65+ (goto-char (pos-bol))
3.66 (and (not (bobp))
3.67 (or (beginning-of-line n) t)
3.68 (save-match-data
3.69@@ -161,16 +161,7 @@
3.70
3.71 ;;; Server
3.72 ;;;###autoload
3.73-(defun kill-emacs-restart (&optional arg)
3.74- "Handler for SIGUSR1 signal, to (re)start an emacs server.
3.75-
3.76-Can be tested from within emacs with:
3.77- (signal-process (emacs-pid) 'sigusr1)
3.78-
3.79-or from the command line with:
3.80-$ kill -USR1 <emacs-pid>
3.81-$ emacsclient -c
3.82-"
3.83+(defun kill-emacs-restart ()
3.84 (interactive)
3.85 (server-force-delete)
3.86 (server-start))
4.1--- a/rust/lib/hash/src/lib.rs Sun Jun 16 02:22:07 2024 +0000
4.2+++ b/rust/lib/hash/src/lib.rs Sun Jun 16 18:26:21 2024 -0400
4.3@@ -10,7 +10,6 @@
4.4 pub use sha2::Sha512;
4.5 // hashbrown is now the default for the Rust stdlib. We only need to
4.6 // re-export in no_std envs.
4.7-#[cfg(no_std)]
4.8 pub use hashbrown::{HashMap, HashSet};
4.9 pub use std::hash::{Hash, Hasher};
4.10
5.1--- a/rust/lib/net/src/engine.rs Sun Jun 16 02:22:07 2024 +0000
5.2+++ b/rust/lib/net/src/engine.rs Sun Jun 16 18:26:21 2024 -0400
5.3@@ -5,5 +5,5 @@
5.4 pub mod http;
5.5 #[cfg(feature = "quic")]
5.6 pub mod quic;
5.7-#[cfg(all(feature = "uds", unix))]
5.8+#[cfg(unix)]
5.9 pub mod uds;
6.1--- a/rust/lib/net/src/err.rs Sun Jun 16 02:22:07 2024 +0000
6.2+++ b/rust/lib/net/src/err.rs Sun Jun 16 18:26:21 2024 -0400
6.3@@ -13,8 +13,6 @@
6.4 Axum(axum::Error),
6.5 #[cfg(feature = "dns")]
6.6 Dns(hickory_resolver::error::ResolveError),
6.7- #[cfg(feature = "ssh")]
6.8- Ssh(thrussh::Error),
6.9 Json(serde_json::Error),
6.10 UnexpectedEnd,
6.11 }
6.12@@ -46,13 +44,6 @@
6.13 }
6.14 }
6.15
6.16-#[cfg(feature = "ssh")]
6.17-impl From<thrussh::Error> for Error {
6.18- fn from(e: thrussh::Error) -> Self {
6.19- Error::Ssh(e)
6.20- }
6.21-}
6.22-
6.23 impl From<serde_json::Error> for Error {
6.24 fn from(e: serde_json::Error) -> Self {
6.25 Error::Json(e)
6.26@@ -71,8 +62,6 @@
6.27 Error::Axum(ref err) => write!(f, "net::server Axum error: {}", err),
6.28 #[cfg(feature = "dns")]
6.29 Error::Dns(ref err) => write!(f, "net::engine::dns error: {}", err),
6.30- #[cfg(feature = "ssh")]
6.31- Error::Ssh(ref err) => write!(f, "net::engine::ssh error: {}", err),
6.32 Error::Json(ref err) => write!(f, "net Json error: {}", err),
6.33 Error::UnexpectedEnd => write!(f, "unexpected end of buffer."),
6.34 }
6.35@@ -91,8 +80,6 @@
6.36 Error::Axum(ref err) => write!(f, "net::server Axum error: {}", err),
6.37 #[cfg(feature = "dns")]
6.38 Error::Dns(ref err) => write!(f, "net::server Dns error: {}", err),
6.39- #[cfg(feature = "ssh")]
6.40- Error::Ssh(ref err) => write!(f, "net::engine::ssh error: {}", err),
6.41 Error::Json(ref err) => write!(f, "net Json error: {}", err),
6.42 Error::UnexpectedEnd => write!(f, "unexpected end of buffer."),
6.43 }
7.1--- a/rust/lib/net/src/lib.rs Sun Jun 16 02:22:07 2024 +0000
7.2+++ b/rust/lib/net/src/lib.rs Sun Jun 16 18:26:21 2024 -0400
7.3@@ -20,7 +20,7 @@
7.4 pub use engine::http;
7.5 #[cfg(feature = "quic")]
7.6 pub use engine::quic;
7.7-#[cfg(feature = "uds")]
7.8+#[cfg(unix)]
7.9 pub use engine::uds;
7.10 #[cfg(feature = "reqwest")]
7.11 pub use reqwest;
8.1--- a/rust/lib/obj/src/object/doc.rs Sun Jun 16 02:22:07 2024 +0000
8.2+++ b/rust/lib/obj/src/object/doc.rs Sun Jun 16 18:26:21 2024 -0400
8.3@@ -1,9 +1,6 @@
8.4 //! obj::doc
8.5 //!
8.6 //! Document object types
8.7-#[cfg(feature = "org")]
8.8-pub mod org;
8.9-
8.10 use crate::Objective;
8.11 use serde::{Deserialize, Serialize};
8.12 use std::{fmt, str::FromStr};
9.1--- a/skelfile Sun Jun 16 02:22:07 2024 +0000
9.2+++ b/skelfile Sun Jun 16 18:26:21 2024 -0400
9.3@@ -13,12 +13,13 @@
9.4 :scripts ((:lisp "x"))
9.5 :env ((cc "clang"))
9.6 :rules
9.7-((all (compile std prelude user core tests build fasl)) ;; TODO: add keyword args -- (emacs :stage 'install)
9.8+((all (compile std prelude user core tests build fasl rust-bin)) ;; TODO: add keyword args -- (emacs :stage 'install)
9.9 (clean ()
9.10 #$rm -vrf .stash$#
9.11 #$find emacs -name '*.elc' -type f -delete$#
9.12 #$find lisp -name '*.fasl' -type f -delete$#
9.13 #$echo 'cargo clean:' && cd rust && cargo clean$#)
9.14+ (box () #$podman build . --build-arg IMAGE=box -t core$#)
9.15 (tree-sitter-alien ()
9.16 #$ cd lisp/ffi/tree-sitter &&
9.17 clang -g -O2 -Wall -Wno-unused-value -ltree-sitter -shared \
9.18@@ -29,6 +30,7 @@
9.19 (st ".stash/psl.dat" :direction :output :element-type 'octet)
9.20 (loop for x across (req:get "https://publicsuffix.org/list/public_suffix_list.dat" :force-binary t)
9.21 do (write-byte x st))))
9.22+ ;; lisp
9.23 (rdb ()
9.24 #$./x.lisp build rdb$#)
9.25 (skel () #$./x.lisp build skel$#)
9.26@@ -48,9 +50,12 @@
9.27 (tests-fasl () #$./x.lisp make core/tests$#)
9.28 (bench-fasl () #$./x.lisp make core/bench$#)
9.29 (fasl (core-fasl tests-fasl bench-fasl user-fasl prelude-fasl))
9.30- (box () #$podman build . --build-arg IMAGE=box -t core$#)
9.31- ;; x does the same thing, but prompts for sudo -- having issues with
9.32- ;; passing the shell input to SKEL though.
9.33+ ;; rust
9.34+ (mailman () #$cd rust && cargo build -Z unstable-options --bin mailman --out-dir ../.stash/$#)
9.35+ (krypt () #$cd rust && cargo build -Z unstable-options --bin krypt --out-dir ../.stash/$#)
9.36+ (alik () #$cd rust && cargo build -Z unstable-options --bin alik --out-dir ../.stash/$#)
9.37+ (rust-bin (mailman krypt alik))
9.38+ ;; install
9.39 (install () #$d=/usr/local/bin
9.40 cd .stash
9.41 for f in $(find . -type f ! -name "*.*")
9.42@@ -64,6 +69,7 @@
9.43 do echo "$(basename $f) -> $d"
9.44 install -C -m 755 $f $d
9.45 done fi$#)
9.46+ (emacs-user () #$make -C emacs$#)
9.47 (dist (all) #$cd .stash
9.48 mkdir -pv core/bin core/share/lisp/fasl
9.49 mv *.core core/share/lisp/
10.1--- a/x.lisp Sun Jun 16 02:22:07 2024 +0000
10.2+++ b/x.lisp Sun Jun 16 18:26:21 2024 -0400
10.3@@ -9,7 +9,9 @@
10.4 (in-package :cl-user)
10.5 #-(or sbcl cl) (error "unsupported Lisp compiler")
10.6 #-quicklisp
10.7-(let ((quicklisp-init "~/.stash/quicklisp/setup.lisp"))
10.8+(let ((quicklisp-init (or (probe-file #p"~/.stash/quicklisp/setup.lisp")
10.9+ (probe-file #p"/usr/local/share/lisp/quicklisp/setup.lisp")
10.10+ (probe-file #p "~/quicklisp/setup.lisp"))))
10.11 (when (probe-file quicklisp-init)
10.12 (load quicklisp-init)))
10.13 (require 'sb-rotate-byte)