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

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

Re: Dired shell command on file asymchronously


From: Josef . Bauer . NOSPAM
Subject: Re: Dired shell command on file asymchronously
Date: 24 Jun 2005 19:43:34 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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


reply via email to

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