help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired-do-shell-command as "bash program"


From: Torben Knudsen
Subject: Re: dired-do-shell-command as "bash program"
Date: Fri, 16 May 2008 08:15:39 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>>>> "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 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]