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

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

RE: [h-e-w] sending filenames from command-line


From: rob . davenport
Subject: RE: [h-e-w] sending filenames from command-line
Date: Wed, 7 Jun 2006 14:12:39 -0400

Thanks to everyone for their replies!

Dave: "Have you tried escaping them eg C:\\sys\\emacs...  ?"

Thanks Dave - yep, that would work but not quite what I was looking for; 
and  I was 
unclear in my first message though.  I wanted to make the command such 
that I 
could type *just* dired, and have it get the current working directory 
from the CD 
environment variable.  I mistakenly added 'path' to the example command in 
my first 
post.  Sorry for being unclear. 
(I'm not sure I'd want to type all the double-backslashes either, as I use 
the file/
directory name completion in CMD quite a bit and it'd be a lot of 
editing.)
---------------------
Lennart: "Can't you just do    gnuclient -sqf path"
and
David: "I find that a straight gnuclientw invocation on the
path produces a dired listing."

Ah - thanks Lennart, David - that pretty much does what I want, thanks!
(It figures I was trying to make the problem more complicated than it 
was!)
I can make the doskey macro be:

dired=c:\sys\emacs\bin\gnuclient.exe -sqF "%CD%"

and it gets the current directory and Emacs pops to the front and dired 
opens on that
directory.  Great!  (And I already have a macro for calling gnuclient with 
-sqF $* so I can
use that if I want to specify a particular path, not the current 
directory.)
---------------------
Mathias suggested: "set filename=%filename:\=/%"

Wow - that's cool I didn't know CMD could do that.  I'd seen the enhanced 
expansion 
possible in the FOR command and batch parameters (%~sX to expand X to a 
short file name, e.g.) 
but not this. I still haven't found any official documentation for this, 
though I found it mentioned on
several sites (verbatim, so they're all getting if from somewhere):
        <http://www.robvanderwoude.com/ntset.html>
        <http://thesystemguard.com/TheGuardBook/CCS-Int/SET.htm>
        <http://www.computerhope.com/sethlp.htm>
Where'd you learn about it?  Does Microsoft document it?  (I also didn't 
realize the FOR command
can do backquotes to run commands and use their output now either!)

I tried your .cmd file and it works nicely (I'm using XP Pro).

If the backslashes were a problem in your ediff command (I assume you were 
doing some form of 
calling emacs with elisp expression to start ediff with your parameters), 
and my doskey macro, 
but it works on the command-line (see Lennart and David's answers) then 
how are parameters 
handled differently (when/where are the backslashes cooked into control 
characters - CMD during 
batch processing? command-line input/reading? when calling gnuclient? Does 
gnuclient translate 
them (or more accurate NOT translate them)?  (but does translate them when 
they're quoted or 
part of the -e expression?)  Does emacs do it when receiving the 
expression to evaluate? 
Just curious.  But I will remember your solution should I run into a 
similar situation.

Again thanks to all of you.

Regards,

Rob Davenport





reply via email to

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