From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: david@adboyd.com (J. David Boyd) Newsgroups: gmane.emacs.help Subject: Re: merge files with emacs Date: Thu, 06 Oct 2005 15:03:59 -0400 Message-ID: References: <1128624324.925793.296410@g44g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128626244 28291 80.91.229.2 (6 Oct 2005 19:17:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2005 19:17:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 06 21:17:21 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ENbBy-0001KB-Hc for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Oct 2005 21:14:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ENbBx-0004mS-I2 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Oct 2005 15:14:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ENbBm-0004mN-GE for help-gnu-emacs@gnu.org; Thu, 06 Oct 2005 15:13:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ENbBk-0004mA-Gz for help-gnu-emacs@gnu.org; Thu, 06 Oct 2005 15:13:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ENbBk-0004m7-EG for help-gnu-emacs@gnu.org; Thu, 06 Oct 2005 15:13:56 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1ENbBk-0002gL-4t for help-gnu-emacs@gnu.org; Thu, 06 Oct 2005 15:13:56 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ENb8L-0007j6-Cl for help-gnu-emacs@gnu.org; Thu, 06 Oct 2005 21:10:26 +0200 Original-Received: from 190-174.35-65.tampabay.res.rr.com ([65.35.174.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Oct 2005 21:10:25 +0200 Original-Received: from david by 190-174.35-65.tampabay.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Oct 2005 21:10:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 190-174.35-65.tampabay.res.rr.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:94yO+0ALgIjeQ3KJk95T+OHooE8= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29996 Archived-At: 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 -------------------------------------------------------------------------