From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josef.Bauer.NOSPAM@web.de Newsgroups: gmane.emacs.help Subject: Re: dired-do-shell-command as "bash program" Date: 14 May 2008 10:29:51 +0200 Organization: Linux Private Site Message-ID: 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=us-ascii X-Trace: ger.gmane.org 1210771872 25256 80.91.229.12 (14 May 2008 13:31:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 May 2008 13:31:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 14 15:31:49 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 1JwH50-0003PY-PS for geh-help-gnu-emacs@m.gmane.org; Wed, 14 May 2008 15:31:39 +0200 Original-Received: from localhost ([127.0.0.1]:40834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwH4H-0006vF-JM for geh-help-gnu-emacs@m.gmane.org; Wed, 14 May 2008 09:30:53 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news0.de.colt.net!newsfeed2.sbs.de!news.mch.sbs.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: storch.mchp.siemens.de Original-X-Trace: daniel-new.mch.sbs.de 1210753791 4857 139.25.2.155 (14 May 2008 08:29:51 GMT) Original-X-Complaints-To: abuse@siemens.de Original-NNTP-Posting-Date: Wed, 14 May 2008 08:29:51 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: news.stanford.edu gnu.emacs.help:158615 X-Mailman-Approved-At: Wed, 14 May 2008 09:28:08 -0400 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:53985 Archived-At: 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