[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dired: launch program withou stalling emacs
From: |
Josef G. Bauer |
Subject: |
Re: dired: launch program withou stalling emacs |
Date: |
Tue, 21 Jul 2009 08:34:00 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Hi,
>>>>> "Alain" == Alain Muls <alain.muls@telenet.be> writes:
Alain> The inconvenience of this is that I have to close the
Alain> program before I can resume working in emacs. Is there a
Alain> possibility to launch the pdfviewer evince and be able to
Alain> work in emacs without closing the pdfviewer?
here 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") (list "\\.html$" "firefox") (list
"\\.htm$" "firefox")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
H have posted this before, so you could have found it on the web. ;-)
Greetings
Josef