* dired-do-shell-command as "bash program"
@ 2008-05-09 6:37 Torben Knudsen
2008-05-09 7:06 ` David Hansen
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Torben Knudsen @ 2008-05-09 6:37 UTC (permalink / raw
To: help-gnu-emacs
How can i do dired-do-shell-command as "bash program" in the sense
that I can keep working with my emacs also when the started program
runs just as it was started from a shell with a & at the end.
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-09 6:37 dired-do-shell-command as "bash program" Torben Knudsen
@ 2008-05-09 7:06 ` David Hansen
2008-05-09 14:42 ` Rodrigo Lazo
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: David Hansen @ 2008-05-09 7:06 UTC (permalink / raw
To: help-gnu-emacs
On Fri, 09 May 2008 08:37:07 +0200 Torben Knudsen wrote:
> How can i do dired-do-shell-command as "bash program" in the sense
> that I can keep working with my emacs also when the started program
> runs just as it was started from a shell with a & at the end.
Append a `&'. `*' and `?' are interpreted as one would expect.
E.g. for a single file do "program ? &" if you have marked multiple
files: "program * &".
One drawback is that you can only run one async shell command at the
time or you have to rename the output buffer.
David
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-09 6:37 dired-do-shell-command as "bash program" Torben Knudsen
2008-05-09 7:06 ` David Hansen
@ 2008-05-09 14:42 ` Rodrigo Lazo
[not found] ` <mailman.11364.1210316908.18990.help-gnu-emacs@gnu.org>
[not found] ` <mailman.11380.1210346409.18990.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 10+ messages in thread
From: Rodrigo Lazo @ 2008-05-09 14:42 UTC (permalink / raw
To: help-gnu-emacs
Torben Knudsen <tk@es.aau.dk> writes:
> How can i do dired-do-shell-command as "bash program" in the sense
> that I can keep working with my emacs also when the started program
> runs just as it was started from a shell with a & at the end.
Take a look at background.el
http://www.jgk.org/src/background.el
Regards
--
Rodrigo Lazo (rlazo)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
[not found] ` <mailman.11364.1210316908.18990.help-gnu-emacs@gnu.org>
@ 2008-05-13 8:02 ` Torben Knudsen
2008-05-13 12:49 ` Kevin Rodgers
[not found] ` <mailman.11546.1210682964.18990.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 10+ messages in thread
From: Torben Knudsen @ 2008-05-13 8:02 UTC (permalink / raw
To: help-gnu-emacs
>>>>> "David" == David Hansen <david.hansen@gmx.net> writes:
David> On Fri, 09 May 2008 08:37:07 +0200 Torben Knudsen wrote:
>> How can i do dired-do-shell-command as "bash program" in the sense
>> that I can keep working with my emacs also when the started program
>> runs just as it was started from a shell with a & at the end.
David> Append a `&'. `*' and `?' are interpreted as one would expect.
David> E.g. for a single file do "program ? &" if you have marked
David> multiple files: "program * &".
Works fine but I use defaults from dired-guess-shell-alist-user and I
can't figure out how to avoid typing the default myself to get this
working. If I type the command myself it works perfectly.
David> One drawback is that you can only run one async shell command
David> at the time or you have to rename the output buffer.
Not a big problem for me.
Thanks for the answer.
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
[not found] ` <mailman.11380.1210346409.18990.help-gnu-emacs@gnu.org>
@ 2008-05-13 8:04 ` Torben Knudsen
2008-05-14 8:29 ` Josef.Bauer.NOSPAM
0 siblings, 1 reply; 10+ messages in thread
From: Torben Knudsen @ 2008-05-13 8:04 UTC (permalink / raw
To: help-gnu-emacs
>>>>> "Rodrigo" == Rodrigo Lazo <rlazo.paz@gmail.com> writes:
Rodrigo> Torben Knudsen <tk@es.aau.dk> writes:
>> How can i do dired-do-shell-command as "bash program" in the sense
>> that I can keep working with my emacs also when the started program
>> runs just as it was started from a shell with a & at the end.
Rodrigo> Take a look at background.el
Rodrigo> http://www.jgk.org/src/background.el
I have taken a look but I have difficulties to find doc telling what
it does and how it compares to dired-do-shell-command.
Thanks for the answer.
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-13 8:02 ` Torben Knudsen
@ 2008-05-13 12:49 ` Kevin Rodgers
[not found] ` <mailman.11546.1210682964.18990.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2008-05-13 12:49 UTC (permalink / raw
To: help-gnu-emacs
Torben Knudsen wrote:
>>>>>> "David" == David Hansen <david.hansen@gmx.net> writes:
>
> David> On Fri, 09 May 2008 08:37:07 +0200 Torben Knudsen wrote:
>>> How can i do dired-do-shell-command as "bash program" in the sense
>>> that I can keep working with my emacs also when the started program
>>> runs just as it was started from a shell with a & at the end.
>
> David> Append a `&'. `*' and `?' are interpreted as one would expect.
> David> E.g. for a single file do "program ? &" if you have marked
> David> multiple files: "program * &".
>
> Works fine but I use defaults from dired-guess-shell-alist-user and I
> can't figure out how to avoid typing the default myself to get this
> working. If I type the command myself it works perfectly.
`M-n' should insert the default in the minibuffer, for any command.
> David> One drawback is that you can only run one async shell command
> David> at the time or you have to rename the output buffer.
>
> Not a big problem for me.
>
> Thanks for the answer.
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
[not found] ` <mailman.11546.1210682964.18990.help-gnu-emacs@gnu.org>
@ 2008-05-14 7:13 ` Torben Knudsen
0 siblings, 0 replies; 10+ messages in thread
From: Torben Knudsen @ 2008-05-14 7:13 UTC (permalink / raw
To: help-gnu-emacs
>>>>> "Kevin" == Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
Kevin> Torben Knudsen wrote:
>>>>>>> "David" == David Hansen <david.hansen@gmx.net> writes:
>>
David> On Fri, 09 May 2008 08:37:07 +0200 Torben Knudsen wrote:
>>>> How can i do dired-do-shell-command as "bash program" in the
>>>> sense that I can keep working with my emacs also when the started
>>>> program runs just as it was started from a shell with a & at the
>>>> end.
>>
David> Append a `&'. `*' and `?' are interpreted as one would expect.
David> E.g. for a single file do "program ? &" if you have marked
David> multiple files: "program * &".
>> Works fine but I use defaults from dired-guess-shell-alist-user
>> and I can't figure out how to avoid typing the default myself to
>> get this working. If I type the command myself it works perfectly.
Kevin> `M-n' should insert the default in the minibuffer, for any
Kevin> command.
When I use ! on a pdf file I se [acroread] as default but doing M-n I
get:
next-history-element: End of history; no default available [2 times]
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-13 8:04 ` Torben Knudsen
@ 2008-05-14 8:29 ` Josef.Bauer.NOSPAM
2008-05-16 6:12 ` Torben Knudsen
2008-05-16 6:15 ` Torben Knudsen
0 siblings, 2 replies; 10+ messages in thread
From: Josef.Bauer.NOSPAM @ 2008-05-14 8:29 UTC (permalink / raw
To: help-gnu-emacs
Rodrigo> http://www.jgk.org/src/background.el
Torben> I have taken a look but I have difficulties to find doc
Torben> telling what it does and how it compares to
Torben> dired-do-shell-command.
Hi,
this is what I use (in my '.emacs'):
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun dired-do-shell-command-in-background (command)
"In dired, do shell command in background on the file or directory named on this line."
(interactive
(list (dired-read-shell-command (concat "& on " "%s: ") nil (list (dired-get-filename)))))
(call-process command nil 0 nil (dired-get-filename)))
(add-hook 'dired-load-hook
(function (lambda ()
(load "dired-x")
(define-key dired-mode-map "&" 'dired-do-shell-command-in-background))))
(setq dired-guess-shell-alist-user
(list (list "\\.wav$" "wavesurfer") (list "\\.au$" "wavesurfer") (list "\\.pdf$" "acroread")
(list "\\.doc$" "OOo" ) (list "\\.xls$" "OOo") (list "\\.tif$" "gqview") (list "\\.jpg$" "gqview")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In dired (over the respective file) press '&' to start a shell command
in the background. Command completion is the same as in
'dired-do-shell-command'.
I had posted this long ago in Usenet but Google does not find it any more
:-(
Greetings
Josef
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-14 8:29 ` Josef.Bauer.NOSPAM
@ 2008-05-16 6:12 ` Torben Knudsen
2008-05-16 6:15 ` Torben Knudsen
1 sibling, 0 replies; 10+ messages in thread
From: Torben Knudsen @ 2008-05-16 6:12 UTC (permalink / raw
To: help-gnu-emacs
>>>>> "Josef" == Josef Bauer NOSPAM <Josef.Bauer.NOSPAM@web.de> writes:
Rodrigo> http://www.jgk.org/src/background.el
Torben> I have taken a look but I have difficulties to find doc
Torben> telling what it does and how it compares to
Torben> dired-do-shell-command.
Josef> Hi,
Josef> this is what I use (in my '.emacs'):
Josef> ........
Thanks, this works perfectly and was exactly what I wanted.
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dired-do-shell-command as "bash program"
2008-05-14 8:29 ` Josef.Bauer.NOSPAM
2008-05-16 6:12 ` Torben Knudsen
@ 2008-05-16 6:15 ` Torben Knudsen
1 sibling, 0 replies; 10+ messages in thread
From: Torben Knudsen @ 2008-05-16 6:15 UTC (permalink / raw
To: help-gnu-emacs
>>>>> "Josef" == Josef Bauer NOSPAM <Josef.Bauer.NOSPAM@web.de> writes:
I think the below function should be part of emacs somehow
Rodrigo> http://www.jgk.org/src/background.el
Torben> I have taken a look but I have difficulties to find doc
Torben> telling what it does and how it compares to
Torben> dired-do-shell-command.
Josef> Hi,
Josef> this is what I use (in my '.emacs'):
Josef> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Josef> (defun dired-do-shell-command-in-background (command) "In
Josef> dired, do shell command in background on the file or directory
Josef> named on this line." (interactive (list
Josef> (dired-read-shell-command (concat "& on " "%s: ") nil (list
Josef> (dired-get-filename))))) (call-process command nil 0 nil
Josef> (dired-get-filename)))
Josef> (add-hook 'dired-load-hook (function (lambda () (load
Josef> "dired-x") (define-key dired-mode-map "&"
Josef> 'dired-do-shell-command-in-background))))
Josef> (setq dired-guess-shell-alist-user (list (list "\\.wav$"
Josef> "wavesurfer") (list "\\.au$" "wavesurfer") (list "\\.pdf$"
Josef> "acroread") (list "\\.doc$" "OOo" ) (list "\\.xls$" "OOo")
Josef> (list "\\.tif$" "gqview") (list "\\.jpg$" "gqview")))
Josef> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Josef> In dired (over the respective file) press '&' to start a shell
Josef> command in the background. Command completion is the same as in
Josef> 'dired-do-shell-command'.
Josef> I had posted this long ago in Usenet but Google does not find
Josef> it any more :-(
Josef> Greetings
Josef> Josef
--
Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826
Section of Automation and Control, Email : tk@es.aau.dk
Department of Electronic Systems,
Aalborg University
Fredrik Bajersvej 7
DK-9220 Aalborg Ø
Denmark
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-05-16 6:15 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09 6:37 dired-do-shell-command as "bash program" Torben Knudsen
2008-05-09 7:06 ` David Hansen
2008-05-09 14:42 ` Rodrigo Lazo
[not found] ` <mailman.11364.1210316908.18990.help-gnu-emacs@gnu.org>
2008-05-13 8:02 ` Torben Knudsen
2008-05-13 12:49 ` Kevin Rodgers
[not found] ` <mailman.11546.1210682964.18990.help-gnu-emacs@gnu.org>
2008-05-14 7:13 ` Torben Knudsen
[not found] ` <mailman.11380.1210346409.18990.help-gnu-emacs@gnu.org>
2008-05-13 8:04 ` Torben Knudsen
2008-05-14 8:29 ` Josef.Bauer.NOSPAM
2008-05-16 6:12 ` Torben Knudsen
2008-05-16 6:15 ` Torben Knudsen
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.