unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: formido <formido@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Bash Script Editing Mode?
Date: Thu, 07 Aug 2008 23:06:03 +0200	[thread overview]
Message-ID: <87myjomt6s.fsf@tux.homenetwork> (raw)
In-Reply-To: <361d08d2-b456-49c9-a578-53d1aaaf0b0f@a8g2000prf.googlegroups.com> (formido@gmail.com's message of "Thu, 7 Aug 2008 13:21:40 -0700 (PDT)")

formido <formido@gmail.com> writes:

> There's a shell mode, but it has a prompt and doesn't help you
> incrementally create a shell script as efficiently as it could, unless
> I'm missing something. Is there any shell script mode that works more
> like the elisp, python, or erlang repls, where you can execute your
> choice of several lines at once and you can go back and edit and
> execute the lines in situ? If I write a bash function, editing and
> reloading the function is a painful process. I'm looking for something
> a little bit like the Mac's BBEdit shell worksheets (only better).
>
> I considered altering the usual shell mode, but it would take more
> than slight edits, so I'm hoping something's already out there. For
> example, one should be able to go back to a function, tweak it, and
> reload with a minimum of keyboard fuss.
>
> Michael
>
May be that help:

,----[ C-h f shell-command-on-region RET ]
| shell-command-on-region is an interactive compiled Lisp function in
| `simple.el'.
| 
| It is bound to M-|, <menu-bar> <tools> <shell-on-region>.
| 
| (shell-command-on-region start end command &optional output-buffer
| replace error-buffer display-error-buffer)
| 
| Execute string command in inferior shell with region as input.
| Normally display output (if any) in temp buffer `*Shell Command Output*';
| Prefix arg means replace the region with it.  Return the exit code of
| command.
| 
| To specify a coding system for converting non-ASCII characters
| in the input and output to the shell command, use C-x RET c
| before this command.  By default, the input (from the current buffer)
| is encoded in the same coding system that will be used to save the file,
| `buffer-file-coding-system'.  If the output is going to replace the region,
| then it is decoded from that same coding system.
| 
| The noninteractive arguments are start, end, command,
| output-buffer, replace, error-buffer, and display-error-buffer.
| Noninteractive callers can specify coding systems by binding
| `coding-system-for-read' and `coding-system-for-write'.
| 
| If the command generates output, the output may be displayed
| in the echo area or in a buffer.
| If the output is short enough to display in the echo area
| (determined by the variable `max-mini-window-height' if
| `resize-mini-windows' is non-nil), it is shown there.  Otherwise
| it is displayed in the buffer `*Shell Command Output*'.  The output
| is available in that buffer in both cases.
| 
| If there is output and an error, a message about the error
| appears at the end of the output.
| 
| If there is no output, or if output is inserted in the current buffer,
| then `*Shell Command Output*' is deleted.
| 
| If the optional fourth argument output-buffer is non-nil,
| that says to put the output in some other buffer.
| If output-buffer is a buffer or buffer name, put the output there.
| If output-buffer is not a buffer and not nil,
| insert output in the current buffer.
| In either case, the output is inserted after point (leaving mark after it).
| 
| If replace, the optional fifth argument, is non-nil, that means insert
| the output in place of text from start to end, putting point and mark
| around it.
| 
| If optional sixth argument error-buffer is non-nil, it is a buffer
| or buffer name to which to direct the command's standard error output.
| If it is nil, error output is mingled with regular output.
| If display-error-buffer is non-nil, display the error buffer if there
| were any errors.  (This is always t, interactively.)
| In an interactive call, the variable `shell-command-default-error-buffer'
| specifies the value of error-buffer.
| 
| This function is advised.
| 
| Before-advice `shell-command-on-region-with-completion':
| Defined in shell-command.el, to enable tab-completion of commands
| and dir/filenames within the input context.  This advice also makes
| `shell-command-on-region' to use this current buffer as its input when
| a region is visible and inactive.
| Its prompt string is kept by `shell-command-on-region-prompt' and
| `shell-command-on-region-prompt-if-region-inactive'.
| 
| [back]
`----

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




  parent reply	other threads:[~2008-08-07 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07 20:21 Bash Script Editing Mode? formido
2008-08-07 20:49 ` Mike Treseler
2008-08-07 22:10   ` formido
2008-08-07 20:53 ` Lennart Borgman (gmail)
2008-08-07 21:06 ` Thierry Volpiatto [this message]
2008-08-07 21:20 ` Pascal J. Bourguignon
2008-08-07 21:59   ` formido
     [not found] ` <mailman.16033.1218143342.18990.help-gnu-emacs@gnu.org>
2008-08-07 22:01   ` formido
     [not found] ` <mailman.16028.1218142452.18990.help-gnu-emacs@gnu.org>
2008-08-07 22:03   ` formido

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87myjomt6s.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=formido@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).