unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs waiting for external program to exit
@ 2007-09-12  8:20 Leo
  2007-09-12  8:58 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Leo @ 2007-09-12  8:20 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

If I open a .pdf file in dired with evince, Emacs is frozen until that
program exits.

Is there anyway I can't avoid that i.e. I'd like to be able to continue
using the same Emacs session?

Thanks,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

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

* Re: emacs waiting for external program to exit
  2007-09-12  8:20 emacs waiting for external program to exit Leo
@ 2007-09-12  8:58 ` Peter Dyballa
  2007-09-12  9:33   ` Leo
       [not found]   ` <mailman.749.1189589698.18990.help-gnu-emacs@gnu.org>
       [not found] ` <mailman.746.1189587514.18990.help-gnu-emacs@gnu.org>
  2007-09-13  8:51 ` William Xu
  2 siblings, 2 replies; 9+ messages in thread
From: Peter Dyballa @ 2007-09-12  8:58 UTC (permalink / raw)
  To: Leo; +Cc: help-gnu-emacs


Am 12.09.2007 um 10:20 schrieb Leo:

> If I open a .pdf file in dired with evince, Emacs is frozen until that
> program exits.

Can't you put evince into the background? Either use a shell script  
as go-between or use a function for dired-x that was sent to the list  
recently, could be in May or June ... It was about launching an  
external programme in the background.

--
Greetings

   Pete

IMBECILITY, n.  A kind of divine inspiration, or sacred fire  
affecting censorious critics of this dictionary.
                    -- Ambrose Bierce: _The Devil's Dictionary_

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

* Re: emacs waiting for external program to exit
  2007-09-12  8:58 ` Peter Dyballa
@ 2007-09-12  9:33   ` Leo
  2007-09-12 10:15     ` Peter Dyballa
       [not found]   ` <mailman.749.1189589698.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Leo @ 2007-09-12  9:33 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-09-12 09:58 +0100, Peter Dyballa wrote:
> Am 12.09.2007 um 10:20 schrieb Leo:
>
>> If I open a .pdf file in dired with evince, Emacs is frozen until that
>> program exits.
>
> Can't you put evince into the background? Either use a shell script
> as go-between

I know this kind of solutions. It is ugly and not general.

> or use a function for dired-x that was sent to the list recently,
> could be in May or June ... It was about launching an external
> programme in the background.

I haven't seen such post. Any pointers?

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

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

* Re: emacs waiting for external program to exit
  2007-09-12  9:33   ` Leo
@ 2007-09-12 10:15     ` Peter Dyballa
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2007-09-12 10:15 UTC (permalink / raw)
  To: Leo; +Cc: help-gnu-emacs


Am 12.09.2007 um 11:33 schrieb Leo:

>> or use a function for dired-x that was sent to the list recently,
>> could be in May or June ... It was about launching an external
>> programme in the background.
>
> I haven't seen such post. Any pointers?

See again above!

--
Greetings

   Pete

Remember: use logout to logout.

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

* Re: emacs waiting for external program to exit
       [not found] ` <mailman.746.1189587514.18990.help-gnu-emacs@gnu.org>
@ 2007-09-12 21:36   ` Fabian Braennstroem
  0 siblings, 0 replies; 9+ messages in thread
From: Fabian Braennstroem @ 2007-09-12 21:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Peter Dyballa schrieb am 09/12/2007 08:58 AM:
> Am 12.09.2007 um 10:20 schrieb Leo:
> 
>> If I open a .pdf file in dired with evince, Emacs is frozen until that
>> program exits.
> 
> Can't you put evince into the background? Either use a shell script  
> as go-between or use a function for dired-x that was sent to the list  
> recently, could be in May or June ... It was about launching an  
> external programme in the background.
> 

or use 'call-process', their are some alsaplayer example on
emacswiki.

Regards!
Fabian

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

* Re: emacs waiting for external program to exit
  2007-09-12  8:20 emacs waiting for external program to exit Leo
  2007-09-12  8:58 ` Peter Dyballa
       [not found] ` <mailman.746.1189587514.18990.help-gnu-emacs@gnu.org>
@ 2007-09-13  8:51 ` William Xu
  2007-10-06  8:28   ` Leo
  2 siblings, 1 reply; 9+ messages in thread
From: William Xu @ 2007-09-13  8:51 UTC (permalink / raw)
  To: help-gnu-emacs

Leo <sdl.web@gmail.com> writes:

> If I open a .pdf file in dired with evince, Emacs is frozen until that
> program exits.
>
> Is there anyway I can't avoid that i.e. I'd like to be able to continue
> using the same Emacs session?

Just redefining `dired-run-shell-command' by replacing shell-command
works for me.

,----
| (require 'dired-aux)
| 
| (defun xwl-shell-command-asynchronously (cmd)
|   (start-process-shell-command cmd nil cmd))
| 
| ;; Run shell command at background
| (defun dired-run-shell-command (command)
|   (let ((handler
| 	 (find-file-name-handler
| 	  (directory-file-name default-directory)
| 	  'shell-command)))
|     (if handler
| 	(apply handler 'shell-command (list command))
|       ;; (shell-command command)))
|       (xwl-shell-command-asynchronously command))) ; xwl
|   ;; Return nil for sake of nconc in dired-bunch-files.
|   nil)
`----

-- 
William

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

* Re: emacs waiting for external program to exit
       [not found]   ` <mailman.749.1189589698.18990.help-gnu-emacs@gnu.org>
@ 2007-09-13 15:28     ` Thien-Thi Nguyen
  2007-09-13 16:04       ` Leo
  0 siblings, 1 reply; 9+ messages in thread
From: Thien-Thi Nguyen @ 2007-09-13 15:28 UTC (permalink / raw)
  To: gnu-emacs-help

() Leo <sdl.web@gmail.com>
() Wed, 12 Sep 2007 10:33:04 +0100

   I know this kind of solutions. It is ugly and not general.

why is it ugly?

thi

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

* Re: emacs waiting for external program to exit
  2007-09-13 15:28     ` Thien-Thi Nguyen
@ 2007-09-13 16:04       ` Leo
  0 siblings, 0 replies; 9+ messages in thread
From: Leo @ 2007-09-13 16:04 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-09-13 16:28 +0100, Thien-Thi Nguyen wrote:
> () Leo <sdl.web@gmail.com>
> () Wed, 12 Sep 2007 10:33:04 +0100
>
>    I know this kind of solutions. It is ugly and not general.
>
> why is it ugly?
>
> thi

For one thing, I don't want to write a wrapper for all external
programs.

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

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

* Re: emacs waiting for external program to exit
  2007-09-13  8:51 ` William Xu
@ 2007-10-06  8:28   ` Leo
  0 siblings, 0 replies; 9+ messages in thread
From: Leo @ 2007-10-06  8:28 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-09-13 09:51 +0100, William Xu wrote:
> Leo <sdl.web@gmail.com> writes:
>
>> If I open a .pdf file in dired with evince, Emacs is frozen until that
>> program exits.
>>
>> Is there anyway I can't avoid that i.e. I'd like to be able to continue
>> using the same Emacs session?
>
> Just redefining `dired-run-shell-command' by replacing shell-command
> works for me.
>
> ,----
> | (require 'dired-aux)
> | 
> | (defun xwl-shell-command-asynchronously (cmd)
> |   (start-process-shell-command cmd nil cmd))
> | 
> | ;; Run shell command at background
> | (defun dired-run-shell-command (command)
> |   (let ((handler
> | 	 (find-file-name-handler
> | 	  (directory-file-name default-directory)
> | 	  'shell-command)))
> |     (if handler
> | 	(apply handler 'shell-command (list command))
> |       ;; (shell-command command)))
> |       (xwl-shell-command-asynchronously command))) ; xwl
> |   ;; Return nil for sake of nconc in dired-bunch-files.
> |   nil)
> `----

Thanks! I just re-define dired-run-shell-command in my .emacs

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

       Use the most powerful email client -- http://gnus.org/

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

end of thread, other threads:[~2007-10-06  8:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12  8:20 emacs waiting for external program to exit Leo
2007-09-12  8:58 ` Peter Dyballa
2007-09-12  9:33   ` Leo
2007-09-12 10:15     ` Peter Dyballa
     [not found]   ` <mailman.749.1189589698.18990.help-gnu-emacs@gnu.org>
2007-09-13 15:28     ` Thien-Thi Nguyen
2007-09-13 16:04       ` Leo
     [not found] ` <mailman.746.1189587514.18990.help-gnu-emacs@gnu.org>
2007-09-12 21:36   ` Fabian Braennstroem
2007-09-13  8:51 ` William Xu
2007-10-06  8:28   ` Leo

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