[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: merge files with emacs
From: |
J. David Boyd |
Subject: |
Re: merge files with emacs |
Date: |
Thu, 06 Oct 2005 15:03:59 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
alexcwu88@gmail.com writes:
> Hi
>
> I'd like to start emacs in file merge with two file names
> supplied from shell command line.
>
> emacs -f emacs-function file1.txt file2.txt
>
> ediff-merge-files does not accept command line filenames,
> how to write emacs function which can take command line
> arguments?
>
> Thanks in advance
> Alex
This was on the group a few months back. I've never actually tried it, but it
should get the gist of the matter across to you...
-------------------------------------------------------------------------
; > I would like to use emacs/ediff as an external diff program with
; > tortoise CVS on the windows platform. Basically, this means I need
; > to invoke emacs from the command line with two file arguments and
; > have emacs open an ediff session on those two files.
(defun command-line-diff (switch)
(let ((file1 (pop command-line-args-left))
(file2 (pop command-line-args-left)))
(ediff file1 file2)))
(add-to-list 'command-switch-alist '("diff" . command-line-diff))
;; Usage: emacs -diff file1 file2
-------------------------------------------------------------------------