From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Torben Knudsen Newsgroups: gmane.emacs.help Subject: Re: dired-do-shell-command as "bash program" Date: Fri, 16 May 2008 08:15:39 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: <87ej82vkok.fsf@es.aau.dk> References: <87od7gf0fg.fsf@es.aau.dk> <87fxsmsk84.fsf@es.aau.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1210920136 30424 80.91.229.12 (16 May 2008 06:42:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2008 06:42:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 16 08:42:52 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JwteM-0003TM-33 for geh-help-gnu-emacs@m.gmane.org; Fri, 16 May 2008 08:42:42 +0200 Original-Received: from localhost ([127.0.0.1]:36361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jwtdc-0001D4-NQ for geh-help-gnu-emacs@m.gmane.org; Fri, 16 May 2008 02:41:56 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:eW7npRs5eq47NjPqI/OClQAoUc8= Original-Lines: 54 Original-NNTP-Posting-Host: 192.38.50.63 Original-X-Trace: news.sunsite.dk DXC=]LlaRC7NK; jO3d^23S\Y2mYSB=nbEKnkkTekT_m2IJNj_Eg>6@:Aacb=UPemKa4?0e[I0j4Rm3UFo Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:158672 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54032 Archived-At: >>>>> "Josef" == Josef Bauer NOSPAM 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