-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: why not a single command for the "eepitch block" idiom? #10
Comments
|
Moving thread to mailing list per request. Also cross-posting to
Github. Apologies for the duplicate message.
"Eduardo Ochs" ***@***.***> writes:
You're right that "generally, one would either execute all three or
none of them", but I found that there were many cases in which I just
wanted to redisplay the target buffer at the window at the right
without restarting it, and in these cases I would just execute the
(eepitch-shell)...
Yes, I can see value in not altering the behaviour of eepitch-shell. I
wasn't proposing that the definition of eepitch-$name be altered. My
proposal was for a new function (or family of functions), say,
eepitch-init-$name where (eepitch-init-$name) would be equivalent to
something like (progn (eepitch-$name) (eepitch-kill) (eepitch-$name)) .
…--
Suhail
|
|
"Eduardo Ochs" ***@***.***> 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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am new to
eev
. I understand the need for having to call, in succession,something like
eepitch-shell
,eepitch-kill
,eepitch-shell
and I appreciatethere being helpers such as
eewrap-eepitch
. However, if I understandcorrectly, it seems that the three invocations resulting from
eewrap-eepitch
are intended to be treated as a transaction and should be executed in
succession. I.e., generally, one would either execute all three or none of
them.
Assuming my understanding above is correct, why not have a wrapper that
internally invokes the three commands in succession? I.e., why not reify the
idiom into a single function (
eewrap-eepitch
could be updated to generate aninvocation to that single function)?
The text was updated successfully, but these errors were encountered: