* dired shell command on background
@ 2006-05-11 22:21 rodrigo lazo
2006-05-12 22:50 ` Peter Dyballa
2006-05-13 11:11 ` William Xu
0 siblings, 2 replies; 5+ messages in thread
From: rodrigo lazo @ 2006-05-11 22:21 UTC (permalink / raw)
hi everybody,
how could I make dired to execute a shell command on a file on the
background. Until now I was doing it with
X (dired-do-shell-command)
xpdf * &
But there must be a better way. I've seen something called
dired-do-background-shell-command on some pages about tree-dired but I
have no idea what it is about
Best regards
--
Rodrigo Lazo (rlazo)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dired shell command on background
2006-05-11 22:21 rodrigo lazo
@ 2006-05-12 22:50 ` Peter Dyballa
2006-05-13 11:11 ` William Xu
1 sibling, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2006-05-12 22:50 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 12.05.2006 um 00:21 schrieb rodrigo lazo:
> how could I make dired to execute a shell command on a file on the
> background
How about this: you augment for GNU Emacs only the PATH environment
variable by one extra directory on top, which can be done in .emacs,
and in this extra directory you have little executable shell scripts
for each background command you need. You type ! or X on that file or
the marked files in the dired buffer and then enter one such script's
name, RET. This way Emacs would find for example the xpdf shell
script first, which has a contents à la:
#!/bin/sh
# some comments or description ...
/usr/local/bin/xpdf "$*" &
In case of xpdf it only accepts one file name. So it might be more
appropriate to write:
#!/bin/sh
# some comments or description ...
while [ $# -gt 0 ]; do
/usr/local/bin/xpdf $1 &
shift
done
--
Greetings
Pete
"Evolution" o __o _o _
°\___o /0~ -\<, ^\___ /=\\_/-%
oo~_______ /\ /\______/ \_________O/ O_______________o===>-->O--o____
""
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dired shell command on background
2006-05-11 22:21 rodrigo lazo
2006-05-12 22:50 ` Peter Dyballa
@ 2006-05-13 11:11 ` William Xu
1 sibling, 0 replies; 5+ messages in thread
From: William Xu @ 2006-05-13 11:11 UTC (permalink / raw)
"rodrigo lazo" <rlazo.paz@gmail.com> writes:
> how could I make dired to execute a shell command on a file on the
> background. Until now I was doing it with
>
> X (dired-do-shell-command)
> xpdf * &
>
> But there must be a better way.
I have a piece like this. Then for .pdf files, simply `X RET' will run
xpdf at the background.
(require 'dired-x)
(setq dired-guess-shell-alist-user
'((".dvi" "xdvi")
(".pdf" "xpdf")))
--
William
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dired shell command on background
[not found] <mailman.1709.1147386121.9609.help-gnu-emacs@gnu.org>
@ 2006-05-16 11:34 ` Josef.Bauer.NOSPAM
2006-05-16 14:31 ` Rodrigo Lazo
0 siblings, 1 reply; 5+ messages in thread
From: Josef.Bauer.NOSPAM @ 2006-05-16 11:34 UTC (permalink / raw)
rodrigo> I've seen something called
rodrigo> dired-do-background-shell-command on some pages about
rodrigo> tree-dired but I have no idea what it is about
Here 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$" "snack") (list "\\.au$" "snack") (list "\\.pdf$" "acroread")
(list "\\.doc$" "OOo" ) (list "\\.xls$" "OOo")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Once in dired-mode over e.g. a PDF file press '&' and proceed.
Regards
Josef
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dired shell command on background
2006-05-16 11:34 ` dired shell command on background Josef.Bauer.NOSPAM
@ 2006-05-16 14:31 ` Rodrigo Lazo
0 siblings, 0 replies; 5+ messages in thread
From: Rodrigo Lazo @ 2006-05-16 14:31 UTC (permalink / raw)
Thanks a lot!!!
that was exactly what I was looking for. :)
Josef.Bauer.NOSPAM@web.de wrote:
>
> rodrigo> I've seen something called
> rodrigo> dired-do-background-shell-command on some pages about
> rodrigo> tree-dired but I have no idea what it is about
>
> Here 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$" "snack") (list "\\.au$" "snack") (list "\\.pdf$" "acroread")
> (list "\\.doc$" "OOo" ) (list "\\.xls$" "OOo")))
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> Once in dired-mode over e.g. a PDF file press '&' and proceed.
>
> Regards
>
> Josef
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
--
Rodrigo Lazo (rlazo)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-16 14:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.1709.1147386121.9609.help-gnu-emacs@gnu.org>
2006-05-16 11:34 ` dired shell command on background Josef.Bauer.NOSPAM
2006-05-16 14:31 ` Rodrigo Lazo
2006-05-11 22:21 rodrigo lazo
2006-05-12 22:50 ` Peter Dyballa
2006-05-13 11:11 ` William Xu
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.