From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: problems with ediff-startup-hooks Date: Wed, 01 Mar 2006 11:45:27 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1141504695 12691 80.91.229.2 (4 Mar 2006 20:38:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2006 20:38:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 04 21:38:14 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFdW0-0007wq-Q2 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Mar 2006 21:38:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFdW5-0007C1-3Y for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Mar 2006 15:38:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FFbIm-0001Py-4O for help-gnu-emacs@gnu.org; Sat, 04 Mar 2006 13:16:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FFbIi-0001Iy-8C for help-gnu-emacs@gnu.org; Sat, 04 Mar 2006 13:16:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEi5a-0003OX-Fz for help-gnu-emacs@gnu.org; Thu, 02 Mar 2006 02:19:06 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FEWWW-0004xZ-7S for help-gnu-emacs@gnu.org; Wed, 01 Mar 2006 13:58:08 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FEWOT-00061W-Jg for help-gnu-emacs@gnu.org; Wed, 01 Mar 2006 19:49:49 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Mar 2006 19:49:49 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Mar 2006 19:49:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 72 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: 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:33538 Archived-At: bhenz@Lexmark.com wrote: > I running emacs 21.4.1. I'm trying to do some fancy ediff stuff. > > Actually not terribly fancy, I just want to invoke it from the command > line with parmeters similar to "diff", specifically using the -L option > to give more descriptive names to the buffers. Currently I can ediff two > files by doing the following... > > emacs --eval='(progn (setq ediff-diff-options "-wbB") (ediff-files > "file1" "file2"))' > > Maybe there's an easier/better way? Looks good to me, but here's a snippet that'll let you run emacs --diff file1 file2 Perhaps you can tweak it to accept ediff-diff-options as a command line argument as well. (defun diff-command-line-args (switch) "Run `ediff-files' on the following 2 command line arguments (after SWITCH)." ;; (prog1 ...) == (pop command-line-args-left): (let ((file-a (prog1 (car command-line-args-left) (setq command-line-args-left (cdr command-line-args-left)))) (file-b (prog1 (car command-line-args-left) (setq command-line-args-left (cdr command-line-args-left))))) (ediff-files file-a file-b))) (setq command-switch-alist (cons '("--diff" . diff-command-line-args) command-switch-alist)) > ANYWAY, > > The path I'm currently on requires me to hook into the > "ediff-startup-hooks" with the following code in my .emacs file... > > (require 'ediff) > > ;; Get rid of the annoying little (separate) ediff window and > ;; turn it into a 3rd pane in the main emacs window. > (setq ediff-window-setup-function 'ediff-setup-windows-plain) > > ;; Put files side-by-side > ;(setq ediff-split-window-function 'split-window-horizontally) > > (defun my-ediff-startup-hooks () > (set-buffer ediff-buffer-A) > (rename-buffer "bobA") > (set-buffer ediff-buffer-B) > (rename-buffer "bobB") > ) > > (add-hook 'ediff-startup-hooks 'my-ediff-startup-hooks) > > OK, so this is just baby-step code because clearly "bobA" and "bobB" are > not useful, but I can't even get THIS to work! I even tried inserting a > line I knew would fail in the defined function (something like > (undefined_bob_qwerty)) and I never got a complaint when I fired up a > new instance of ediff. > > (but I know it was picking up my changes to .emacs because if I made a > /syntax/ error then it would warn me about that.) > > What am I doing wrong? AFAIK, the name of the variable is ediff-startup-hook (no "s"). -- Kevin Rodgers