unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Josef.Bauer.NOSPAM@web.de
To: help-gnu-emacs@gnu.org
Subject: Re: dired-do-shell-command as "bash program"
Date: 14 May 2008 10:29:51 +0200	[thread overview]
Message-ID: <wtpd4npcmps.fsf@storch.mchp.siemens.de> (raw)
In-Reply-To: 87fxsmsk84.fsf@es.aau.dk


    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


  reply	other threads:[~2008-05-14  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-05-16  6:12       ` Torben Knudsen
2008-05-16  6:15       ` Torben Knudsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wtpd4npcmps.fsf@storch.mchp.siemens.de \
    --to=josef.bauer.nospam@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).