From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mathias Dahl" Newsgroups: gmane.emacs.devel Subject: Re: Bug: can not start a w32 GUI program from Emacs Date: Wed, 27 Dec 2006 13:00:06 +0100 Message-ID: <7dbe73ed0612270400q3a1f6a63kff7b75e8cb60b300@mail.gmail.com> References: <4591C075.3040905@gmail.com> <4592506E.8050905@gmail.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1167220829 32087 80.91.229.10 (27 Dec 2006 12:00:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Dec 2006 12:00:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 27 13:00:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GzXSM-00082i-6z for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 13:00:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzXSL-00045h-TZ for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 07:00:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GzXS8-000448-5k for emacs-devel@gnu.org; Wed, 27 Dec 2006 07:00:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GzXS4-00043m-1t for emacs-devel@gnu.org; Wed, 27 Dec 2006 07:00:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzXS3-00043j-St for emacs-devel@gnu.org; Wed, 27 Dec 2006 07:00:07 -0500 Original-Received: from [66.249.92.170] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GzXS3-00069N-E0 for emacs-devel@gnu.org; Wed, 27 Dec 2006 07:00:07 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so4321660ugf for ; Wed, 27 Dec 2006 04:00:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Yx7yRvYNoGtAW8d/Ksq6Z+2E3PLgiR09RUfmn/CEzMgVNOuYarGDToanbs0O4DtqKSAksVObYH51tCCkaqnZXF/GFyGRlIbNIsg11G+ZtkNAuSzQVPUA1iVgZX6+z8Rgbn4ZpGv6jg5OY4k6wf2PsbXour3t8+yQHzBfzlznn9s= Original-Received: by 10.78.185.15 with SMTP id i15mr3531481huf.1167220806324; Wed, 27 Dec 2006 04:00:06 -0800 (PST) Original-Received: by 10.78.12.17 with HTTP; Wed, 27 Dec 2006 04:00:06 -0800 (PST) Original-To: "Lennart Borgman (gmail)" In-Reply-To: <4592506E.8050905@gmail.com> Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64334 Archived-At: > (w32-shell-execute "open" ".") > > just gives "ShellExecute failed: No application is associated with the > specified file for this operation". If you thought the above to work, in the same way that "start ." works from cmd.exe I think you simply missed that "." is "magic" only inside cmd.exe. So it's natural that ShellExecute does not recognize it. I guess if you put the correct data in Windows registry, it might be possible to open a "." file though... > (defun w32-explorer(dir) > "Open Windows Explorer in directory DIR." > (interactive "DStart in directory: ") > (setq dir (expand-file-name dir)) > (w32-shell-execute "open" dir)) I have something similar for dired that I use a lot: (defun w32-dired-open-explorer () "Open a file in dired mode by explorer.exe as you double click it." (interactive) (let ((file-name (dired-get-file-for-visit))) (if (file-exists-p file-name) (w32-shell-execute "open" (concat "\"" (slash-to-backslash file-name) "\"") nil 1)))) (defun slash-to-backslash (text) (substitute ?\\ ?/ text)) (define-key dired-mode-map "j" 'w32-dired-open-explorer) While on the subject of w32-shell-execute I have found that it is often much easier to use than struggling with `call-process' et al, when you just want to "start" something. Of course when you want to control output and input, then it's another story.