changeset 8: |
06698c6708de |
parent 7: |
4728f14839e4 |
child 9: |
995df3d48af0 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Wed, 04 Sep 2024 16:59:32 -0400 |
files: |
babel.org workflows.org |
description: |
fixes |
1.1--- a/babel.org Tue Aug 27 21:35:44 2024 -0400
1.2+++ b/babel.org Wed Sep 04 16:59:32 2024 -0400
1.3@@ -2,22 +2,28 @@
1.4 #+author: Richard Westhaver
1.5 #+description: Core Library of Babel
1.6 #+setupfile: ../clean.theme
1.7-#+property: header-args :exports both :eval never
1.8+#+property: header-args :exports both :eval no
1.9 Welcome to the CC [[https://www.gnu.org/software/emacs/manual/html_node/org/Library-of-Babel.html][Library of Babel]]. This file contains a collection of
1.10 code blocks which may be used by authors throughout our public
1.11 documentation.
1.12
1.13-This library depends on the [[vc:comp/core][core]] being properly installed and the
1.14-=core/emacs= init system loaded in emacs. See [[vc:comp/home][home]] for details.
1.15+This library depends on the [[vc:core][core]] being properly installed and the
1.16+=core/emacs= init system loaded in emacs. See [[vc:home][home]] for details.
1.17
1.18 To load the library itself use ~C-c C-v i~ while visiting this file in
1.19 an org-mode buffer or =org-babel-lob-ingest= from elisp.
1.20 * echo :util:
1.21+:PROPERTIES:
1.22+:ID: 70334979-e1fd-442d-815f-9eeb7d21ef4f
1.23+:END:
1.24 #+name: echo
1.25 #+begin_src emacs-lisp :var input=""
1.26 input
1.27 #+end_src
1.28 * read :fs:
1.29+:PROPERTIES:
1.30+:ID: dade8198-f8ff-4ae9-a52d-becdc1a9c3ce
1.31+:END:
1.32 #+name: read
1.33 #+begin_src emacs-lisp :var file="" :var format=""
1.34 (if (string= format "csv")
1.35@@ -29,6 +35,9 @@
1.36 (buffer-string)))
1.37 #+end_src
1.38 * write :fs:
1.39+:PROPERTIES:
1.40+:ID: a866820f-e67c-49aa-ba7d-697c4f708654
1.41+:END:
1.42 #+name: write
1.43 #+begin_src emacs-lisp :var data="" :var file="" :var ext='()
1.44 (cl-flet ((echo (r) (if (stringp r) r (format "%S" r))))
1.45@@ -41,6 +50,9 @@
1.46 nil
1.47 #+end_src
1.48 * json :json:
1.49+:PROPERTIES:
1.50+:ID: 063109d3-3bb1-45b3-b963-6b306776798c
1.51+:END:
1.52 #+name: json
1.53 #+begin_src emacs-lisp :var file='() :var url='()
1.54 (require 'json)
1.55@@ -58,6 +70,9 @@
1.56 #+end_src
1.57
1.58 * headline :org:
1.59+:PROPERTIES:
1.60+:ID: e21d6130-804d-4ac7-bccf-8303fd33f509
1.61+:END:
1.62 #+name: headline
1.63 #+begin_src emacs-lisp :var headline="" :var file='()
1.64 (save-excursion
1.65@@ -68,11 +83,17 @@
1.66 (buffer-string)))
1.67 #+end_src
1.68 * transpose :table:
1.69+:PROPERTIES:
1.70+:ID: e35c9901-73b6-4794-8900-42860378c7dd
1.71+:END:
1.72 #+name: transpose
1.73 #+begin_src emacs-lisp :var table=""
1.74 (apply #'mapcar #'list (list table))
1.75 #+end_src
1.76 * all-to-string :table:
1.77+:PROPERTIES:
1.78+:ID: a122b2bd-abd6-4486-97c8-242e6534e5a8
1.79+:END:
1.80 #+name: all-to-string
1.81 #+begin_src emacs-lisp :var tbl='()
1.82 (defun all-to-string (tbl)
1.83@@ -110,6 +131,14 @@
1.84 cd $dir && cat * | wc -w
1.85 #+end_src
1.86
1.87+* buffer-name :util:
1.88+:PROPERTIES:
1.89+:ID: 7e9f492e-224a-4cf5-b36d-828ccedc630a
1.90+:END:
1.91+#+name: buffer-name
1.92+#+begin_src emacs-lisp
1.93+(buffer-name)
1.94+#+end_src
1.95 * tokei-dir-lines :fs:
1.96 :PROPERTIES:
1.97 :ID: 670e9855-f8d2-43eb-86af-3ef7292f90b9
1.98@@ -207,49 +236,6 @@
1.99
1.100 #+end_src
1.101
1.102-* make-info-tbl :org:fs:vc:
1.103-:PROPERTIES:
1.104-:ID: d5ba2f3d-fc2d-4db6-8bbd-7ca440ff0e8c
1.105-:END:
1.106-#+name: make-info-tbl
1.107-#+header: :var version="0.1.0"
1.108-#+header: :var name="org"
1.109-#+header: :var dir="/home/ellis/comp/"
1.110-#+begin_src emacs-lisp :results table replace
1.111- (let* ((src (concat dir name))
1.112- (age (org-sbe "hg-log-age" ''(src name)))
1.113- (rev (org-sbe "hg-rev" ''(src name)))
1.114- (num (org-sbe "hg-id-num" ''(src name)))
1.115- (cc1 (org-sbe "tokei-dir-lines" ''(src name)))
1.116- (cc2 (org-sbe "tokei-dir-langs" ''(src name)))
1.117- (nf (format "[[comp:docs/%s][%s]]" name name))
1.118- (rf (format "[[vc:comp/%s][%s:%s]]" name num rev))
1.119- ;; (gf (format "[[https://github.com/richardwesthaver/%s][github]]" name))
1.120- (vf (format "%s" rf))
1.121- (lsum (org-sbe sum-str-nums ('s 'cc1)))
1.122- (l (split-string cc1))
1.123- (lang (split-string cc2))
1.124- (cf (format "%s = λ:%s #:%s _:%s" lsum (pop l) (pop l) (pop l))))
1.125- `(hline
1.126- (name ,nf)
1.127- (version ,version)
1.128- (vc ,vf)
1.129- (updated ,age)
1.130- (lines ,cf)
1.131- (langs ,lang)
1.132- hline))
1.133- #+end_src
1.134-
1.135- #+RESULTS: make-info-tbl
1.136- |---------+----------------------------|
1.137- | name | [[https://compiler.company/docs/org][org]] |
1.138- | version | 0.1.0 |
1.139- | vc | [[https://vc.compiler.company/comp/org][44+:2b6f731f3684]] |
1.140- | updated | nil |
1.141- | lines | 14812 = λ:13917 #:45 _:850 |
1.142- | langs | (Html Org Svg) |
1.143- |---------+----------------------------|
1.144-
1.145 * make-files-tbl :org:fs:
1.146 :PROPERTIES:
1.147 :ID: e2ff9dcf-8340-48b8-a1a6-e0036cbcc495
1.148@@ -312,6 +298,9 @@
1.149 #+end_src
1.150
1.151 * vc-log :vc:
1.152+:PROPERTIES:
1.153+:ID: b2d9f6f0-2ac7-4e45-abbe-b32cc2d0f7aa
1.154+:END:
1.155 #+name: vc-log
1.156 #+header: :var limit=-1
1.157 #+header: :var buf=(buffer-name (current-buffer))
1.158@@ -412,9 +401,6 @@
1.159 }
1.160 #+end_src
1.161
1.162-#+RESULTS: gen-dot-tree
1.163-[[file:/tmp/tree.png]]
1.164-
1.165 * user-slime :lisp:
1.166 :PROPERTIES:
1.167 :ID: 9ffd1d10-ffad-486e-9d7d-82422342b9ff
1.168@@ -423,7 +409,7 @@
1.169 #+begin_src emacs-lisp :results silent :eval no-export
1.170 (unless (slime-connected-p) (slime))
1.171 (slime-eval '(ql:quickload :user))
1.172- (slime-eval '(cl:in-package :user))
1.173+ (slime-repl-set-package "USER")
1.174 #+end_src
1.175 * std-slime :lisp:
1.176 :PROPERTIES:
1.177@@ -431,11 +417,20 @@
1.178 :END:
1.179 #+name: std-slime
1.180 #+begin_src emacs-lisp :results silent :eval no-export
1.181- (slime)
1.182+ (unless (slime-connected-p) (slime))
1.183 (slime-eval '(ql:quickload :std))
1.184- (slime-eval '(in-package :std-user))
1.185+ (slime-repl-set-package "STD-USER")
1.186 #+end_src
1.187-
1.188+* test-slime :lisp:
1.189+:PROPERTIES:
1.190+:ID: ff559b09-1c18-422c-a0ae-681180f685cf
1.191+:END:
1.192+#+name: std-slime
1.193+#+begin_src emacs-lisp :results silent :eval no-export
1.194+ (unless (slime-connected-p) (slime))
1.195+ (slime-eval '(ql:quickload :core/tests))
1.196+ (slime-repl-set-package "CORE/TESTS")
1.197+#+end_src
1.198 * cargo-update-dir :rust:
1.199 :PROPERTIES:
1.200 :ID: 67dc87bb-a27b-46e4-a02f-58daac514630
1.201@@ -461,6 +456,9 @@
1.202 rustc -vV | sed -n -e 's/^host: //p'
1.203 #+end_src
1.204 * post-align-table :table:
1.205+:PROPERTIES:
1.206+:ID: d8a3cc05-a4ec-4820-935d-63f676ee32a3
1.207+:END:
1.208 #+NAME: post-align-tables
1.209 #+header: :var text="|5|22222|\n|0||\n|12|45|\n|---\n|||\n#+TBLFM:@>$1=vsum(@1..@-1)\n\n|1|22222|\n|0||\n|12|45|\n"
1.210 #+BEGIN_SRC emacs-lisp :results value :exports both
1.211@@ -478,6 +476,9 @@
1.212 (buffer-string))
1.213 #+END_SRC
1.214 * insert-table-from-file :table:fs:
1.215+:PROPERTIES:
1.216+:ID: bde8705d-0969-493d-91b9-51a93ae09efa
1.217+:END:
1.218 #+NAME: insert-table-from-file
1.219 #+HEADER: :var tname="table" fname="/tmp/tbl.org" newcaption="" newattr="" newname=""
1.220 #+BEGIN_SRC elisp :results output drawer
1.221@@ -514,6 +515,9 @@
1.222 (princ tbl))
1.223 #+END_SRC
1.224 * filter-table :table:
1.225+:PROPERTIES:
1.226+:ID: cec80330-99c3-4dab-9b13-bb0a520ace73
1.227+:END:
1.228 #+NAME: filter-table
1.229 #+HEADER: :var tbl="" col=0 vals=""
1.230 #+BEGIN_SRC elisp :results value :colnames y
1.231@@ -528,6 +532,9 @@
1.232 finally return newtbl)))
1.233 #+END_SRC
1.234 * filter-table-re :table:rx:
1.235+:PROPERTIES:
1.236+:ID: 61e82902-3108-4cee-8e02-3e9d6770f5cb
1.237+:END:
1.238 #+NAME: filter-table-re
1.239 #+HEADER: :var tbl="" col=0 vals=".*"
1.240 #+BEGIN_SRC elisp :results value :colnames y
1.241@@ -545,6 +552,9 @@
1.242 finally return newtbl)))
1.243 #+END_SRC
1.244 * group-table :table:
1.245+:PROPERTIES:
1.246+:ID: d1cb8d5d-14bc-4fbe-baf0-ff819d51ec4c
1.247+:END:
1.248 #+NAME: group-table
1.249 #+HEADER: :var tbl="" grp="Name" op="sum" rescols="B"
1.250 #+BEGIN_SRC python :results output verbatim drawer :colnames no
1.251@@ -571,6 +581,9 @@
1.252
1.253 #+END_SRC
1.254 * insert-file :fs:
1.255+:PROPERTIES:
1.256+:ID: 57196c4d-a275-4023-8462-a5847676347c
1.257+:END:
1.258 #+NAME: lobInsertFile
1.259 #+HEADER: :var filename="/tmp/foo"
1.260 #+begin_src elisp :results value raw drawer
2.1--- a/workflows.org Tue Aug 27 21:35:44 2024 -0400
2.2+++ b/workflows.org Wed Sep 04 16:59:32 2024 -0400
2.3@@ -77,7 +77,7 @@
2.4 ** Inbox
2.5 :PROPERTIES:
2.6 :ID: 1b426ef7-b88b-4b66-8413-df37d8312dcd
2.7-:LOCATION: [[vc:comp/core/-/blob/branch/default/emacs/lib/inbox.el][inbox.el]]
2.8+:LOCATION: [[vc:core/file/tip/emacs/lib/inbox.el][inbox.el]]
2.9 :END:
2.10 The inbox is a flat list of [[id:249ae0a5-0ef8-4d8a-be61-f408fb2b2cff][items]] usually found in the
2.11 =org-inbox-file= (default is ~/org/inbox.org). Items are [[https://orgmode.org/manual/Capture.html][captured]] by
2.12@@ -89,7 +89,7 @@
2.13 ** Scrum
2.14 :PROPERTIES:
2.15 :ID: 44e6ff33-ad62-4ef0-a188-506f837648d8
2.16-:LOCATION: [[vc:comp/core/-/blob/branch/default/emacs/lib/scrum.el][scrum.el]]
2.17+:LOCATION: [[vc:core/file/tip/emacs/lib/scrum.el][scrum.el]]
2.18 :END:
2.19 We apply a [[https://www.scrum.org/resources/what-scrum-module][scrum]]-like framework to plan our projects and tasks.
2.20
2.21@@ -160,7 +160,7 @@
2.22 Zettelkasten (see [[https://github.com/org-roam/org-roam][org-roam]]).
2.23
2.24 As of [2024-08-24 Sat] this has not been implemented, but we intend to
2.25-implement a fully connected knowledge graph. See [[vc:comp/core/-/blob/branch/default/emacs/lib/graph.el][graph.el]].
2.26+implement a fully connected knowledge graph. See [[vc:core/file/tip/emacs/lib/graph.el][graph.el]].
2.27 ** Documentation
2.28 :PROPERTIES:
2.29 :ID: 03e13d7e-6cda-46d4-830f-5671518bd32f
2.30@@ -194,4 +194,4 @@
2.31 :ID: ca0dcc07-0517-4d04-86f0-905537cb7801
2.32 :END:
2.33 When an item is archived, it is moved to a file under version-control
2.34-in the [[vc:comp/archive][archive]] project.
2.35+in the [[vc:org/archive][archive]] project.