unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Stefan Reichör" <stefan.reichoer@riic.at>
Subject: Re: Ediff from command line - winXP
Date: Wed, 05 Nov 2003 10:03:20 +0100	[thread overview]
Message-ID: <w4dwuaf192f.fsf@felix.riic.uni-linz.ac.at> (raw)
In-Reply-To: bo82eh$i4c$1@sunsite.dk

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\" \"%1\"))"

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

Stefan.

  reply	other threads:[~2003-11-05  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04  2:55 Ediff from command line - winXP Søren "Pengman" Pedersen
2003-11-04  5:46 ` Eli Zaretskii
2003-11-04  7:34 ` Stefan Reichör
2003-11-04 11:28   ` Søren "Pengman" Pedersen
2003-11-05  9:03     ` Stefan Reichör [this message]
2003-11-06 16:57       ` Søren "Pengman" Pedersen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=w4dwuaf192f.fsf@felix.riic.uni-linz.ac.at \
    --to=stefan.reichoer@riic.at \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).