help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs waiting for external program to exit


From: William Xu
Subject: Re: emacs waiting for external program to exit
Date: Thu, 13 Sep 2007 17:51:32 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]