summaryrefslogtreecommitdiff
path: root/emacs/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/scripts')
-rw-r--r--emacs/scripts/acquiesce.el1
-rw-r--r--emacs/scripts/cdm-mode.el93
2 files changed, 48 insertions, 46 deletions
diff --git a/emacs/scripts/acquiesce.el b/emacs/scripts/acquiesce.el
index 9762be0..48d981a 100644
--- a/emacs/scripts/acquiesce.el
+++ b/emacs/scripts/acquiesce.el
@@ -1,5 +1,4 @@
;;; -*- lexical-binding: t -*-
-
(require 'cl-lib)
(defmacro default (expr default)
diff --git a/emacs/scripts/cdm-mode.el b/emacs/scripts/cdm-mode.el
index 401d1e3..43128bf 100644
--- a/emacs/scripts/cdm-mode.el
+++ b/emacs/scripts/cdm-mode.el
@@ -1,24 +1,23 @@
;;; -*- lexical-binding: t -*-
-
-;; Time-stamp: <2026-08-10 21h19 BST (763f23aa)>
+;; Time-stamp: <2026-08-26 20h29 BST (anker)>
(require 'cl)
(defvar cdm-arr-type-list '(("arrow" . "a")
- ("2-cell arrow" . "n")
- ("id" . "d")
- ("universal" . "u")
- ("2-cell" . "cn")
- ("2-cell iso" . "cni")
- ("2-cell eq" . "cne")
- ("3-cell" . "ct")
- ("3-cell eq" . "cte")
- ("proarrow" . "proarrow")
- ("proid" . "proequal")
- ("prodotted" . "prodotted")
- ("parallel" . "p")
- ("monomorphism" . "m")
- ("epimorphism" . "e")))
+ ("2-cell arrow" . "n")
+ ("id" . "d")
+ ("universal" . "u")
+ ("2-cell" . "cn")
+ ("2-cell iso" . "cni")
+ ("2-cell eq" . "cne")
+ ("3-cell" . "ct")
+ ("3-cell eq" . "cte")
+ ("proarrow" . "proarrow")
+ ("proid" . "proequal")
+ ("prodotted" . "prodotted")
+ ("parallel" . "p")
+ ("monomorphism" . "m")
+ ("epimorphism" . "e")))
(defvar cdm-parr-dir-list '(("left -> right" . 0)
("right -> left" . 1)
@@ -139,7 +138,9 @@
(back-to-indentation)
(unless (= (point) (line-end-position))
(end-of-line)
- (newline-and-indent)))
+ ;; (newline-and-indent)
+ (newline)
+ ))
(defun cdm--insert-raw-node (name modifiers content &optional goto extra)
(cdm--not-so-smart-move)
@@ -182,41 +183,43 @@
(defun cdm--insert-cell-tex (from-node to-node type &optional label-props slide length)
(end-of-line)
- (newline-and-indent)
+ ;; (newline-and-indent)
+ (newline)
(let* ((iso (string-suffix-p "i" type))
- (typ (substring-no-properties type 1 (if iso -1 (length type))))
- (yes-props (cdm--string-good-p label-props))
- (yes-slide (cdm--string-good-p slide))
- (yes-length (cdm--string-good-p length))
- (yes-type (not (string-equal typ "n")))
-
- (lps (if (or yes-props yes-type yes-slide yes-length)
- (concat "[" (if yes-props label-props "") "]") ""))
- (tys (if (or yes-type yes-slide yes-length)
- (concat "[" typ "]") ""))
- (sls (if (or yes-slide yes-length)
- (concat "[" (if yes-slide slide cdm-default-cell-slide) "]")
- ""))
- (lns (if yes-length (concat "[" length "]") "")))
+ (typ (substring-no-properties type 1 (if iso -1 (length type))))
+ (yes-props (cdm--string-good-p label-props))
+ (yes-slide (cdm--string-good-p slide))
+ (yes-length (cdm--string-good-p length))
+ (yes-type (not (string-equal typ "n")))
+
+ (lps (if (or yes-props yes-type yes-slide yes-length)
+ (concat "[" (if yes-props label-props "") "]") ""))
+ (tys (if (or yes-type yes-slide yes-length)
+ (concat "[" typ "]") ""))
+ (sls (if (or yes-slide yes-length)
+ (concat "[" (if yes-slide slide cdm-default-cell-slide) "]")
+ ""))
+ (lns (if yes-length (concat "[" length "]") "")))
(insert "\\cell" (if iso "i" "")
- lps tys sls lns
- "{(" from-node ")}"
- "{(" to-node ")}"
- "{};"))
+ lps tys sls lns
+ "{(" from-node ")}"
+ "{(" to-node ")}"
+ "{};"))
(backward-char 2))
(defun cdm--insert-arrow-tex (from-node to-node type &optional label-props draw-style misc)
(end-of-line)
- (newline-and-indent)
+ (newline)
+ ;; (newline-and-indent)
(insert "\\draw[" type
- (if (cdm--string-good-p draw-style)
- (concat "," draw-style) "")
- "]"
- (if (cdm--string-good-p misc) misc "")
- "(" from-node ")to"
- (if label-props
- (concat " node[" label-props "]{$$}") "")
- "(" to-node ");")
+ (if (cdm--string-good-p draw-style)
+ (concat "," draw-style) "")
+ "]"
+ (if (cdm--string-good-p misc) misc "")
+ "(" from-node ")to"
+ (if label-props
+ (concat " node[" label-props "]{$$}") "")
+ "(" to-node ");")
(when label-props (search-backward "$}")))
(defun cdm--insert-parallel-arrows (from-node to-node &optional labelled)