|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; 2026-uf9.el. -*- lexical-binding: nil; -*-
;; This file:
;; https://anggtwu.net/elisp/2026-uf9.el.html
;; https://anggtwu.net/elisp/2026-uf9.el
;; (find-angg "elisp/2026-uf9.el")
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Version: 2026aug29
;; Status: Experimental!!!
;;
;; Some extra tools for UF-9.
;; This file redefines `M-9 M-e'.
;; Test: (find-angg "UXN/1.f")
;; See: (find-es "uxn" "uf9")
;; (find-angg ".emacs" "uf9")
;; Usage: (load "~/elisp/2026-uf9")
;;
;; Index:
;; «.find-uf9-k-f-g» (to "find-uf9-k-f-g")
;; «.find-uf9-links» (to "find-uf9-links")
;; «.eepitch-uf9» (to "eepitch-uf9")
;; «.M-9e» (to "M-9e")
;; «find-uf9-k-f-g» (to ".find-uf9-k-f-g")
;; Tests: (find-uf9-k ":")
;; (find-uf9-f "dup")
;; (find-uf9-f "dump")
;; (find-uf9-g "dup")
;;
(defun find-uf9-k (word &rest rest)
(apply 'find-uf9file "kernel.tal" (format "( `%s` -" word) rest))
(defun find-uf9-f (word &rest rest)
(apply 'find-uf9file "uf.f" (format "\\ `%s` " word) rest))
(defun find-uf9-g (word &rest rest)
(apply 'find-uf9file "GLOSSARY" (format "\n%s " word) rest))
;; «find-uf9-links» (to ".find-uf9-links")
;; Skel: (find-find-links-links-new "uf9" "word" "")
;; Test: (find-uf9-links)
;; (find-uf9-links "if")
;; (find-uf9-links "do")
;; (find-uf9-links "dump")
;; See: (find-angg ".emacs" "uf9")
;;
(defun find-uf9-links (&optional word &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for uf9."
(interactive)
(setq word (or word "{word}"))
(apply
'find-elinks
`((find-uf9-links ,word ,@pos-spec-list)
;; Convention: the first sexp always regenerates the buffer.
(find-efunction 'find-uf9-links)
""
,(ee-template0 "\
\\ (find-uf9-k \"{word}\")
\\ (find-uf9-f \"{word}\")
\\ (find-uf9-g \"{word}\")
# (find-uf9file \"uf.f\" \": {word} \")
# (find-uf9file \"uf.f\" \"\\\\ `{word}` \")
# (find-uf9file \"GLOSSARY\" \"\\n{word} \")
# (find-uf9file \"kernel.tal\" \"( `{word}` -\")
")
)
pos-spec-list))
;; «eepitch-uf9» (to ".eepitch-uf9")
(defun eepitch-uf9 () (interactive)
(eepitch-comint "uxncli uf.rom"
"~/usrc/uxn11/bin/uxncli ~/usrc/uf-9/uf.rom"))
;; «M-9e» (to ".M-9e")
;; This block redefines the action `M-9e', i.e., `M-9 M-e',
;; to make it a variant of `M-2e' that creates a 3-window
;; setting instead of a 2-window setting.
;; Based on: (find-efunction 'ee-eval-last-sexp-0)
;; Test: (ee-flash-current-line)
(defun ee-flash-current-line ()
(eeflash+ (ee-bol) (ee-eol) ee-highlight-spec))
;; Tests: (find-3a-e '(find-estring "abc\ndef\nghi"))
;; (find-3a-e '(find-estring "abc\ndef\nghi" :end))
(defun find-3a-e (sexp)
(find-3a nil '(find-ebuffer eepitch-buffer-name) sexp))
;; Tests: (find-3a-e-flash '(find-estring "abc\ndef\nghi"))
;; (find-3a-e-flash '(find-estring "abc\ndef\nghi" :end))
(defun find-3a-e-flash (sexp)
(find-3a-e `(progn ,sexp (ee-flash-current-line))))
;; To test this, eval the test sexps below with `M-9 M-e':
;; (find-estring "abc\ndef\nghi")
;; (find-estring "abc\ndef\nghi" :end)
(defun ee-eval-last-sexp-9 ()
(let ((sexp (read (ee-last-sexp))))
(ee-eval-last-sexp-0)
(find-3a-e-flash sexp)))
(provide '2026-uf9)
;; Local Variables:
;; coding: utf-8-unix
;; End: