From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.help Subject: Re: emacs waiting for external program to exit Date: Thu, 13 Sep 2007 17:51:32 +0900 Organization: the Church of Emacs Message-ID: <87abrrx817.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189669987 11824 80.91.229.12 (13 Sep 2007 07:53:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2007 07:53:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 13 09:53:04 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 1IVjVT-0000RY-Uw for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Sep 2007 09:53:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVjVR-0007SL-Il for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Sep 2007 03:52:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVjUx-0007Ds-Ee for help-gnu-emacs@gnu.org; Thu, 13 Sep 2007 03:52:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVjUv-0007CQ-VN for help-gnu-emacs@gnu.org; Thu, 13 Sep 2007 03:52:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVjUv-0007C9-LA for help-gnu-emacs@gnu.org; Thu, 13 Sep 2007 03:52:25 -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 1IVjUv-0007ms-2h for help-gnu-emacs@gnu.org; Thu, 13 Sep 2007 03:52:25 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IVjUm-00065Y-3K for help-gnu-emacs@gnu.org; Thu, 13 Sep 2007 09:52:16 +0200 Original-Received: from gw.community-engine.co.jp ([210.255.51.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 09:52:16 +0200 Original-Received: from william.xwl by gw.community-engine.co.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 09:52:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gw.community-engine.co.jp User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:ejqXauSV+FYl16j+MVfR09WGgX0= 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:47551 Archived-At: 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) `---- -- William