[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: double-click or return in dired to launch application
From: |
Joel Smith |
Subject: |
Re: double-click or return in dired to launch application |
Date: |
05 Mar 2004 09:41:25 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Benjamin Rutt <brutt+news@bloomington.in.us> writes:
> Joel Smith <joelvsmith@earthlink.net> writes:
>
> > is it possible to double-click on a file in dired and have it launch
> > an application, i.e. click on a .doc document and word opens with
> > the document. i'm using emacsnt, but it would be interesting to set
> > this up at home on my linux box as well. thanks.
>
> I have the following set up to do file associations and actions:
>
> (setq dired-guess-shell-alist-user
> '(("\\.jpe?g\\'" "xli")
> ("\\.gif\\'" "xli")
> ("\\.pdf\\'" "acroread")
> ("\\.pdf.gz\\'" "gv")
> ("\\.ps.gz\\'" "gv")
> ("\\.ps\\'" "gv")))
>
> which allows me to specify what happens when I apply the ! key in
> dired to a specific file. I suppose you could add something like
>
> ("\\.doc\\'" "start")
>
> to that list in windows and it should work (use "ooffice" instead of
> "start" in linux). Then, you could press ! RET on one of those files.
> I'm not sure if that's what you want.
>
> As to how to get it to work from a double-click, I'm not sure if it's
> possible or not to intercept double-clicks, anyone?
> --
> Benjamin
I put in dired-x and added dired-guess-shell-alist-user to my .emacs like
(add-hook 'dired-load-hook
(function (lambda ()
(load "dired-x")
;; Set global variables here. For example:
;; (setq dired-guess-shell-gnutar "gtar")
(setq dired-guess-shell-alist-user
'(("\\.jpe?g\\'" "xli")
("\\.pdf\\'" "Acrobat")
("\\.pdf.gz\\'" "gsview32")
("\\.ps.gz\\'" "gsview32")
("\\.doc\\'" "start")
("\\.ps\\'" "gsview32")))
)))
I type ! RET and a word document appeared on the screen. wow! but the only
problem is that when the word document is open, emacs freezes until the
process is closed. How do I run these things in the background?
I'm not sure how to use the double-click response, i.e. how to use
dired-do-shell-command with the list provided by dired-guess-shell-alist-user.
i'll stick with the first method provided i can run things in the background.
Thanks for the help.