[Top][All Lists]

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

Re: Ediff from command line - winXP

From: Stefan Reichör
Subject: Re: Ediff from command line - winXP
Date: Wed, 05 Nov 2003 10:03:20 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (berkeley-unix)

Hallo Søren!

> that sort of works... And by that I means that it works - but not really in
> the the way I would like to do it:
> I would like to be able to use this command in a .bat-file, like:
>     compare.bat:
>         gnudoit "(ediff \"%1\" \"%2\")"
> but that wont work since the filename have to be in either d:\\files\\file1
> (double backslash) or d:/files/file1 (unix way - with single slashes)...
> My questions is now:
> 1: Can I make the emacs system look in the current directory for the files??
> 2: Is there a way to make batch-files expand %1 into either of these paths
> (Might be the wrong NG for this question)

You coud use the emacs function expand-file-name:
  expand-file-name is a built-in function.
  (expand-file-name NAME &optional DEFAULT-DIRECTORY)
  Convert filename NAME to absolute, and canonicalize it.
  Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
   (does not start with slash); if DEFAULT-DIRECTORY is nil or missing,
  the current buffer's value of default-directory is used.
  File name components that are `.' are removed, and
  so are file name components followed by `..', along with the `..' itself;
  note that these simplifications are done without checking the resulting
  file names in the file system.
  An initial `~/' expands to your home directory.
  An initial `~USER/' expands to USER's home directory.
  See also the function `substitute-in-file-name'.

gnudoit "(ediff (expand-file-name \"%2\" \"%1\") (expand-file-name \"%3\" 

Then you call the batch file with the full directory path (don't know
how to get this) and the two file names.


reply via email to

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