unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Josef.Bauer.NOSPAM@web.de
Subject: Re: Dired shell command on file asymchronously
Date: 24 Jun 2005 19:43:34 +0200	[thread overview]
Message-ID: <wtpll4zsla1.fsf@uhu.mchp.siemens.de> (raw)
In-Reply-To: mailman.1102.1119633137.2857.help-gnu-emacs@gnu.org

Hi,

I just found that I added a minor improvement in the meantime. Using
'shell-quote-argument' file names with spaces and such are working.

Here is the new version:

;-----------------------------------------------------------------
(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 (shell-quote-argument (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 "\\.doc$" "OOo" ) (list "\\.xls$" "OOo")))
;-----------------------------------------------------------------

Greetings

Josef

  parent reply	other threads:[~2005-06-24 17:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1007.1119560755.2857.help-gnu-emacs@gnu.org>
2005-06-24 12:59 ` Dired shell command on file asymchronously Josef.Bauer.NOSPAM
     [not found]   ` <mailman.1102.1119633137.2857.help-gnu-emacs@gnu.org>
2005-06-24 17:43     ` Josef.Bauer.NOSPAM [this message]
2005-06-24 21:19       ` Kevin Rodgers
     [not found]       ` <mailman.1131.1119648589.2857.help-gnu-emacs@gnu.org>
2005-06-27 12:54         ` Josef.Bauer.NOSPAM
2005-06-24 18:10   ` Luis O. Silva
2005-06-24 13:06 ` asymchronously Dan Elliott
2005-06-24 18:17   ` asymchronously Luis O. Silva
2005-06-23 22:13 Dired shell command on file asymchronously Luis O. Silva
2005-06-24 11:42 ` Emilio Lopes

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=wtpll4zsla1.fsf@uhu.mchp.siemens.de \
    --to=josef.bauer.nospam@web.de \
    /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).