unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* dired: launch program withou stalling emacs
@ 2009-07-20 13:49 Alain Muls
  2009-07-20 15:39 ` suvayu ali
  2009-07-20 15:45 ` Lennart Borgman
  0 siblings, 2 replies; 8+ messages in thread
From: Alain Muls @ 2009-07-20 13:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

I am learning to use dired for file operations. I found out how to 
launch a program associated with the extension using eg

(require 'dired-x)
(setq dired-guess-shell-alist-user
       '(("\\.pdf$" "evince")))

The inconvenience of this is that I have to close the program before I 
can resume working in emacs. Is there a possibility to launch the 
pdfviewer evince and be able to work in emacs without closing the pdfviewer?

Tx/Alain




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

* Re: dired: launch program withou stalling emacs
  2009-07-20 13:49 dired: launch program withou stalling emacs Alain Muls
@ 2009-07-20 15:39 ` suvayu ali
  2009-07-20 22:05   ` suvayu ali
       [not found]   ` <mailman.2864.1248127549.2239.help-gnu-emacs@gnu.org>
  2009-07-20 15:45 ` Lennart Borgman
  1 sibling, 2 replies; 8+ messages in thread
From: suvayu ali @ 2009-07-20 15:39 UTC (permalink / raw)
  To: help-gnu-emacs

2009/7/20 Alain Muls <alain.muls@telenet.be>:
> Hi
>
> I am learning to use dired for file operations. I found out how to launch a
> program associated with the extension using eg
>
> (require 'dired-x)
> (setq dired-guess-shell-alist-user
>      '(("\\.pdf$" "evince")))
>
> The inconvenience of this is that I have to close the program before I can
> resume working in emacs. Is there a possibility to launch the pdfviewer
> evince and be able to work in emacs without closing the pdfviewer?
>

If you are on GNU/Linux you can try `! xdg-open RET'.

-- 
Suvayu

Open source is the future. It sets us free.




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

* Re: dired: launch program withou stalling emacs
  2009-07-20 13:49 dired: launch program withou stalling emacs Alain Muls
  2009-07-20 15:39 ` suvayu ali
@ 2009-07-20 15:45 ` Lennart Borgman
  1 sibling, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2009-07-20 15:45 UTC (permalink / raw)
  To: Alain Muls; +Cc: help-gnu-emacs

On Mon, Jul 20, 2009 at 3:49 PM, Alain Muls<alain.muls@telenet.be> wrote:
> Hi
>
> I am learning to use dired for file operations. I found out how to launch a
> program associated with the extension using eg
>
> (require 'dired-x)
> (setq dired-guess-shell-alist-user
>      '(("\\.pdf$" "evince")))
>
> The inconvenience of this is that I have to close the program before I can
> resume working in emacs. Is there a possibility to launch the pdfviewer
> evince and be able to work in emacs without closing the pdfviewer?

Maybe this page can help to clarify things:

  http://www.emacswiki.org/emacs/SexMode




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

* Re: dired: launch program withou stalling emacs
  2009-07-20 15:39 ` suvayu ali
@ 2009-07-20 22:05   ` suvayu ali
       [not found]   ` <mailman.2864.1248127549.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: suvayu ali @ 2009-07-20 22:05 UTC (permalink / raw)
  To: help-gnu-emacs

2009/7/20 suvayu ali <fatkasuvayu+linux@gmail.com>:
> 2009/7/20 Alain Muls <alain.muls@telenet.be>:
>>
>> I am learning to use dired for file operations. I found out how to launch a
>> program associated with the extension using eg
>>
>> (require 'dired-x)
>> (setq dired-guess-shell-alist-user
>>      '(("\\.pdf$" "evince")))
>>
>> The inconvenience of this is that I have to close the program before I can
>> resume working in emacs. Is there a possibility to launch the pdfviewer
>> evince and be able to work in emacs without closing the pdfviewer?
>>
>
> If you are on GNU/Linux you can try `! xdg-open RET'.
>

> Alain wrote:
>
> this works fine for PDF files, but it fails on .fig (xfig) or .odt (openoffice) files.

Hi Alain,

It should work for _all_ files. What xdg-open does is open the file in
the preferred application as per the settings of the user. If it fails
for you, then your default applications settings is not what it should
be.

I am not sure how to correct this from the command line (you can try
xdg-mime), but from the GUI you can right click a file and set the
defaults by going to the properties menu on almost any modern window
manager.

I believe this is getting off-topic on the emacs list beyond this
point. If your problem persists, try posting on your distro's user
list. Hope this helps.

-- 
Suvayu

Open source is the future. It sets us free.




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

* Re: dired: launch program withou stalling emacs
       [not found] <mailman.2834.1248097787.2239.help-gnu-emacs@gnu.org>
@ 2009-07-20 22:43 ` muede
  2009-07-21  6:34 ` Josef G. Bauer
  1 sibling, 0 replies; 8+ messages in thread
From: muede @ 2009-07-20 22:43 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 20, 3:49 pm, Alain Muls <alain.m...@telenet.be> wrote:
> Hi
>
> I am learning to use dired for file operations. I found out how to
> launch a program associated with the extension using eg
>
> (require 'dired-x)
> (setq dired-guess-shell-alist-user
>        '(("\\.pdf$" "evince")))
>
> The inconvenience of this is that I have to close the program before I
> can resume working in emacs. Is there a possibility to launch the
> pdfviewer evince and be able to work in emacs without closing the pdfviewer?
>
> Tx/Alain

Run it in the background.

(setq dired-guess-shell-alist-user
        '(("\\.pdf$" "evince * &")))

-ap


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

* Re: dired: launch program withou stalling emacs
       [not found] <mailman.2834.1248097787.2239.help-gnu-emacs@gnu.org>
  2009-07-20 22:43 ` muede
@ 2009-07-21  6:34 ` Josef G. Bauer
  1 sibling, 0 replies; 8+ messages in thread
From: Josef G. Bauer @ 2009-07-21  6:34 UTC (permalink / raw)
  To: help-gnu-emacs

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


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

* Re: dired: launch program withou stalling emacs
       [not found]   ` <mailman.2864.1248127549.2239.help-gnu-emacs@gnu.org>
@ 2009-09-11 13:19     ` Jonathan
  2009-09-12 23:14       ` suvayu ali
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan @ 2009-09-11 13:19 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 20, 11:05 pm, suvayu ali <fatkasuvayu+li...@gmail.com> wrote:
> 2009/7/20 suvayu ali <fatkasuvayu+li...@gmail.com>:
>
> > 2009/7/20 Alain Muls <alain.m...@telenet.be>:
>
> >> I am learning to use dired for file operations. I found out how to launch a
> >> program associated with the extension using eg
>
> >> (require 'dired-x)
> >> (setq dired-guess-shell-alist-user
> >>      '(("\\.pdf$" "evince")))
>
> >> The inconvenience of this is that I have to close the program before I can
> >> resume working in emacs. Is there a possibility to launch the pdfviewer
> >> evince and be able to work in emacs without closing the pdfviewer?
>
> > If you are on GNU/Linux you can try `! xdg-open RET'.
>
> > Alain wrote:
>
> > this works fine for PDF files, but it fails on .fig (xfig) or .odt (openoffice) files.
>
> Hi Alain,
>
> It should work for _all_ files. What xdg-open does is open the file in
> the preferred application as per the settings of the user. If it fails
> for you, then your default applications settings is not what it should
> be.
>
> I am not sure how to correct this from the command line (you can try
> xdg-mime), but from the GUI you can right click a file and set the
> defaults by going to the properties menu on almost any modern window
> manager.
>
> I believe this is getting off-topic on the emacs list beyond this
> point. If your problem persists, try posting on your distro's user
> list. Hope this helps.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.

My problem is not that the OO file does not open, it's that emacs
still remains locked until the file is closed.

Any suggestions on how to invoke xdg-open as a background process?

Jon


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

* Re: dired: launch program withou stalling emacs
  2009-09-11 13:19     ` Jonathan
@ 2009-09-12 23:14       ` suvayu ali
  0 siblings, 0 replies; 8+ messages in thread
From: suvayu ali @ 2009-09-12 23:14 UTC (permalink / raw)
  To: Jonathan; +Cc: help-gnu-emacs

2009/9/11 Jonathan <jadski@googlemail.com>:
> On Jul 20, 11:05 pm, suvayu ali <fatkasuvayu+li...@gmail.com> wrote:
>> 2009/7/20 suvayu ali <fatkasuvayu+li...@gmail.com>:
>>
>> > 2009/7/20 Alain Muls <alain.m...@telenet.be>:
>>
>> >> I am learning to use dired for file operations. I found out how to launch a
>> >> program associated with the extension using eg
>>
>> >> (require 'dired-x)
>> >> (setq dired-guess-shell-alist-user
>> >>      '(("\\.pdf$" "evince")))
>>
>> >> The inconvenience of this is that I have to close the program before I can
>> >> resume working in emacs. Is there a possibility to launch the pdfviewer
>> >> evince and be able to work in emacs without closing the pdfviewer?
>>
>> > If you are on GNU/Linux you can try `! xdg-open RET'.
>>
>> > Alain wrote:
>>
>> > this works fine for PDF files, but it fails on .fig (xfig) or .odt (openoffice) files.
>>
>> Hi Alain,
>>
>> It should work for _all_ files. What xdg-open does is open the file in
>> the preferred application as per the settings of the user. If it fails
>> for you, then your default applications settings is not what it should
>> be.
>>
>> I am not sure how to correct this from the command line (you can try
>> xdg-mime), but from the GUI you can right click a file and set the
>> defaults by going to the properties menu on almost any modern window
>> manager.
>>
>> I believe this is getting off-topic on the emacs list beyond this
>> point. If your problem persists, try posting on your distro's user
>> list. Hope this helps.
>>
>
> My problem is not that the OO file does not open, it's that emacs
> still remains locked until the file is closed.
>
> Any suggestions on how to invoke xdg-open as a background process?
>
> Jon
>

That should not be the case. Here using xdg-open does not lock up
emacs. I think a previous post in this thread mentioned how to open an
application in the background. You could give that a try.

GL
-- 
Suvayu

Open source is the future. It sets us free.




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

end of thread, other threads:[~2009-09-12 23:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 13:49 dired: launch program withou stalling emacs Alain Muls
2009-07-20 15:39 ` suvayu ali
2009-07-20 22:05   ` suvayu ali
     [not found]   ` <mailman.2864.1248127549.2239.help-gnu-emacs@gnu.org>
2009-09-11 13:19     ` Jonathan
2009-09-12 23:14       ` suvayu ali
2009-07-20 15:45 ` Lennart Borgman
     [not found] <mailman.2834.1248097787.2239.help-gnu-emacs@gnu.org>
2009-07-20 22:43 ` muede
2009-07-21  6:34 ` Josef G. Bauer

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