all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Sh scripts and yasnippet
@ 2010-08-12 11:03 Andrea Crotti
  2010-08-12 11:32 ` Andrea Crotti
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Crotti @ 2010-08-12 11:03 UTC (permalink / raw)
  To: help-gnu-emacs

I just got an idea that could maybe make life easier to sysadmins.

Given a script like

--8<---------------cut here---------------start------------->8---
#!/bin/sh
DST=$1
SRC=$2

cp -R $DST $SRC
--8<---------------cut here---------------end--------------->8---


Sometimes it's hard to remember what are the arguments without looking
into the code or read the usage.
And more important maybe the script does something which now is wrong,
so it would be better to check first.

What if we could have something like

- script to snippet
- snippet expansion
- open a confirmation buffer with the values expanded and run

would it not be great?
It could work for any language script, but we have to know how
substitutions are done, and it could be not always trivial (shift in sh
scripts for example).

Anyone interested?




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Sh scripts and yasnippet
  2010-08-12 11:03 Sh scripts and yasnippet Andrea Crotti
@ 2010-08-12 11:32 ` Andrea Crotti
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Crotti @ 2010-08-12 11:32 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:
>
> - script to snippet
> - snippet expansion
> - open a confirmation buffer with the values expanded and run
>
> would it not be great?
> It could work for any language script, but we have to know how
> substitutions are done, and it could be not always trivial (shift in sh
> scripts for example).
>
> Anyone interested?

But maybe the other way around could be much easier, we create snippets
instead of scripts, and if needed we can still convert them to normal
shell scripts.

(That would imply removing elisp code though and keeping them quite
simple.)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-12 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12 11:03 Sh scripts and yasnippet Andrea Crotti
2010-08-12 11:32 ` Andrea Crotti

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.