unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* merge files with emacs
@ 2005-10-06 18:45 alexcwu88
  2005-10-06 19:03 ` J. David Boyd
  2005-10-06 19:07 ` Edward O'Connor
  0 siblings, 2 replies; 3+ messages in thread
From: alexcwu88 @ 2005-10-06 18:45 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: merge files with emacs
  2005-10-06 18:45 merge files with emacs alexcwu88
@ 2005-10-06 19:03 ` J. David Boyd
  2005-10-06 19:07 ` Edward O'Connor
  1 sibling, 0 replies; 3+ messages in thread
From: J. David Boyd @ 2005-10-06 19:03 UTC (permalink / raw)


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

-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: merge files with emacs
  2005-10-06 18:45 merge files with emacs alexcwu88
  2005-10-06 19:03 ` J. David Boyd
@ 2005-10-06 19:07 ` Edward O'Connor
  1 sibling, 0 replies; 3+ messages in thread
From: Edward O'Connor @ 2005-10-06 19:07 UTC (permalink / raw)


alexcwu wrote:

> 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

Something along the lines of

emacs --eval "(ediff-merge-files \"$file1\" \"$file2\")"

should do the trick.


Ted

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-06 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-06 18:45 merge files with emacs alexcwu88
2005-10-06 19:03 ` J. David Boyd
2005-10-06 19:07 ` Edward O'Connor

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).