[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ediff-files from command line ?
From: |
Who indeed? |
Subject: |
Re: ediff-files from command line ? |
Date: |
Mon, 27 Jan 2003 22:10:18 GMT |
User-agent: |
Xnews/5.04.25 |
Bogdan,
Here is a shell script I use for ediff and emerge:
#!/bin/sh
SCRIPTNAME=`basename $0`
if [ $# -lt 2 ]
then
echo "usage: $SCRIPTNAME FILE1 FILE2"
exit 1
fi
#
if [ ! -f "$1" ]
then
echo file $1 does not exist
exit 1
fi
#
if [ ! -f "$2" ]
then
echo file $2 does not exist
exit 1
fi
if [ "$SCRIPTNAME" = "ediff" ]
then
emacs --eval "(ediff-files \"$1\" \"$2\")"
elif [ "$SCRIPTNAME" = "emerge" ]
then
emacs --eval "(mlw-emerge-files-command)" $1 $2
else
echo Unknown script name: $SCRIPTNAME
exit 1
fi
exit 0
Also, here is a relevant portion of my .emacs file:
(require 'emerge)
(defun mlw-emerge-files-command ()
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left)))
(setq command-line-args-left (nthcdr 2 command-line-args-left))
(emerge-files-internal
file-a file-b nil nil nil)))
I hope this helps.
Mike W.
Bogdan Hlevca <bhlevca@adexa.com> wrote in news:zqgZ9.248016$C8.834913
@nnrp1.uunet.ca:
> Hi,
>
> I'd like to automate an ediff process for a post run test analysis.
> Apparently with -f command line argument you can pass only functions
> without arguments.
>
> ediff-files requires arguments and it will fail when trying to do:
> $ emacs -f ediff-files "file1" "file2"
>
> I could do: $ emacs "file1" "file2" and then issue the command M-x
> ediff-buffers and followed by 2 other key strokes, but this is not
much
> of an automation.
>
> Any help/ideea would be appreciated.
> Thanks,
> Bogdan
>
>