changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: init ini and vc work

changeset 619: 35a579313b80
parent 618: 5e57683a0c28
child 620: 671f87e36e07
author: Richard Westhaver <ellis@rwest.io>
date: Thu, 22 Aug 2024 22:12:51 -0400
files: emacs/default.el emacs/keys.el emacs/lib/scrum.el emacs/lib/ulang.el lisp/lib/dat/ini.lisp lisp/lib/dat/pkg.lisp lisp/lib/pod/client.lisp lisp/lib/skel/skel.asd lisp/lib/vc/git.lisp lisp/lib/vc/hg.lisp lisp/lib/vc/pkg.lisp lisp/lib/vc/proto.lisp lisp/lib/vc/tests.lisp lisp/lib/vc/vc.lisp
description: init ini and vc work
     1.1--- a/emacs/default.el	Wed Aug 21 21:14:46 2024 -0400
     1.2+++ b/emacs/default.el	Thu Aug 22 22:12:51 2024 -0400
     1.3@@ -150,8 +150,8 @@
     1.4   ;; used by `completion-at-point'.  The order of the functions matters, the
     1.5   ;; first function returning a result wins.  Note that the list of buffer-local
     1.6   ;; completion functions takes precedence over the global list.
     1.7-  ;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
     1.8-  ;; (add-to-list 'completion-at-point-functions #'cape-abbrev)
     1.9+  (add-to-list 'completion-at-point-functions #'cape-dabbrev)
    1.10+  (add-to-list 'completion-at-point-functions #'cape-abbrev)
    1.11   ;; (add-to-list 'completion-at-point-functions #'cape-history)
    1.12   ;; (add-to-list 'completion-at-point-functions #'cape-keyword)
    1.13   ;; (add-to-list 'completion-at-point-functions #'cape-file)
    1.14@@ -160,7 +160,7 @@
    1.15   ;; (add-to-list 'completion-at-point-functions #'cape-tex)
    1.16   ;; (add-to-list 'completion-at-point-functions #'cape-sgml)
    1.17   ;; (add-to-list 'completion-at-point-functions #'cape-rfc1345)
    1.18-  ;; (add-to-list 'completion-at-point-functions #'cape-dict)
    1.19+  (add-to-list 'completion-at-point-functions #'cape-dict)
    1.20   ;; (add-to-list 'completion-at-point-functions #'cape-elisp-symbol)
    1.21   ;; (add-to-list 'completion-at-point-functions #'cape-emoji)
    1.22   )
     2.1--- a/emacs/keys.el	Wed Aug 21 21:14:46 2024 -0400
     2.2+++ b/emacs/keys.el	Thu Aug 22 22:12:51 2024 -0400
     2.3@@ -119,8 +119,7 @@
     2.4   "z" #'scratch-buffer
     2.5   "C-z" #'scratch-new
     2.6   "Z" #'default-scratch-buffer
     2.7-  "t" #'org-todo
     2.8-  "C-t" clock-map
     2.9+  "t" clock-map
    2.10   ";" #'prog-comment-dwim
    2.11   "C-;" #'prog-comment-timestamp-keyword)
    2.12 
    2.13@@ -151,6 +150,8 @@
    2.14 (keymap-global-set "C-c C-p" #'outline-previous-heading)
    2.15 (keymap-global-set "C-c C-n" #'outline-next-heading)
    2.16 (global-set-key [remap dabbrev-expand] 'hippie-expand)
    2.17+(keymap-global-set "C-c a" #'org-agenda)
    2.18+(keymap-global-set "C-c t" #'org-todo)
    2.19 
    2.20 (provide 'keys)
    2.21 ;; keys.el ends here
     3.1--- a/emacs/lib/scrum.el	Wed Aug 21 21:14:46 2024 -0400
     3.2+++ b/emacs/lib/scrum.el	Thu Aug 22 22:12:51 2024 -0400
     3.3@@ -20,6 +20,30 @@
     3.4 
     3.5 ;;; Commentary:
     3.6 
     3.7+;; The point of this package is to enable an Emacs-native scrum
     3.8+;; workflow. Many years ago I used to use the org-jira package and
     3.9+;; mirror an external scrum/agile system (Jira).
    3.10+
    3.11+;; Mind you, I wouldn't dare take a shot at Jira. As far as Products
    3.12+;; go, when you need to work with hundreds of humans on software and
    3.13+;; are given a short list you must choose from, it's often the best of
    3.14+;; the worst.
    3.15+
    3.16+;; The problem is however, that we don't need Products. What we need,
    3.17+;; is a plan. How we achieve that end should be via the best and most
    3.18+;; powerful tools possible.
    3.19+
    3.20+;; In my opinion, Emacs Org Mode is the most powerful tool
    3.21+;; available. It is not quite the best tool for the job, but this
    3.22+;; isn't a problem because it is not a Product. We are given the
    3.23+;; opportunity to make it the best tool possible, in the only way
    3.24+;; possible - by doing it ourselves.
    3.25+
    3.26+;; And yes, the aura of NIH syndrome may be strong here. Most of the
    3.27+;; time you need to work with lots of folks who don't have the need or
    3.28+;; patience to learn Org-mode. This package isn't for them. It's for
    3.29+;; small groups of like-minded Lispers :).
    3.30+
    3.31 ;; ref: https://www.scrum.org/resources/what-scrum-module
    3.32 
    3.33 ;; roadmap: https://compiler.company/plan/roadmap.html
     4.1--- a/emacs/lib/ulang.el	Wed Aug 21 21:14:46 2024 -0400
     4.2+++ b/emacs/lib/ulang.el	Thu Aug 22 22:12:51 2024 -0400
     4.3@@ -51,13 +51,13 @@
     4.4       '((type "TBD(0!)" "TODO(t!)" "|")
     4.5         (type "WIP(w!)" "|")
     4.6         (type "HOLD(H@!)" "WAIT(/j@!)" "|")
     4.7-        (sequence "FIND(q!)" "READ(r@!)" "WATCH(W@!)" "|")
     4.8-        (sequence "RESEARCH(s!)" "RECORD(e!)" "|")
     4.9-        (sequence "OUTLINE(O!)" "RESEARCH(A!)" "DRAFT(M!)" "REVIEW(V!)" "|")
    4.10-        (type "FIXME(i!)" "|" "TEST(T!)" "BENCH(b!)" "DEPLOY(D!)" "RUN(X!)" "LOG(L!)" "|")
    4.11-        (type "KLUDGE(k@!)" "HACK(h!)" "NOTE(n!)" "CODE(c!)" "LINK(l!)" "|")
    4.12+        (sequence "FIND(q!)" "READ(r@!)" "WATCH(A@!)" "|")
    4.13+        (sequence "RESEARCH(s!)" "RECORD(e!)" "WRITE(W!)" "|")
    4.14+        (sequence "OUTLINE(O!)" "DRAFT(M!)" "REVIEW(V!)" "|")
    4.15+        (type "FIXME(i!)" "TEST(T!)" "BENCH(b!)" "DEPLOY(D!)" "RUN(X!)" "LOG(L!)" "GOTO(g!)" "|")
    4.16+        (type "HACK(h!)" "CODE(c!)" "|")
    4.17+        (type "NOTE(n!)" "LINK(l!)")
    4.18         (type "PROJECT(p!)" "PRODUCT(P!)" "SPRINT(S!)" "RELEASE(R!)" "|")
    4.19-        (type "GOTO(g!)" "|")
    4.20         (sequence "|" "DONE(d!)" "NOPE(x@!)" "FOUND(f@!)" "FIXED(F!)")))
    4.21 
    4.22 (setq org-todo-keyword-faces
     5.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2+++ b/lisp/lib/dat/ini.lisp	Thu Aug 22 22:12:51 2024 -0400
     5.3@@ -0,0 +1,12 @@
     5.4+;;; ini.lisp --- INI Format
     5.5+
     5.6+;; https://en.wikipedia.org/wiki/INI_file
     5.7+
     5.8+;;; Code:
     5.9+(in-package :dat/ini)
    5.10+
    5.11+(defun ini-write (value &optional stream))
    5.12+(defun ini-encode (value &optional stream))
    5.13+
    5.14+(defun ini-read (stream))
    5.15+(defun ini-decode (string &key (start 0) end))
     6.1--- a/lisp/lib/dat/pkg.lisp	Wed Aug 21 21:14:46 2024 -0400
     6.2+++ b/lisp/lib/dat/pkg.lisp	Thu Aug 22 22:12:51 2024 -0400
     6.3@@ -45,6 +45,12 @@
     6.4    :parse-csv-string
     6.5    #:write-csv-string))
     6.6 
     6.7+(defpackage :dat/ini
     6.8+  (:use :cl :std :dat/proto)
     6.9+  (:export
    6.10+   :ini-encode
    6.11+   :ini-decode)
    6.12+
    6.13 (defpackage :dat/toml
    6.14   (:use :cl :std :dat/proto :obj/time)
    6.15   (:export
     7.1--- a/lisp/lib/pod/client.lisp	Wed Aug 21 21:14:46 2024 -0400
     7.2+++ b/lisp/lib/pod/client.lisp	Thu Aug 22 22:12:51 2024 -0400
     7.3@@ -15,7 +15,7 @@
     7.4 (defclass libpod-tcp-socket (inet-socket) ())
     7.5 
     7.6 ;;; Client
     7.7-(defclass libpod-client (client)
     7.8+(defclass libpod-client ()
     7.9   ((socket :initarg :socket 
    7.10            :initform (make-instance 'local-socket :type :stream) 
    7.11            :type (or local-socket null)
     8.1--- a/lisp/lib/skel/skel.asd	Wed Aug 21 21:14:46 2024 -0400
     8.2+++ b/lisp/lib/skel/skel.asd	Thu Aug 22 22:12:51 2024 -0400
     8.3@@ -5,11 +5,9 @@
     8.4   :bug-tracker "https://vc.compiler.company/comp/core/issues"
     8.5   :depends-on (:uiop :asdf :sb-posix :sb-bsd-sockets :sb-concurrency :cl-ppcre :std
     8.6                      :obj :dat :cli :organ :doc :vc
     8.7-                     :pod
     8.8-                     (:feature :ext :box)
     8.9+                     :pod :net :box
    8.10                      (:feature :ext :krypt)
    8.11                      (:feature :ext :packy)
    8.12-                     (:feature :ext :net)
    8.13                      (:feature :tools :clouseau))
    8.14   :serial t
    8.15   :components 
     9.1--- a/lisp/lib/vc/git.lisp	Wed Aug 21 21:14:46 2024 -0400
     9.2+++ b/lisp/lib/vc/git.lisp	Thu Aug 22 22:12:51 2024 -0400
     9.3@@ -24,6 +24,16 @@
     9.4 (defun gitignore (&optional (path ".gitignore"))
     9.5   (vc/proto::make-vc-ignore :path path :patterns (vc/proto::map-lines #'vc/proto::glob-path-match path)))
     9.6 
     9.7+;; https://git-scm.com/docs/git-config
     9.8+(defclass git-config (vc-config) ())
     9.9+
    9.10+;; TODO 2024-08-22: read ini files
    9.11+(defmethod find-cfg ((obj (eql :git)) &rest args &key (directory (user-homedir-pathname)))
    9.12+  (declare (ignore args))
    9.13+  (let ((*default-pathname-defaults* directory))
    9.14+    (when-let ((cfg (directory ".gitconfig")))
    9.15+      (car cfg))))
    9.16+
    9.17 (defclass git-repo (vc-repo)
    9.18   ((index))) ;; working-directory
    9.19 
    10.1--- a/lisp/lib/vc/hg.lisp	Wed Aug 21 21:14:46 2024 -0400
    10.2+++ b/lisp/lib/vc/hg.lisp	Thu Aug 22 22:12:51 2024 -0400
    10.3@@ -60,6 +60,9 @@
    10.4 (defun hgignore (&optional (path ".hgignore"))
    10.5   (vc/proto::make-vc-ignore :path path :patterns (vc/proto::map-lines #'ppcre:create-scanner path)))
    10.6 
    10.7+;; https://www.mercurial-scm.org/doc/hgrc.5.html
    10.8+(defclass hg-config (vc-config) ())
    10.9+
   10.10 ;; (describe (make-instance 'hg-repo))
   10.11 ;; https://repo.mercurial-scm.org/hg/file/tip/mercurial/interfaces/repository.py
   10.12 (defclass hg-repo (vc-repo)
   10.13@@ -98,6 +101,9 @@
   10.14 (defmethod vc-pull ((self hg-repo) &optional (remote "default"))
   10.15   (vc-run self "pull" remote))
   10.16 
   10.17+(defmethod vc-update ((self hg-repo) &optional branch)
   10.18+  (vc-run self "update" branch))
   10.19+
   10.20 (defmethod vc-push ((self hg-repo) &optional (remote "default"))
   10.21   (vc-run self "push" remote))
   10.22 
    11.1--- a/lisp/lib/vc/pkg.lisp	Wed Aug 21 21:14:46 2024 -0400
    11.2+++ b/lisp/lib/vc/pkg.lisp	Thu Aug 22 22:12:51 2024 -0400
    11.3@@ -1,3 +1,6 @@
    11.4+;;; vc/pkg.lisp --- Version Control Packages
    11.5+
    11.6+;;; Code:
    11.7 (defpackage :vc/proto
    11.8   (:use :cl :std :log :obj :parse/lex)
    11.9   (:import-from :uiop :with-current-directory)
   11.10@@ -15,6 +18,7 @@
   11.11    :vc-branch :repo
   11.12    :vc-meta :find-repo
   11.13    :make-repo :register-repo
   11.14+   :vc-update
   11.15    :vc-ignore))
   11.16 
   11.17 (pkg:defpkg :vc/hg
    12.1--- a/lisp/lib/vc/proto.lisp	Wed Aug 21 21:14:46 2024 -0400
    12.2+++ b/lisp/lib/vc/proto.lisp	Thu Aug 22 22:12:51 2024 -0400
    12.3@@ -43,6 +43,9 @@
    12.4 (defgeneric vc-pull (self &optional remote)
    12.5   (:documentation "Pull repo REMOTE into spec SELF."))
    12.6 
    12.7+(defgeneric vc-update (self &optional branch)
    12.8+  (:documentation "Update repo SELF with optional BRANCH."))
    12.9+
   12.10 (defgeneric vc-commit (self msg &key &allow-other-keys)
   12.11   (:documentation "Commit repo object SELF, supplied with message MSG."))
   12.12 
   12.13@@ -80,8 +83,9 @@
   12.14 ;;; Objects
   12.15 
   12.16 ;;;; Config
   12.17-;; should be parsed from .hgrc and .gitconfig
   12.18-(defclass vc-config (sxp cfg) ())
   12.19+
   12.20+;; usually parsed from .gitconfig or .hgrc
   12.21+(defclass vc-config (cfg) ())
   12.22 
   12.23 ;;;; Ignorefile
   12.24 
    13.1--- a/lisp/lib/vc/tests.lisp	Wed Aug 21 21:14:46 2024 -0400
    13.2+++ b/lisp/lib/vc/tests.lisp	Thu Aug 22 22:12:51 2024 -0400
    13.3@@ -28,10 +28,8 @@
    13.4 (deftest vc ()
    13.5   (with-temp-repo (*default-vc-kind*) (is repo)))
    13.6 
    13.7-(defun %mirror-update (path) (declare (ignore path)))
    13.8-
    13.9-(deftest mirror-network (:skip t)
   13.10-  (macrolet ((with-job ((job &rest opts) &body body)
   13.11-               `(let (()) ,@body)))
   13.12-    (labels ((%m (name thunk args)))
   13.13-      (%m "test" #'vc-pull nil))))
   13.14+;; TODO 2024-08-22: 
   13.15+(deftest vc-mirror-update (:skip t)
   13.16+  "This test replicates a nushell script we've used for a very long time."
   13.17+  (with-temp-repo (:hg) 
   13.18+   (vc-id repo)))
    14.1--- a/lisp/lib/vc/vc.lisp	Wed Aug 21 21:14:46 2024 -0400
    14.2+++ b/lisp/lib/vc/vc.lisp	Thu Aug 22 22:12:51 2024 -0400
    14.3@@ -59,6 +59,12 @@
    14.4         do (let ((out (merge-pathnames output (vc-name repo))))
    14.5              (vc-bundle repo out))))
    14.6 
    14.7-(defun update-repo (path &key push (pull t)))
    14.8+(defun update-repo (repo &optional push (pull t))
    14.9+  (when pull
   14.10+    (vc-pull repo (when (stringp pull) pull)))
   14.11+  (when push
   14.12+    (vc-push repo (when (stringp push) push))))
   14.13 
   14.14-(defun update-repos (path &optional push (pull t)))
   14.15+(defun update-repos (path &key push (pull t))
   14.16+  (loop for repo in (directory-repos path)
   14.17+        do (update-repo repo push pull)))