guixconfig/home/emacs/templates
2023-12-11 11:59:44 +01:00

86 lines
2.7 KiB
Text

fundamental-mode
(sign "-- DZ " (format-time-string "%Y-%m-%d"))
prog-mode
(vip-title (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (s str) " " n
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n)
(fixme (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME ")
(todo (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO ")
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
scheme-mode
(define-guix-egg
"(define-public chicken-" (s egg-name)
n> "(package"
n> "(name \"chicken-" egg-name "\")"
n> "(version \"" (s egg-version) "\")"
n> "(source"
n> "(origin"
n> "(method url-fetch)"
n> "(uri (egg-uri \"" egg-name "\" version))"
n> "(sha256"
n> "(base32"
n> "\"0z05x7f154n9bgmainrsmncf5i6dil43r9ymr3rdgwbg4wnxmz4s\"))))"
n> "(propagated-inputs"
n> "(list " (s inputs) "))"
n> "(native-inputs"
n> "(list " (s native-inputs) "))"
n> "(build-system chicken-build-system)"
n> "(arguments '(#:egg-name \"" egg-name "\"))"
n> "(synopsis \"" (s synopsis) "\")"
n> "(home-page \"https://wiki.call-cc.org/eggref/5/" egg-name "\")"
n> "(description \"" synopsis "\")"
n> "(license license:" (s license) ")))")
org-mode
(src
"#+begin_src " p
n p n
"#+end_src")
(advent-of-code-day
"* Day " (s day) ": " p
n> n> "Get the puzzle solution as [[./day" day ".scm][tangled .scm file]]."
n> n> "** Part One"
n> n> "#+NAME: day" day "-imports"
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
n>
n> "#+end_src"
n> n> "#+NAME: day" day "-input-scm"
n> "#+begin_src scheme :exports none :noweb yes :tangle day" day ".scm"
n> "(define input \""
n> "<<day" day "-input>>\")"
n> "#+end_src"
n> n> "*** Quest"
n> n> "*** Puzzle Solution"
n> n> "**** Calculation"
n> n> "#+NAME: day" day "-part1-calc-fn"
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
n> ""
n> "#+end_src"
n> n> "#+CALL: day" day "-part1-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-1)\"]()"
n> n> "** Part Two"
n> n> "*** Quest"
n> n> "*** Puzzle Solution"
n> n> "**** Calculation"
n> n> "#+NAME: day" day "-part2-calc-fn"
n> "#+begin_src scheme :tangle day" day ".scm :noweb strip-tangle"
n> ""
n> "#+end_src"
n>n> "#+CALL: day" day "-part2-calc-fn[:var input=day" day "-input[] :epilogue \"(calc-part-2)\"]()"
n> n> "** Puzzle Input"
n> n> "#+NAME: day" day "-input"
n> "#+begin_src fundamental"
n> "#+end_src")
;; Local Variables:
;; mode: lisp-data
;; outline-regexp: "[a-z]"
;; End: