From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Bug: can not start a w32 GUI program from Emacs
Date: Wed, 27 Dec 2006 13:36:19 +0100 [thread overview]
Message-ID: <459268C3.6020303@gmail.com> (raw)
In-Reply-To: <7dbe73ed0612270400q3a1f6a63kff7b75e8cb60b300@mail.gmail.com>
Mathias Dahl wrote:
>> (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...
Maybe it is more about file name expansion? For example
(expand-file-name ".")
works in Emacs. And directory-files (which depends on a basic w32 API)
returns also "." in the list of files.
> 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))))
Seems useful, but maybe it is better to use convert-standard-filename
and expand-file-name here?
> 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.
I believe that w32-shell-execute can start only programs by file
association, or am I missing something? call-process can also wait (even
for a gui app I believe).
As I pointed out in another message there is perhaps a problem with
w32proc in that it binds stdin etc for gui applications. I believe that
exe-files on w32 that are marked as gui do not have consoles. But I am
not at all sure that this is a problem. Anyway I patched away that in my
patched version now to see if any problems shows up.
next prev parent reply other threads:[~2006-12-27 12:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-27 0:38 Bug: can not start a w32 GUI program from Emacs Lennart Borgman (gmail)
2006-12-27 2:30 ` Lennart Borgman (gmail)
2006-12-27 8:24 ` Eli Zaretskii
2006-12-27 10:52 ` Lennart Borgman (gmail)
2006-12-27 12:00 ` Mathias Dahl
2006-12-27 12:19 ` Eli Zaretskii
2006-12-27 12:50 ` Lennart Borgman (gmail)
2006-12-27 14:19 ` Eli Zaretskii
2006-12-27 14:33 ` Lennart Borgman (gmail)
2006-12-27 19:21 ` Eli Zaretskii
2006-12-27 12:36 ` Lennart Borgman (gmail) [this message]
2006-12-28 9:26 ` Jason Rumney
2006-12-28 9:32 ` Lennart Borgman (gmail)
2006-12-30 1:09 ` Lennart Borgman (gmail)
2006-12-30 15:49 ` Eli Zaretskii
2006-12-30 16:04 ` Lennart Borgman (gmail)
2006-12-30 17:00 ` Eli Zaretskii
2006-12-30 17:28 ` Lennart Borgman (gmail)
2006-12-30 18:01 ` Eli Zaretskii
2006-12-30 18:22 ` Lennart Borgman (gmail)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=459268C3.6020303@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.