diff options
| author | tslil clingman <> | 2020-04-23 22:37:31 -0700 |
|---|---|---|
| committer | tslil clingman <> | 2020-04-23 22:37:31 -0700 |
| commit | 6ba333c21a29be757a5f7735ae8bcde153346e60 (patch) | |
| tree | 4eb49e015decc4e9cd13f507465c2d6891280f6e /emacs/scripts | |
| parent | 24648353e3e2e63e4683aa7021deb87539d6d047 (diff) | |
cdm-mode tweaks, latex and spelling fixes, selectrum work-arounds
Diffstat (limited to 'emacs/scripts')
| -rw-r--r-- | emacs/scripts/cdm-mode.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/emacs/scripts/cdm-mode.el b/emacs/scripts/cdm-mode.el index d645e66..d4b1964 100644 --- a/emacs/scripts/cdm-mode.el +++ b/emacs/scripts/cdm-mode.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2020-03-19 11:07:15 (tslil@bison)> +;; Time-stamp: <2020-04-23 21:05:46 (tslil@bison)> (defvar cdm-arr-type-list '(("arrow" . "a") ("2-cell arrow" . "n") @@ -21,12 +21,14 @@ ("up -> down" . 2) ("down -> up" . 3))) -(defvar cdm-wrap-list '("diagram" "tikzpicture" "diagram*" "dgrm")) +(defvar cdm-wrap-list '("diagram" "tikzpicture" "diagram*" "vdiagram" "vsubdiagram")) (defvar cdm--pos-list '("below" "right" "left" "above" "midway" "below right" "below left" "above right" "above left" "none")) +(defvar cdm-scale-arrow "la") + (defvar cdm-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c a") 'cdm-insert-arrow) @@ -239,6 +241,9 @@ (when ,dest (let*-unless-null ,list ,@body)))) `(progn ,@body))) +(defun cdm--concat-arrow-scale (string) + (concat cdm-scale-arrow (if (string-blank-p string) "" ",") string)) + (defun cdm-insert-arrow (extra-props) (interactive "P") (when (cdm--get-nodes) @@ -257,7 +262,7 @@ (labelled (unless (string-suffix-p "d" type) (char-equal ?\C-m (read-char "Labelled (Return = yes)?")))) (label-props (when (and (not par) labelled) - (read-string "Label properties: "))) + (cdm--concat-arrow-scale (read-string "Label properties: ")))) (slide (when cell (read-string "Slide: "))) (length (when cell (read-string "Length: ")))) @@ -275,7 +280,8 @@ ;; TODO: Orientation? This is broken with swaps if one changes orientation... (defun cdm--prompt-insert-arrow-square (node-1 node-2 swap) (when (cdm--get-nodes) - (let (r d) + (let (r d + (swap (cdm--concat-arrow-scale swap))) (dolist (n cdm--node-list) (when (or (string-equal node-1 (cdr n)) (string-equal node-2 (cdr n))) |
