[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [edrx/eev] Question: why not a single command for the "eepitch block
From: |
Suhail |
Subject: |
Re: [edrx/eev] Question: why not a single command for the "eepitch block" idiom? (Issue #10) |
Date: |
Sat, 24 Feb 2024 05:09:08 +0000 |
"Eduardo Ochs" <notifications@github.com> writes:
> I think that what you are proposing is this:
>
> (defun eepitch-shell-init () (interactive) (eepitch-shell) (eepitch-kill)
> (eepitch-shell))
Yes, modulo renaming. The code below allows one to generate the
definitions en masse (should one so desire).
#+begin_src elisp
(defun my/eepitch-init/mk (name)
"Make various eepitch-init-NAME functions."
(let* ((namestr (symbol-name name))
(cmdstr (concat "eepitch-" namestr))
(cmd (intern cmdstr))
(funstr (concat "eepitch-init-" namestr))
(fun (intern funstr))
(docstr (format "Initialize `%s' buffer.
This function was generated by `my/eepitch-init/mk'."
cmdstr)))
`(defun ,fun ()
,docstr
(interactive)
(,cmd)
(eepitch-kill)
(,cmd))))
(defmacro my/eepitch-init/gen ()
`(progn ,@ (mapcar 'my/eepitch-init/mk
'(R bash bsh clojure coqtop dash erl eshell eshell2
eshell3 expect fennel gcl gforth ghci gnuplot gs gst
guile hugs hugs98 ielm irb isympy julia ksh labltk
latex lua51 lua52 lua53 lua54 luajit lualatex luatex
maxima mf mitscheme mozrepl mpost mysql nodejs ocaml
octave pacmd perl pforth php polyml pwsh pwsh2 python
python2 python3 racket raku ruby sbcl scala scheme
scsh sh shell shell2 shell3 smjs sml tcl tclsh tcsh
tex tinyscheme wish yforth zsh))))
(my/eepitch-init/gen)
#+end_src
--
Suhail