all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* double-click or return in dired to launch application
@ 2004-03-04 15:32 Joel Smith
  2004-03-04 15:47 ` Benjamin Rutt
  2004-03-04 18:15 ` Reiner Steib
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Smith @ 2004-03-04 15:32 UTC (permalink / raw)



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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 15:32 double-click or return in dired to launch application Joel Smith
@ 2004-03-04 15:47 ` Benjamin Rutt
  2004-03-04 19:09   ` Marcus Frings
                     ` (2 more replies)
  2004-03-04 18:15 ` Reiner Steib
  1 sibling, 3 replies; 9+ messages in thread
From: Benjamin Rutt @ 2004-03-04 15:47 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 15:32 double-click or return in dired to launch application Joel Smith
  2004-03-04 15:47 ` Benjamin Rutt
@ 2004-03-04 18:15 ` Reiner Steib
  1 sibling, 0 replies; 9+ messages in thread
From: Reiner Steib @ 2004-03-04 18:15 UTC (permalink / raw)


On Thu, Mar 04 2004, Joel Smith wrote:

> 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.

,----[ (info "(gnus)Other modes") ]
| Interaction with other modes
| ============================
| 
| Dired
| -----
| 
| `gnus-dired-minor-mode' provided some useful functions for dired
| buffers.  It is enabled with
|      (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
| 
| `C-c C-m C-a'
|      Send dired's marked files as an attachment (`gnus-dired-attach').
|      You will be prompted for a message buffer.
| 
| `C-c C-m C-l'
|      Visit a file according to the appropriate mailcap entry
|      (`gnus-dired-find-file-mailcap').  With prefix, open file in a new
|      buffer.
| 
| `C-c C-m C-p'
|      Print file according to the mailcap entry (`gnus-dired-print').  If
|      there is no print command, print in a PostScript image.
`----

This feature is new in the 5.10 series of Gnus, so you probably need
to upgrade your Gnus (5.10.6 is the latest stable release).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 15:47 ` Benjamin Rutt
@ 2004-03-04 19:09   ` Marcus Frings
  2004-03-04 22:23     ` J-P Theberge
  2004-03-04 22:33   ` J-P Theberge
  2004-03-05 14:41   ` Joel Smith
  2 siblings, 1 reply; 9+ messages in thread
From: Marcus Frings @ 2004-03-04 19:09 UTC (permalink / raw)


* Benjamin Rutt <brutt+news@bloomington.in.us> wrote:

> 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")))

Is `dired-guess-shell-alist-user' new in CVS Emacs? My Emacs 21.3.1
doesn't know it.

Regards,
Marcus
-- 
"Intentions not up front and the shit that never faced reflects the sliver of
God's face and looped a flaw rotates forever unresolved. Sure to die.
I'll think about that."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 19:09   ` Marcus Frings
@ 2004-03-04 22:23     ` J-P Theberge
  2004-03-05  9:12       ` Marcus Frings
  0 siblings, 1 reply; 9+ messages in thread
From: J-P Theberge @ 2004-03-04 22:23 UTC (permalink / raw)


Marcus Frings <iam-est-hora-surgere@despammed.com> writes:

> * Benjamin Rutt <brutt+news@bloomington.in.us> wrote:
> 
> > 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")))
> 
> Is `dired-guess-shell-alist-user' new in CVS Emacs? My Emacs 21.3.1
> doesn't know it.
> 

It is defined in dired-x which is not loaded by default.

-jp

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 15:47 ` Benjamin Rutt
  2004-03-04 19:09   ` Marcus Frings
@ 2004-03-04 22:33   ` J-P Theberge
  2004-03-05 14:41   ` Joel Smith
  2 siblings, 0 replies; 9+ messages in thread
From: J-P Theberge @ 2004-03-04 22:33 UTC (permalink / raw)


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?

Something like this should work:

(define-key dired-mode-map [(double-mouse-1)] 'dired-do-shell-command)

-jp

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 22:23     ` J-P Theberge
@ 2004-03-05  9:12       ` Marcus Frings
  0 siblings, 0 replies; 9+ messages in thread
From: Marcus Frings @ 2004-03-05  9:12 UTC (permalink / raw)


* J-P Theberge <jphil@amarc.org> wrote:

> It is defined in dired-x which is not loaded by default.

Ah okay, thanks for your answer. I'll have a look at it.

Regards,
Marcus
-- 
"IMO steht der englische Begriff `BurceForce' fuer dieses Passwort-Knack-
verfahren, bzw. das dazu meist verwendete Programm. Vielleicht nehme ich
`BrufeForde-' dort raus, wenn ich dazu keinen erneuten Anhaltspunkt finde."
                      Johannes Sackmann in mpdsh über seine Sicherheits-FAQ

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-04 15:47 ` Benjamin Rutt
  2004-03-04 19:09   ` Marcus Frings
  2004-03-04 22:33   ` J-P Theberge
@ 2004-03-05 14:41   ` Joel Smith
  2004-03-05 16:38     ` Enila Nero
  2 siblings, 1 reply; 9+ messages in thread
From: Joel Smith @ 2004-03-05 14:41 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: double-click or return in dired to launch application
  2004-03-05 14:41   ` Joel Smith
@ 2004-03-05 16:38     ` Enila Nero
  0 siblings, 0 replies; 9+ messages in thread
From: Enila Nero @ 2004-03-05 16:38 UTC (permalink / raw)


Joel Smith <joelvsmith@earthlink.net> writes:

> 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.

For windows try this:

(defun w32-browser (doc)
  "Browse to a particular file/URL using default application"
  (w32-shell-execute 1 doc))

(eval-after-load "dired"
  '(progn
     (define-key dired-mode-map [f3] (lambda () 
				       (interactive)
				       (w32-browser
					(dired-replace-in-string 
					 "/" "\\" 
					 (dired-get-filename)))))
     (define-key dired-mode-map [(double-down-mouse-1)] (lambda () 
						     (interactive)
						     (w32-browser
						      (dired-replace-in-string 
						       "/" "\\" 
						       (dired-get-filename)))))
))

Best of luck.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-03-05 16:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04 15:32 double-click or return in dired to launch application Joel Smith
2004-03-04 15:47 ` Benjamin Rutt
2004-03-04 19:09   ` Marcus Frings
2004-03-04 22:23     ` J-P Theberge
2004-03-05  9:12       ` Marcus Frings
2004-03-04 22:33   ` J-P Theberge
2004-03-05 14:41   ` Joel Smith
2004-03-05 16:38     ` Enila Nero
2004-03-04 18:15 ` Reiner Steib

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.