From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.help Subject: Re: emacs waiting for external program to exit Date: Sat, 06 Oct 2007 09:28:19 +0100 Message-ID: References: <87abrrx817.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191659481 14413 80.91.229.12 (6 Oct 2007 08:31:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2007 08:31:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 06 10:31:18 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ie549-0003x9-Nb for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Oct 2007 10:31:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ie544-000302-SN for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Oct 2007 04:31:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ie52W-00025q-JV for help-gnu-emacs@gnu.org; Sat, 06 Oct 2007 04:29:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ie52V-00025L-KC for help-gnu-emacs@gnu.org; Sat, 06 Oct 2007 04:29:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ie52V-00025B-Cz for help-gnu-emacs@gnu.org; Sat, 06 Oct 2007 04:29:35 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ie52U-0001Na-V7 for help-gnu-emacs@gnu.org; Sat, 06 Oct 2007 04:29:35 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ie52Q-0002rL-7z for help-gnu-emacs@gnu.org; Sat, 06 Oct 2007 08:29:30 +0000 Original-Received: from sl392.st-edmunds.cam.ac.uk ([131.111.223.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Oct 2007 08:29:30 +0000 Original-Received: from sdl.web by sl392.st-edmunds.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Oct 2007 08:29:30 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: sl392.st-edmunds.cam.ac.uk Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC User-Agent: Gnus/5.110007 Emacs/23.0.50 (20070922) Fedora 7 (gnu/linux) Cancel-Lock: sha1:VEcXXxGIzS/KFkqYgWA9oHFipGk= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48145 Archived-At: On 2007-09-13 09:51 +0100, William Xu wrote: > Leo 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/