Commits

cvs  committed bcdc7de

Import from CVS: tag r19-15b7

  • Participants
  • Parent commits 91ffe8b
  • Tags r19-15b7

Comments (0)

Files changed (104)

File CHANGES-beta

 							-*- indented-text -*-
+to 19.15 beta7
+-- backup-dir 2.0 courtesy of Greg Klanderman
+-- lazy-lock-1.15
+-- tm-7.100.3
+-- viper-2.91
+-- ediff-2.63
+-- psgml-1.01
+-- Miscellaneous bug fixes
+
 to 19.15 beta6
 -- tm-7.100.2
 -- 20k of new zippy quotes from mly
 	   for f in *.info* ; do \
 	     ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f ; \
 	     chmod 0644 ${infodir}/$$f; \
-	     gzip -9 ${infodir}/$$f; \
+	     gzip -f9 ${infodir}/$$f; \
 	   done); \
 	else true; fi
 	cd ${srcdir}/etc; for page in xemacs etags ctags gnuserv \

File dynodump/Makefile.in.in

 for more details.
 
 You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to the Free
-Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 /* Avoid trouble on systems where the "SHELL" variable might be
    inherited from the environment. */
 #endif
 
 dynodump.so: ${srcdir}/_dynodump.h $(OBJS)
-	PATH=/usr/ccs/bin:$PATH ld -o dynodump.so -G $(OBJS) -lelf -lmapmalloc
+	PATH=/usr/ccs/bin:/bin:$PATH ld -o dynodump.so -G $(OBJS) -lelf -lmapmalloc
 
 _relocate.o: ${srcdir}/$(ARCH)/_relocate.c
 	$(CC) -c $(ALL_CFLAGS) ${srcdir}/$(ARCH)/_relocate.c

File etc/sample.emacs

 	      ;; Change the pointer used when the mouse is over a modeline
 	      (set-glyph-image modeline-pointer-glyph "leftbutton")
 
+	      ;; Change the continuation glyph face so it stands out more
+	      (and (fboundp 'set-glyph-property)
+		   (boundp 'continuation-glyph)
+		   (set-glyph-property continuation-glyph 'face 'bold))
+
 	      ;; Change the pointer used during garbage collection.
 	      ;;
 	      ;; Note that this pointer image is rather large as pointers go,
 (resize-minibuffer-mode)
 (setq resize-minibuffer-window-exactly nil)
 
- 
+;; Create a single detached minibuffer used by all frames.
+;; Uncomment to try this out.
+;(when running-xemacs
+;  (setq initial-frame-plist '(minibuffer nil))
+;  (setq default-frame-plist '(minibuffer nil))
+;  (setq default-minibuffer-frame
+;	(make-frame
+;	 '(minibuffer only
+;		      width 86
+;		      height 1
+;		      menubar-visible-p nil
+;		      default-toolbar-visible-p nil
+;		      name "minibuffer"
+;		      top -2
+;		      left -2
+;		      has-modeline-p nil)))
+;  (frame-notice-user-settings))
+
 ;;; ********************
 ;;; W3 is a browser for the World Wide Web, and takes advantage of the very
 ;;; latest redisplay features in XEmacs.  You can access it simply by typing 

File etc/viperCard.tex

 \key{{\bf switch} to a buffer in the current window}{C-x {\sl buffer}}
 \metax{{\bf switch} to a buffer in another window}{:n, :b, {\rm or} C-x 4 {\sl buf}}
 \key{{\bf kill} a buffer}{:q! {\rm or} C-x k}
-\key{list exisiting {\bf buffers}}{:args {\rm or} C-x b}
+\key{list existing {\bf buffers}}{:args {\rm or} C-x b}
 
 \section{Files}
 
 There are better VI equivalents
 for all of them. Also note that all Ex commands expand \% to
 current file name. To include a \% in the command, escape it with a $\backslash$.
-Similiarly, \# is replaced by previous file. For Viper, this is the
+Similarly, \# is replaced by previous file. For Viper, this is the
 first  file in the {\sl :args} listing for that buffer. This defaults
 to the previous file in the VI sense if you have one window.
 Ex commands can be made to have history. See the manual for details.
 * VM::		View Mail, a replacement for Rmail.
 * W3::		A browser for the World Wide Web global hypertext system.
 * tm-en::	Tools for Mime (English version)
-* tm-ja::	Tools for Mime (Japanese version)
-* tm-mh-e-en::	MIME extender for mh-e (English version)
-* tm-mh-e-ja::	MIME extender for mh-e (Japanese version)
-* tm-vm_en::	MIME extender for VM.
-* gnus-mime-en::MIME extender for Gnus (English version)
-* gnus-mime-ja::MIME extender for Gnus (Japanese version)
+* tm-mh-e-en::	Tools for Mime for MH-E (English version)
+* gnus-mime-en::Tools for Mime for Gnus (English version)
+* tm-vm-en::    Tools for Mime for VM
 * Locals:

File lib-src/Makefile.in.in

 	-rm -f ${INSTALLABLES} ${UTILITIES}
 
 distclean: clean
-	-rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
+	-rm -f DOC* *.tab.c *.tab.h aixcc.c TAGS
 	-rm -f Makefile Makefile.in blessmail
 
 realclean: distclean

File lib-src/emacsclient.c

 #if !defined(HAVE_SOCKETS) && !defined(HAVE_SYSVIPC)
 #include <stdio.h>
 
-main (argc, argv)
-     int argc;
-     char **argv;
+int
+main (int argc, char *argv[])
 {
   fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n",
 	   argv[0]);
 extern char *strerror ();
 extern int errno;
 
-void
-main (argc, argv)
-     int argc;
-     char **argv;
+int
+main (int argc, char *argv[])
 {
   char system_name[256];
   int s, i;
   while ((str = fgets (string, BUFSIZ, out)))
     printf ("%s", str);
   
-  exit (0);
+  return 0;
 }
 
 #else /* This is the SYSV IPC section */
 char *getcwd (), *getenv ();
 #endif
 
-void
-main (argc, argv)
-     int argc;
-     char **argv;
+int
+main (int argc, char *argv[])
 {
   int s;
   key_t key;
 
 #ifndef HAVE_STRERROR
 char *
-strerror (errnum)
-     int errnum;
+strerror (int errnum)
 {
   extern char *sys_errlist[];
   extern int sys_nerr;

File lib-src/gnuclient.c

 
 #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && \
     !defined(INTERNET_DOMAIN_SOCKETS)
-main ()
+int
+main (int argc, char *argv[])
 {
   fprintf (stderr, "Sorry, the Emacs server is only "
 	   "supported on systems that have\n");
 
 } /* filename_expand */
 
-void
-main (int argc, char **argv)
+int
+main (int argc, char *argv[])
 {
   int starting_line = 1;			/* line to start editing at */
   char command[MAXPATHLEN+50];			/* emacs command buffer */
     disconnect_from_server (s, FALSE);
 #endif /* !SYSV_IPC */
 
-  exit (0);
+  return 0;
 
 } /* main */
 

File lib-src/gnudoit.c

 #include <unistd.h>
 
 #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS)
-main ()
+int
+main (int argc, char *argv[])
 {
   fprintf (stderr,"Sorry, the Emacs server is only supported on systems that have\n");
   fprintf (stderr,"Unix Domain sockets, Internet Domain sockets or System V IPC.\n");
 } /* main */
 #else /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */
 
-void
-main(argc,argv)
-     int argc;
-     char *argv[];
+int
+main(int argc,char *argv[])
 {
   int qflg = 0;					/* don't wait around for 
 						 * gnu emacs to eval cmd */
     disconnect_from_server(s,!qflg);
 #endif /* !SYSV_IPC */
 
-  exit(0);
+  return 0;
 
 } /* main */
 

File lib-src/update-autoloads.sh

 #!/bin/sh
-### update-autoloads.sh --- update loaddefs.el as necessary
+### update-autoloads.sh --- update auto-loaddefs.el as necessary
 
 set -eu
 
 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
 echo "          with $REAL..."
 
-$EMACS -batch -q -f batch-update-autoloads \
-  `ls lisp | egrep -v \
-  "COPYING|README|SCCS|egg|eterm|its|mule|paths.el|quail|version.el|vms" \
-  | xargs -i echo lisp/\{\}`
+dirs=
+for dir in lisp/* ; do
+  if test -d $dir \
+   -a $dir != lisp/CVS \
+   -a $dir != lisp/SCCS \
+   -a $dir != lisp/egg \
+   -a $dir != lisp/eterm \
+   -a $dir != lisp/its \
+   -a $dir != lisp/mule \
+   -a $dir != lisp/quail \
+   -a $dir != lisp/vms ; then
+    dirs="$dirs $dir"
+  fi
+done
+cat > lisp/prim/auto-autoloads.el << EOF
+;;; Do NOT edit this file!
+;;; It is automatically generated using "make autoloads"
+;;; See update-autoloads.sh and autoload.el for more details.
+
+EOF
+set -x
+$EMACS -batch -q -l autoload -f batch-update-autoloads $dirs

File lib-src/update-elc.sh

 
 
 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
-
+BYTECOMP="$REAL -batch -q -no-site-file -l bytecomp"
 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
 echo "          with $REAL..."
 
+prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o"
 
 tmp1=/tmp/rcl1.$$
 tmp2=/tmp/rcl2.$$
 
 # tmp1 is a list of all .el files
 # tmp2 is a list of all .elc files
-find lisp/. -name SCCS -prune -o -name '*.el'  -print | sort > $tmp1
-find lisp/. -name SCCS -prune -o -name 'w3.elc' -prune -o -name 'vm.elc' \
-	-prune -o -name '*.elc' -print | sed 's/elc$/el/' | sort > $tmp2
+find lisp/. $prune_vc -name '*.el'  -print | sort > $tmp1
+find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $tmp2
 
 echon "Deleting .elc files without .el files... "
 # (except for vm/vm.elc)
 # we're running, which might not be the case, but often is.)
 #
 echon "Checking the byte compiler... "
-$REAL -batch -q -no-site-file -f batch-byte-recompile-directory lisp/bytecomp
+$BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
 
 echo Compiling files without .elc...
 
 \!/its/!d
 \!/mule/!d
 \!/quail/!d
-' | xargs -t -n$NUMTOCOMPILE $REAL -batch -q -no-site-file -f batch-byte-compile
+' | xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
 
 rm -f $tmp1 $tmp2
 echo Done.
 
 # OO-Browser too
 echo Compiling OO-Browser...
-( cd lisp/oobr ; make EMACS=$REAL HYPB_ELC= elc )
+( cd lisp/oobr ; make EMACS=$REAL HYPB_ELC='' elc )
 echo OO-Browser done.
 
 # this is not strictly necessary but there are some special dependencies
 # previously this was up top, but it requires that comint.elc exists.
 
 echo Compiling Ilisp...
-( cd lisp/ilisp ; make compile -f Makefile EMACS=$REAL )
+( cd lisp/ilisp ; make elc -f Makefile EMACS=$REAL )
 echo Ilisp done.
 
 #
 # Now get the files whose .el is newer than .elc
 #
 echo Compiling files with out-of-date .elc...
-$REAL -batch -q -no-site-file -f batch-byte-recompile-directory lisp
+$BYTECOMP -f batch-byte-recompile-directory lisp

File lisp/comint/gdb.el

   (interactive)
   (comint-mode)
   (use-local-map gdb-mode-map)
+  (when (not (boundp 'c-mode-syntax-table))
+    (require 'cc-mode))
   (set-syntax-table c-mode-syntax-table)
   (make-local-variable 'gdb-last-frame-displayed-p)
   (make-local-variable 'gdb-last-frame)

File lisp/comint/telnet.el

 	  ((string-match "its" string)
 	   (setq telnet-prompt-pattern  "^[^*>\n]*[*>] *"))
 	  ((string-match "explorer" string) ;;explorer telnet needs work
-	   (setq telnet-replace-c-g ?\n))
-	  (t
-	   (setq telnet-prompt-pattern telnet-default-prompt-pattern))))
+	   (setq telnet-replace-c-g ?\n))))
   (setq comint-prompt-regexp telnet-prompt-pattern))
 
 (defun telnet-initial-filter (proc string)

File lisp/ediff/Makefile

 # variables VERSION, EMACS, DATADIR and comment out the Emacs-specific
 # versions.
 
-VERSION = 19.30
+VERSION = 19.34
 EMACS = emacs-$(VERSION)
 #VERSION = 19.14
 #EMACS = xemacs-$(VERSION)  
 INSTALL = install
 
 # --------- ONLY AUTHORIZED PERSONNEL BEYOND THIS POINT!!! ------------
-EDIFF    = ediff-init.el ediff-diff.el ediff-merg.el ediff-wind.el \
-           ediff-util.el ediff-mult.el ediff-vers.el ediff-ptch.el \
-	   ediff.el ediff-hook.el
-EDIFFelc = ediff-init.elc ediff-diff.elc ediff-merg.elc ediff-wind.elc \
-	   ediff-util.elc ediff-mult.elc ediff-vers.elc ediff-ptch.elc \
-	   ediff.elc ediff-hook.elc
+EDIFF    = ediff-init.el ediff-help.el ediff-diff.el ediff-merg.el \
+           ediff-wind.el ediff-util.el ediff-mult.el ediff-vers.el \
+           ediff-ptch.el ediff.el ediff-hook.el
+# ediff-tbar.el
+EDIFFelc = ediff-init.elc ediff-help.elc ediff-diff.elc ediff-merg.elc \
+           ediff-wind.elc ediff-util.elc ediff-mult.elc ediff-vers.elc \
+           ediff-ptch.elc ediff.elc ediff-hook.elc
+# ediff-tbar.elc
 
-PRELOADS = -l ./ediff-init.el -l ./ediff-diff.el -l ./ediff-wind.el \
-	   -l ./ediff-merg.el -l ./ediff-mult.el -l ./ediff-util.el \
-	   -l ./ediff.el 
+PRELOADS = -l ./ediff-init.el -l ./ediff-help.el -l ./ediff-diff.el \
+           -l ./ediff-wind.el -l ./ediff-merg.el -l ./ediff-mult.el \
+           -l ./ediff-util.el -l ./ediff.el
+# -l ./ediff-tbar.el
 
 all: hello elc goodbye dvi info
 
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile ediff-init.el
 
+ediff-help.elc: ediff-help.el
+	@echo ""
+	$(EMACS) -batch -f batch-byte-compile ediff-help.el
+
 ediff-hook.elc: ediff-hook.el
 	@echo ""
 	$(EMACS) -batch -f batch-byte-compile ediff-hook.el
 
+ediff-tbar.elc: ediff-tbar.el
+	@echo ""
+	$(EMACS) -batch $(PRELOADS) -f batch-byte-compile ediff-tbar.el
+
 ediff-diff.elc: ediff-init.el ediff-diff.el
 	@echo ""
 	$(EMACS) -batch $(PRELOADS) -f batch-byte-compile ediff-diff.el
 	$(INSTALL) -m444 $(EDIFF) $(LISPDIR)
 	$(INSTALL) -m644 ediff*.elc $(LISPDIR)
 	$(INSTALL) -m644 ediff.dvi $(ETCDIR)
-	$(INSTALL) -m444 ediff.info* $(INFODIR)
+	$(INSTALL) -m444 ediff ediff-? $(INFODIR)
 	@echo ""
 	@echo "Please move ediff.texi to emacs-distribution-directory/man/"
 	@echo ""
 	rm -f ediff*.elc *~ core
 
 distclean: clean
- 
+
 realclean: clean
 	rm -f *.dvi ediff.info*
 	rm -f ediff.aux ediff.cp ediff.cps ediff.fn ediff.fns ediff.ky \

File lisp/ediff/README

 README	    	-- This file
 Makefile	-- Automated installation file
 ediff.texi	-- Manual in Texinfo format
-ediff.info*	-- The Info files
+ediff, ediff-?	-- The Info files
 ediff.dvi	-- Manual in DVI format
 
 ediff.el    	-- Ediff Emacs Lisp code
 ediff-mult.el   -- Ediff Emacs Lisp code
 ediff-vers.el	-- Ediff Emacs Lisp code
 ediff-ptch.el	-- Ediff Emacs Lisp code
+ediff-tbar.el	-- Ediff Emacs Lisp code -- this one only for XEmacs
 ediff-hook.el	-- Ediff Emacs Lisp code
 
 

File lisp/ediff/ediff-diff.el

 ;; Run the diff program on FILE1 and FILE2 and put the output in DIFF-BUFFER
 ;; Return the size of DIFF-BUFFER
 (defun ediff-make-diff2-buffer (diff-buffer file1 file2)
-  (cond ((< (ediff-file-size file1) 0)
-	 (message "Can't diff remote files: %s"
-		  (ediff-abbreviate-file-name file1))
-	 (sit-for 2)
-	 ;; 1 is an error exit code
-	 1)
-	((< (ediff-file-size file2) 0)
-	 (message "Can't diff remote file: %s"
-		  (ediff-abbreviate-file-name file2))
-	 (sit-for 2)
-	 (message "")
-	 ;; 1 is an error exit code
-	 1)
-	(t (message "Computing differences between %s and %s ..."
-		    (file-name-nondirectory file1)
-		    (file-name-nondirectory file2))
-	   ;; this erases the diff buffer automatically
-	   (ediff-exec-process ediff-diff-program
-			       diff-buffer
-			       'synchronize
-			       ediff-diff-options file1 file2)
-	   ;;(message "Computing differences ... done")
+  (let ((file1-size (ediff-file-size file1))
+	(file2-size (ediff-file-size file2)))
+    (cond ((not (numberp file1-size))
+	   (message "Can't find file: %s"
+		    (ediff-abbreviate-file-name file1))
+	   (sit-for 2)
+	   ;; 1 is an error exit code
+	   1)
+	  ((not (numberp file2-size))
+	   (message "Can't find file: %s"
+		    (ediff-abbreviate-file-name file2))
+	   (sit-for 2)
+	   ;; 1 is an error exit code
+	   1)
+	  ((< file1-size 0)
+	   (message "Can't diff remote files: %s"
+		    (ediff-abbreviate-file-name file1))
+	   (sit-for 2)
+	   ;; 1 is an error exit code
+	   1)
+	  ((< file2-size 0)
+	   (message "Can't diff remote file: %s"
+		    (ediff-abbreviate-file-name file2))
+	   (sit-for 2)
 	   (message "")
-	   (ediff-eval-in-buffer diff-buffer
-	     (buffer-size)))))
+	   ;; 1 is an error exit code
+	   1)
+	  (t (message "Computing differences between %s and %s ..."
+		      (file-name-nondirectory file1)
+		      (file-name-nondirectory file2))
+	     ;; this erases the diff buffer automatically
+	     (ediff-exec-process ediff-diff-program
+				 diff-buffer
+				 'synchronize
+				 ediff-diff-options file1 file2)
+	     ;;(message "Computing differences ... done")
+	     (message "")
+	     (ediff-eval-in-buffer diff-buffer
+	       (buffer-size))))))
   
 
      
 ;;; Local Variables:
 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
 ;;; End:
 
 (provide 'ediff-diff)

File lisp/ediff/ediff-help.el

+;;; ediff-help.el --- Code related to the contents of Ediff help buffers
+
+;; Copyright (C) 1996 Free Software Foundation, Inc.
+
+;; Author: Michael Kifer <kifer@cs.sunysb.edu>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(require 'ediff-init)
+
+;; Compiler pacifier start
+(defvar ediff-multiframe)
+(and noninteractive
+     (eval-when-compile
+       (let ((load-path (cons (expand-file-name ".") load-path)))
+	 (load-file "ediff-init.el"))))
+;; end pacifier
+
+;; Help messages
+
+(defconst ediff-long-help-message-head
+  "    Move around      |      Toggle features      |        Manipulate
+=====================|===========================|============================="
+  "The head of the full help message.")
+(defconst ediff-long-help-message-tail
+  "=====================|===========================|=============================
+    R -show registry |     = -compare regions    |  M   -show session group    
+    D -diff output   |     E -browse Ediff manual|  G   -send bug report       
+    i -status info   |     ? -help off           |  z/q -suspend/quit          
+-------------------------------------------------------------------------------
+For help on a specific command:  Click Button 2 over it; or
+              			 Put the cursor over it and type RET."
+  "The tail of the full-help message.")
+
+(defconst ediff-long-help-message-compare3
+  "
+p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
+n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
+   gx -goto X's point|                           |  ! -update diff regions     
+  C-l -recenter      |    ## -ignore whitespace  |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
+    ~ -rotate buffers|     m -wide display       |
+"
+  "Help message usually used for 3-way comparison.
+Normally, not a user option. See `ediff-help-message' for details.")
+  
+(defconst ediff-long-help-message-compare2
+  "
+p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
+n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
+   gx -goto X's point|                           |  ! -update diff regions     
+  C-l -recenter      |    ## -ignore whitespace  |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
+    ~ -swap variants |     m -wide display       |  
+"
+  "Help message usually used for 2-way comparison.
+Normally, not a user option. See `ediff-help-message' for details.")
+  
+(defconst ediff-long-help-message-narrow2
+  "
+p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
+n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
+   gx -goto X's point|     % -narrow/widen buffs |  ! -update diff regions     
+  C-l -recenter      |    ## -ignore whitespace  |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
+    ~ -swap variants |     m -wide display       |  
+"
+  "Help message when comparing windows or regions line-by-line.
+Normally, not a user option. See `ediff-help-message' for details.")
+  
+(defconst ediff-long-help-message-word-mode
+  "
+p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
+n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
+    j -jump to diff  |                           |                   
+   gx -goto X's point|     % -narrow/widen buffs |  ! -recompute diffs         
+  C-l -recenter      |                           |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
+    ~ -swap variants |     m -wide display       |  
+"
+  "Help message when comparing windows or regions word-by-word.
+Normally, not a user option. See `ediff-help-message' for details.")
+  
+(defconst ediff-long-help-message-merge
+  "
+p,DEL -previous diff |     | -vert/horiz split   |  x -copy buf X's region to C
+n,SPC -next diff     |     h -hilighting         |  r -restore buf C's old diff
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions     
+  C-l -recenter      | #f/#h -focus/hide regions |  + -combine diff regions    
+  v/V -scroll up/dn  |     X -read-only in buf X | wx -save buf X              
+  </> -scroll lt/rt  |     m -wide display       | wd -save diff output        
+    ~ -swap variants |     s -shrink window C    |  / -show ancestor buff      
+                     |     $ -show clashes only  |  & -merge w/new default     
+"
+  "Help message during merging.
+Normally, not a user option. See `ediff-help-message' for details.")
+
+;; The actual long help message.
+(ediff-defvar-local ediff-long-help-message ""
+  "Normally, not a user option. See `ediff-help-message' for details.")
+  
+(defconst ediff-brief-message-string
+  "? -quick help "
+  "Contents of the brief help message.")
+;; The actual brief help message
+(ediff-defvar-local ediff-brief-help-message ""
+  "Normally, not a user option. See `ediff-help-message' for details.")
+  
+(ediff-defvar-local ediff-brief-help-message-function nil
+  "The brief help message that the user can customize.
+If the user sets this to a parameter-less function, Ediff will use it to
+produce the brief help message. This function must return a string.")
+(ediff-defvar-local ediff-long-help-message-function nil
+  "The long help message that the user can customize.
+See `ediff-brief-help-message-function' for more.")
+
+(defvar ediff-use-long-help-message nil
+  "*If t, Ediff displays a long help message. Short help message otherwise.")
+
+;; The actual help message.
+(ediff-defvar-local ediff-help-message ""
+  "The actual help message.
+Normally, the user shouldn't touch this. However, if you want Ediff to
+start up with different help messages for different jobs, you can change
+the value of this variable and the variables `ediff-help-message-*' in
+`ediff-startup-hook'.") 
+
+
+;; the keymap that defines clicks over the quick help regions
+(defvar ediff-help-region-map (make-sparse-keymap))
+
+(define-key
+  ediff-help-region-map
+  (if ediff-emacs-p [mouse-2] [button2])
+  'ediff-help-for-quick-help)
+
+;; runs in the control buffer
+(defun ediff-set-help-overlays ()
+  (goto-char (point-min))
+  (let (overl beg end cmd)
+    (while (re-search-forward " *\\([^ \t\n|]+\\||\\) +-[^|\n]+" nil 'noerror)
+      (setq beg (match-beginning 0)
+	    end (match-end 0)
+	    cmd (buffer-substring (match-beginning 1) (match-end 1)))
+      (setq overl (ediff-make-overlay beg end))
+      (if ediff-emacs-p
+	  (ediff-overlay-put overl 'mouse-face 'highlight)
+	(ediff-overlay-put overl 'highlight t))
+      (ediff-overlay-put overl 'ediff-help-info cmd))))
+
+
+(defun ediff-help-for-quick-help ()
+  "Explain Ediff commands in more detail."
+  (interactive)
+  (ediff-barf-if-not-control-buffer)
+  (let ((ctl-buf (current-buffer))
+	(pos (ediff-event-point last-command-event))
+	overl cmd)
+
+    (if ediff-xemacs-p
+	(setq overl (extent-at pos (current-buffer) 'ediff-help-info)
+	      cmd   (ediff-overlay-get overl 'ediff-help-info))
+      (setq cmd (car (mapcar (function (lambda (elt)
+					 (overlay-get elt 'ediff-help-info)))
+			     (overlays-at pos)))))
+    
+    (if (not (stringp cmd))
+	(error "Hmm... I don't see an Ediff command around here..."))
+    
+    (ediff-documentation "Quick Help Commands")
+    
+    (let (case-fold-search)
+      (cond ((string= cmd "?") (re-search-forward "^`\\?'"))
+	    ((string= cmd "G") (re-search-forward "^`G'"))
+	    ((string= cmd "E") (re-search-forward "^`E'"))
+	    ((string= cmd "wd") (re-search-forward "^`wd'"))
+	    ((string= cmd "wx") (re-search-forward "^`wa'"))
+	    ((string= cmd "a/b") (re-search-forward "^`a'"))
+	    ((string= cmd "x") (re-search-forward "^`a'"))
+	    ((string= cmd "xy") (re-search-forward "^`ab'"))
+	    ((string= cmd "p,DEL") (re-search-forward "^`p'"))
+	    ((string= cmd "n,SPC") (re-search-forward "^`n'"))
+	    ((string= cmd "j") (re-search-forward "^`j'"))
+	    ((string= cmd "gx") (re-search-forward "^`ga'"))
+	    ((string= cmd "!") (re-search-forward "^`!'"))
+	    ((string= cmd "*") (re-search-forward "^`\\*'"))
+	    ((string= cmd "m") (re-search-forward "^`m'"))
+	    ((string= cmd "|") (re-search-forward "^`|'"))
+	    ((string= cmd "@") (re-search-forward "^`@'"))
+	    ((string= cmd "h") (re-search-forward "^`h'"))
+	    ((string= cmd "r") (re-search-forward "^`r'"))
+	    ((string= cmd "rx") (re-search-forward "^`ra'"))
+	    ((string= cmd "##") (re-search-forward "^`##'"))
+	    ((string= cmd "#f/#h") (re-search-forward "^`#f'"))
+	    ((string= cmd "X") (re-search-forward "^`A'"))
+	    ((string= cmd "v/V") (re-search-forward "^`v'"))
+	    ((string= cmd "</>") (re-search-forward "^`<'"))
+	    ((string= cmd "~") (re-search-forward "^`~'"))
+	    ((string= cmd "i") (re-search-forward "^`i'"))
+	    ((string= cmd "D") (re-search-forward "^`D'"))
+	    ((string= cmd "R") (re-search-forward "^`R'"))
+	    ((string= cmd "M") (re-search-forward "^`M'"))
+	    ((string= cmd "z/q") (re-search-forward "^`z'"))
+	    ((string= cmd "%") (re-search-forward "^`%'"))
+	    ((string= cmd "C-l") (re-search-forward "^`C-l'"))
+	    ((string= cmd "$") (re-search-forward "^`\\$'"))
+	    ((string= cmd "/") (re-search-forward "^`/'"))
+	    ((string= cmd "&") (re-search-forward "^`&'"))
+	    ((string= cmd "s") (re-search-forward "^`s'"))
+	    ((string= cmd "+") (re-search-forward "^`\\+'"))
+	    ((string= cmd "=") (re-search-forward "^`='"))
+	    (t (error "Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer")))
+      ) ; let case-fold-search
+    ))
+
+
+;; assuming we are in control window, calculate length of the first line in
+;; help message
+(defun ediff-help-message-line-length ()
+  (save-excursion
+    (goto-char (point-min))
+    (if ediff-use-long-help-message
+	(next-line 1))
+    (end-of-line)
+    (current-column)))
+    
+
+(defun ediff-indent-help-message ()
+  (let* ((shift (/ (max 0 (- (window-width (selected-window))
+			     (ediff-help-message-line-length)))
+		   2))
+	 (str (make-string shift ?\ )))
+    (save-excursion
+      (goto-char (point-min))
+      (while (< (point) (point-max))
+	(insert str)
+	(beginning-of-line)
+	(forward-line 1)))))
+      
+
+;; compose the help message as a string
+(defun ediff-set-help-message ()
+  (setq ediff-long-help-message
+	(cond ((and ediff-long-help-message-function
+		    (or (symbolp ediff-long-help-message-function)
+			(consp ediff-long-help-message-function)))
+	       (funcall ediff-long-help-message-function))
+	      (ediff-word-mode 
+	       (concat ediff-long-help-message-head
+		       ediff-long-help-message-word-mode
+		       ediff-long-help-message-tail))
+	      (ediff-narrow-job
+	       (concat ediff-long-help-message-head
+		       ediff-long-help-message-narrow2
+		       ediff-long-help-message-tail))
+	      (ediff-merge-job 
+	       (concat ediff-long-help-message-head
+		       ediff-long-help-message-merge
+		       ediff-long-help-message-tail))
+	      (ediff-diff3-job
+	       (concat ediff-long-help-message-head
+		       ediff-long-help-message-compare3
+		       ediff-long-help-message-tail))
+	      (t 
+	       (concat ediff-long-help-message-head
+		       ediff-long-help-message-compare2
+		       ediff-long-help-message-tail))))
+  (setq ediff-brief-help-message 
+	(cond ((and ediff-brief-help-message-function
+		    (or (symbolp ediff-brief-help-message-function)
+			(consp ediff-brief-help-message-function)))
+	       (funcall ediff-brief-help-message-function))
+	      ((stringp ediff-brief-help-message-function)
+	       ediff-brief-help-message-function)
+	      ((ediff-multiframe-setup-p) ediff-brief-message-string)
+	      (t ; long brief msg, not multiframe --- put in the middle
+	       ediff-brief-message-string)
+	      ))
+  (setq ediff-help-message (if ediff-use-long-help-message
+			       ediff-long-help-message
+			     ediff-brief-help-message))
+  (run-hooks 'ediff-display-help-hook))
+
+(provide 'ediff-help)
+
+;;; ediff-help.el ends here

File lisp/ediff/ediff-hook.el

 (defvar epatch-menu)
 ;; end pacifier
 
+
 (defun ediff-xemacs-init-menus ()
   (if (featurep 'menubar)
       (progn
+;;	(add-menu-button
+;;	 '("Tools")
+;;	 ["Use separate frame for Ediff control buffer"
+;;	  ediff-toggle-multiframe
+;;	  :style toggle
+;;	  :selected (eq ediff-window-setup-function 'ediff-setup-windows-multiframe)]
+;;	 "00-Browser...")
+;;	(add-menu-button
+;;	 '("Tools")
+;;	 ["Use a toolbar with Ediff control buffer"
+;;	  ediff-menu-toggle-use-toolbar
+;;	  :style toggle
+;;	  :selected (ediff-use-toolbar-p)]
+;;	 "00-Browser...")
 	(add-submenu
 	 '("Tools") ediff-menu "OO-Browser...")
 	(add-submenu
        ;; define ediff-menu
        (define-key menu-bar-ediff-menu [ediff-doc]
 	 '("Ediff Manual..." . ediff-documentation))
+       (define-key menu-bar-ediff-menu [emultiframe]
+	 '("Toggle separate control buffer frame..."
+	   . ediff-toggle-multiframe))
        (define-key menu-bar-ediff-menu [eregistry]
 	'("List Ediff Sessions..." . ediff-show-registry))
        (define-key menu-bar-ediff-menu [separator-ediff-manual] '("--"))
        ;; define merge menu
        (define-key menu-bar-ediff-merge-menu [ediff-doc2]
 	 '("Ediff Manual..." . ediff-documentation))
+       (define-key menu-bar-ediff-merge-menu [emultiframe2]
+	 '("Toggle separate control buffer frame..."
+	   . ediff-toggle-multiframe))
        (define-key menu-bar-ediff-merge-menu [eregistry2]
 	'("List Ediff Sessions..." . ediff-show-registry))
        (define-key
        ;; define epatch menu
        (define-key menu-bar-epatch-menu [ediff-doc3]
 	 '("Ediff Manual..." . ediff-documentation))
+       (define-key menu-bar-epatch-menu [emultiframe3]
+	 '("Toggle separate control buffer frame..."
+	   . ediff-toggle-multiframe))
        (define-key menu-bar-epatch-menu [eregistry3]
-	'("List Ediff Sessions..." . ediff-show-registry))
+	 '("List Ediff Sessions..." . ediff-show-registry))
        (define-key menu-bar-epatch-menu [separator-epatch] '("--"))
        (define-key menu-bar-epatch-menu [ediff-patch-buffer]
 	 '("To a Buffer..." . ediff-patch-buffer))
 
   ;; misc
   (autoload 'ediff-show-registry
-    "ediff-meta"
+    "ediff-mult"
     "Display the registry of active Ediff sessions."
     t)
   (autoload 'ediff-documentation
     "ediff"
     "Show Ediff's version and last modification date."
     t)
+  (autoload 'ediff-toggle-multiframe
+    "ediff-util"
+    "Toggle the use of separate frame for Ediff control buffer."
+    t)
+;;(if (string-match "XEmacs" emacs-version)
+;;    (autoload 'ediff-toggle-use-toolbar
+;;	"ediff-tbar"
+;;	"Toggle the use of Ediff toolbar."
+;;	t))
   ) ; if purify-flag
 
 

File lisp/ediff/ediff-init.el

 	(ediff-force-faces)
 	(ediff-emacs-p (memq (ediff-device-type) '(pc)))
 	(ediff-xemacs-p (memq (ediff-device-type) '(tty pc)))))
-  
-  
+
+
 ;; Defines SYMBOL as an advertised local variable.  
 ;; Performs a defvar, then executes `make-variable-buffer-local' on
 ;; the variable.  Also sets the `permanent-local' property,
 	  ediff-merge-directory-revisions-with-ancestor
 	  ;; add more here
 	  )))
+(defsubst ediff-merge-metajob (&optional metajob)
+  (memq (or metajob ediff-metajob-name)
+	'(ediff-merge-directories
+	  ediff-merge-directories-with-ancestor
+	  ediff-merge-directory-revisions
+	  ediff-merge-directory-revisions-with-ancestor
+	  ediff-merge-filegroups-with-ancestor 
+	  ;; add more here
+	  )))
 
 (defsubst ediff-metajob3 (&optional metajob)
   (memq (or metajob ediff-metajob-name)
   (memq (or metajob ediff-metajob-name)
 	'(ediff-directories3 ediff-filegroups3)))
 
-(defsubst ediff-barf-if-not-control-buffer (&optional meta-buf)
-  (or (eq (if meta-buf ediff-meta-buffer ediff-control-buffer)
-	  (current-buffer))
+;; with no argument, checks if we are in ediff-control-buffer
+;; with argument, checks if we are in ediff-meta-buffer
+(defun ediff-in-control-buffer-p (&optional meta-buf-p)
+  (and (boundp 'ediff-control-buffer)
+       (eq (if meta-buf-p ediff-meta-buffer ediff-control-buffer)
+	   (current-buffer))))
+
+(defsubst ediff-barf-if-not-control-buffer (&optional meta-buf-p)
+  (or (ediff-in-control-buffer-p meta-buf-p)
       (error "%S: This command runs in Ediff Control Buffer only!"
 	     this-command)))
 
-
 ;; Hook variables
 
 (defvar ediff-before-setup-windows-hook nil
   "*Hooks to run on exiting Ediff but before killing the control buffer.
 This is a place to do various cleanups, such as deleting the variant buffers.
 Ediff provides a function, `ediff-janitor', as one such possible hook.")
+(defvar ediff-quit-merge-hook 'ediff-maybe-save-and-delete-merge
+  "*Hooks to run before quitting a merge job.
+The most common use is to save and delete the merge buffer.")
 
 
-;; Help messages
-
-(defconst ediff-long-help-message-head
-  "   Moving around     |     Toggling features     |       Manipulations
-=====================|===========================|============================="
-  "The head of the full help message.")
-(defconst ediff-long-help-message-tail
-  "=====================|===========================|=============================
-    R -show registry |                           |  M   -show session group
-    D -diff output   |     E -browse Ediff manual|  G   -send bug report   
-    i -status info   |     ? -help off           |  z/q -suspend/quit
--------------------------------------------------------------------------------
-X,Y (x,y)  on the left are meta-symbols for the keys  A,B,C (a,b,c).
-X,Y on the right are meta-symbols for buffers A,B,C.
-A,B,C on the right denote the working buffers A,B,C, respectively."
-  "The tail of the full-help message.")
-
-(defconst ediff-long-help-message-compare3
-  "
-p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
-n,SPC -next diff     |     h -hiliting           | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|                           |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
-                     |     m -wide display       |  ~ -rotate buffers
-"
-  "Help message usually used for 3-way comparison.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
-(defconst ediff-long-help-message-compare2
-  "
-p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
-n,SPC -next diff     |     h -hiliting           | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|                           |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
-    ~ -swap variants |     m -wide display       |  
-"
-  "Help message usually used for 2-way comparison.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
-(defconst ediff-long-help-message-narrow2
-  "
-p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
-n,SPC -next diff     |     h -hiliting           | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|     % -narrow/widen buffs |  ! -update diff regions
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
-    ~ -swap variants |     m -wide display       |  
-"
-  "Help message when comparing windows or regions line-by-line.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
-(defconst ediff-long-help-message-word-mode
-  "
-p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
-n,SPC -next diff     |     h -hiliting           | rx -restore buf X's old diff
-    j -jump to diff  |                           |                   
-   gx -goto X's point|     % -narrow/widen buffs |  ! -recompute diffs
-  C-l -recenter      |                           |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
-    ~ -swap variants |     m -wide display       |  
-"
-  "Help message when comparing windows or regions word-by-word.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
-(defconst ediff-long-help-message-merge
-  "
-p,DEL -previous diff |     | -vert/horiz split   |  x -copy buf X's region to C
-n,SPC -next diff     |     h -hiliting           |  r -restore buf C's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
-   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
-  C-l -recenter      | #f/#h -focus/hide regions |  + -combine diff regions
-  v/V -scroll up/dn  |     X -read-only in buf X | wx -save buf X
-  </> -scroll lt/rt  |     m -wide display       | wd -save diff output
-    ~ -swap variants |     s -shrink window C    |  / -show ancestor buff 
-                     |     $ -show clashes only  |  & -merge w/new default
-"
-  "Help message during merging.
-Normally, not a user option. See `ediff-help-message' for details.")
-
-;; The actual long help message.
-(ediff-defvar-local ediff-long-help-message ""
-  "Normally, not a user option. See `ediff-help-message' for details.")
-  
-(defconst ediff-brief-message-string
-  "  ? - help  "
-  "Contents of the brief help message.")
-;; The actual brief help message
-(ediff-defvar-local ediff-brief-help-message ""
-  "Normally, not a user option. See `ediff-help-message' for details.")
-  
-(ediff-defvar-local ediff-brief-help-message-function nil
-  "The brief help message that the user can customize.
-If the user sets this to a parameter-less function, Ediff will use it to
-produce the brief help message. This function must return a string.")
-(ediff-defvar-local ediff-long-help-message-function nil
-  "The long help message that the user can customize.
-See `ediff-brief-help-message-function' for more.")
-
-(defvar ediff-use-long-help-message nil
-  "*If t, Ediff displays a long help message. Short help message otherwise.")
-
-;; The actual help message.
-(ediff-defvar-local ediff-help-message ""
-  "The actual help message.
-Normally, the user shouldn't touch this. However, if you want Ediff to
-start up with different help messages for different jobs, you can change
-the value of this variable and the variables `ediff-help-message-*' in
-`ediff-startup-hook'.") 
-
 ;; Error messages
 (defconst ediff-KILLED-VITAL-BUFFER
   "You have killed a vital Ediff buffer---you must leave Ediff now!")
 (defconst ediff-BAD-DIFF-NUMBER
   ;; %S stands for this-command, %d - diff number, %d - max diff
   "%S: Bad diff region number, %d. Valid numbers are 1 to %d")
+(defconst ediff-BAD-INFO (format "
+*** The Info file for Ediff, a part of the standard distribution
+*** of %sEmacs, does not seem to be properly installed.
+*** 
+*** Please contact your system administrator. "
+				 (if ediff-xemacs-p "X" "")))
  
 ;; Selective browsing
 
 (ediff-defvar-local ediff-hide-regexp-connective 'and "")
   
   
-(defvar ediff-ange-ftp-ftp-name (if ediff-xemacs-p
-				    'ange-ftp-ftp-path
-				  'ange-ftp-ftp-name)
-  "Function ange-ftp uses to find out if file is remote.")
-  
-
 ;; Copying difference regions between buffers.    
 (ediff-defvar-local ediff-killed-diffs-alist nil
   "A list of killed diffs. 
 (ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "")
 ;; Buffer-local variables to be saved then restored during Ediff sessions
 ;; Buffer-local variables to be saved then restored during Ediff sessions
-(defconst ediff-protected-variables '(buffer-read-only 
-;;;				      synchronize-minibuffers
+(defconst ediff-protected-variables '(
+				      ;;buffer-read-only
 				      mode-line-format))
 
 ;; Vector of differences between the variants.  Each difference is
       (fset 'ediff-delete-overlay (symbol-function 'delete-extent)))
   (fset 'ediff-read-event (symbol-function 'read-event))
   (fset 'ediff-overlayp (symbol-function 'overlayp))
-  (fset 'ediff-overlayp (symbol-function 'overlayp))
   (fset 'ediff-make-overlay (symbol-function 'make-overlay))
   (fset 'ediff-delete-overlay (symbol-function 'delete-overlay)))
   
 	       (copy-face 'secondary-selection face))))
     ))
 
+(defun ediff-set-face-pixmap (face pixmap)
+  "Set face pixmap on a monochrome display."
+  (if (and (ediff-window-display-p) (not (ediff-color-display-p)))
+      (condition-case nil
+	  (set-face-background-pixmap face pixmap)
+	(error
+	 (message "Pixmap not found for %S: %s" (face-name face) pixmap)
+	 (sit-for 1)))))
+
 (defun ediff-hide-face (face)
   (if (and (ediff-has-face-support-p) ediff-emacs-p)
       (add-to-list 'facemenu-unlisted-faces face)))
 	(ediff-hide-face 'ediff-current-diff-face-Ancestor)
 	(or (face-differs-from-default-p 'ediff-current-diff-face-Ancestor)
 	    (copy-face 
-	     'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor))))
+	     'ediff-current-diff-face-C 'ediff-current-diff-face-Ancestor))
+	'ediff-current-diff-face-Ancestor))
   "Face for highlighting the selected difference in the ancestor buffer.")
 
+(defvar ediff-fine-diff-pixmap "gray3"
+  "Pixmap to use for highlighting fine differences.")
+(defvar ediff-odd-diff-pixmap "gray1"
+  "Pixmap to use for highlighting odd differences.")
+(defvar ediff-even-diff-pixmap "Stipple"
+  "Pixmap to use for highlighting even differences.")
+
 (defvar ediff-fine-diff-face-A
   (if (ediff-has-face-support-p)
       (progn
 				   "Navy")
 		   (ediff-set-face 'background 'ediff-fine-diff-face-A
 				   "sky blue"))
-		  (t (set-face-underline-p 'ediff-fine-diff-face-A t))))
+		  (t
+		   (set-face-underline-p 'ediff-fine-diff-face-A t)
+		   (ediff-set-face-pixmap 'ediff-fine-diff-face-A
+					  ediff-fine-diff-pixmap)
+		   )))
 	'ediff-fine-diff-face-A))
   "Face for highlighting the refinement of the selected diff in buffer A.")
 
 	    (cond ((ediff-color-display-p)
 		   (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black")
 		   (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan"))
-		  (t (set-face-underline-p 'ediff-fine-diff-face-B t))))
+		  (t
+		   (set-face-underline-p 'ediff-fine-diff-face-B t)
+		   (ediff-set-face-pixmap 'ediff-fine-diff-face-B
+					  ediff-fine-diff-pixmap)
+		   )))
 	'ediff-fine-diff-face-B))
   "Face for highlighting the refinement of the selected diff in buffer B.")
     
 		   (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black")
 		   (ediff-set-face
 		    'background 'ediff-fine-diff-face-C "Turquoise"))
-		  (t (set-face-underline-p 'ediff-fine-diff-face-C t))))
+		  (t
+		   (set-face-underline-p 'ediff-fine-diff-face-C t)
+		   (ediff-set-face-pixmap 'ediff-fine-diff-face-C
+					  ediff-fine-diff-pixmap)
+		   )))
 	'ediff-fine-diff-face-C))
   "Face for highlighting the refinement of the selected diff in buffer C.")
 
 	(make-face 'ediff-fine-diff-face-Ancestor)
 	(ediff-hide-face 'ediff-fine-diff-face-Ancestor)
 	(or (face-differs-from-default-p 'ediff-fine-diff-face-Ancestor)
-	    (copy-face
-	     'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor))))
+	    (progn
+	      (copy-face
+	       'ediff-fine-diff-face-C 'ediff-fine-diff-face-Ancestor)
+	      (ediff-set-face-pixmap 'ediff-fine-diff-face-Ancestor
+				     ediff-fine-diff-pixmap))
+	    )))
   "Face highlighting refinements of the selected diff in ancestor buffer.
 Presently, this is not used, as difference regions are not refined in the
 ancestor buffer.")
 		   (ediff-set-face
 		    'background 'ediff-even-diff-face-A "light grey"))
 		  (t 
-		   (copy-face 'italic 'ediff-even-diff-face-A))))
+		   (copy-face 'italic 'ediff-even-diff-face-A)
+		   (ediff-set-face-pixmap 'ediff-even-diff-face-A
+					  ediff-even-diff-pixmap)
+		   )))
 	'ediff-even-diff-face-A))
   "Face used to highlight even-numbered differences in buffer A.")
       
 		   (ediff-set-face
 		    'background 'ediff-even-diff-face-B "Gray"))
 		  (t 
-		   (copy-face 'italic 'ediff-even-diff-face-B))))
+		   (copy-face 'italic 'ediff-even-diff-face-B)
+		   (ediff-set-face-pixmap 'ediff-even-diff-face-B
+					  ediff-even-diff-pixmap)
+		   )))
 	'ediff-even-diff-face-B))
   "Face used to highlight even-numbered differences in buffer B.")
     
 	(make-face 'ediff-even-diff-face-C)
 	(ediff-hide-face 'ediff-even-diff-face-C)
 	(or (face-differs-from-default-p 'ediff-even-diff-face-C)
-	    (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C))
+	    (progn
+	      (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)
+	      (ediff-set-face-pixmap 'ediff-even-diff-face-C
+				     ediff-even-diff-pixmap)))
 	'ediff-even-diff-face-C))
   "Face used to highlight even-numbered differences in buffer C.")
 
 	(make-face 'ediff-even-diff-face-Ancestor)
 	(ediff-hide-face 'ediff-even-diff-face-Ancestor)
 	(or (face-differs-from-default-p 'ediff-even-diff-face-Ancestor)
-	    (copy-face 'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor))
+	    (progn
+	      (copy-face
+	       'ediff-even-diff-face-C 'ediff-even-diff-face-Ancestor)
+	      (ediff-set-face-pixmap 'ediff-even-diff-face-Ancestor
+				     ediff-even-diff-pixmap)))
 	'ediff-even-diff-face-Ancestor))
   "Face highlighting even-numbered differences in the ancestor buffer.")
   
 		   (ediff-set-face
 		    'background 'ediff-odd-diff-face-A "Gray"))
 		  (t 
-		   (copy-face 'italic 'ediff-odd-diff-face-A))))
+		   (copy-face 'italic 'ediff-odd-diff-face-A)
+		   (ediff-set-face-pixmap 'ediff-odd-diff-face-A
+					  ediff-odd-diff-pixmap)
+		   )))
 	'ediff-odd-diff-face-A))
   "Face used to highlight odd-numbered differences in buffer A.")
       
 		   (ediff-set-face
 		    'background 'ediff-odd-diff-face-B "light grey"))
 		  (t 
-		   (copy-face 'italic 'ediff-odd-diff-face-B))))
+		   (copy-face 'italic 'ediff-odd-diff-face-B)
+		   (ediff-set-face-pixmap 'ediff-odd-diff-face-B
+					  ediff-odd-diff-pixmap)
+		   )))
 	'ediff-odd-diff-face-B))
   "Face used to highlight odd-numbered differences in buffer B.")
     
 	(make-face 'ediff-odd-diff-face-C)
 	(ediff-hide-face 'ediff-odd-diff-face-C)
 	(or (face-differs-from-default-p 'ediff-odd-diff-face-C)
-	    (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C))
+	    (progn
+	      (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)
+	      (ediff-set-face-pixmap 'ediff-odd-diff-face-C
+				     ediff-odd-diff-pixmap)))
 	'ediff-odd-diff-face-C))
   "Face used to highlight odd-numbered differences in buffer C.")
 
 	(make-face 'ediff-odd-diff-face-Ancestor)
 	(ediff-hide-face 'ediff-odd-diff-face-Ancestor)
 	(or (face-differs-from-default-p 'ediff-odd-diff-face-Ancestor)
-	    (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor))
+	    (progn
+	      (copy-face 'ediff-odd-diff-face-C 'ediff-odd-diff-face-Ancestor)
+	      (ediff-set-face-pixmap 'ediff-odd-diff-face-Ancestor
+				     ediff-odd-diff-pixmap)))
 	'ediff-odd-diff-face-Ancestor))
   "Face used to highlight even-numbered differences in the ancestor buffer.")
 
 
 ;; if nil, this silences some messages
 (defconst ediff-verbose-p t)
+
+(ediff-defvar-local ediff-autostore-merges  'group-jobs-only
+  "*Save the results of merge jobs automatically.
+Nil means don't save automatically. t means always save. Anything but nil or t
+means save automatically only if the merge job is part of a group of jobs, such
+as `ediff-merge-directory' or `ediff-merge-directory-revisions'.")
+
+;; file where the result of the merge is to be saved. used internally
+(ediff-defvar-local ediff-merge-store-file nil "")
   
 (defvar ediff-no-emacs-help-in-control-buffer nil
   "*Non-nil means C-h should not invoke Emacs help in control buffer.
 ;;; In-line functions
 
 (defsubst ediff-file-remote-p (file-name)
-  (if (fboundp ediff-ange-ftp-ftp-name)
-      (funcall ediff-ange-ftp-ftp-name file-name)))
-
+  (require 'ange-ftp)
+  (car (if ediff-xemacs-p
+	   (ange-ftp-ftp-path file-name)
+	 (ange-ftp-ftp-name file-name))))
     
 (defsubst ediff-frame-unsplittable-p (frame)
   (cdr (assq 'unsplittable (frame-parameters frame))))
   "Kill buffer BUF if it exists."
   (if (ediff-buffer-live-p buf)
       (kill-buffer (get-buffer buf))))
-      
+
+
+;; activate faces on diff regions in buffer
+(defun ediff-paint-background-regions-in-one-buffer (buf-type unhighlight)
+  (let ((diff-vector 
+	 (eval (intern (format "ediff-difference-vector-%S" buf-type))))
+	overl diff-num)
+    (mapcar (function
+	     (lambda (rec)
+	       (setq overl (ediff-get-diff-overlay-from-diff-record rec)
+		     diff-num (ediff-overlay-get overl 'ediff-diff-num))
+	       (ediff-set-overlay-face
+		overl
+		(if (not unhighlight)
+		    (ediff-background-face buf-type diff-num))
+		)))
+	    diff-vector)))
+
+
+;; activate faces on diff regions in all buffers
+(defun ediff-paint-background-regions (&optional unhighlight)
+  (ediff-paint-background-regions-in-one-buffer
+   'A unhighlight)
+  (ediff-paint-background-regions-in-one-buffer
+   'B unhighlight)
+  (ediff-paint-background-regions-in-one-buffer
+   'C unhighlight)
+  (ediff-paint-background-regions-in-one-buffer
+   'Ancestor unhighlight))
+
+(defun ediff-highlight-diff-in-one-buffer (n buf-type)
+  (if (ediff-buffer-live-p (ediff-get-buffer buf-type))
+      (let* ((buff (ediff-get-buffer buf-type))
+	     (last (ediff-eval-in-buffer buff (point-max)))
+	     (begin (ediff-get-diff-posn buf-type 'beg n))
+	     (end (ediff-get-diff-posn buf-type 'end n))
+	     (xtra (if (equal begin end) 1 0))
+	     (end-hilit (min last (+ end xtra)))
+	     (current-diff-overlay 
+	      (symbol-value
+	       (intern (format "ediff-current-diff-overlay-%S" buf-type)))))
+	
+	(if ediff-xemacs-p
+	    (ediff-move-overlay current-diff-overlay begin end-hilit)
+	  (ediff-move-overlay current-diff-overlay begin end-hilit buff))
+	(ediff-overlay-put current-diff-overlay 'priority  
+			   (ediff-highest-priority begin end-hilit buff))
+	(ediff-overlay-put current-diff-overlay 'ediff-diff-num n)
+	
+	;; unhighlight the background overlay for diff n so it won't
+	;; interfere with the current diff overlay
+	(ediff-set-overlay-face (ediff-get-diff-overlay n buf-type) nil)
+	)))
+
+
+(defun ediff-unhighlight-diff-in-one-buffer (buf-type)
+  (if (ediff-buffer-live-p (ediff-get-buffer buf-type))
+      (let ((current-diff-overlay 
+	     (symbol-value
+	      (intern (format "ediff-current-diff-overlay-%S" buf-type))))
+	    (overlay
+	     (ediff-get-diff-overlay ediff-current-difference buf-type))
+	    )
+    
+	(ediff-move-overlay current-diff-overlay 1 1)
+
+	;; rehighlight the overlay in the background of the
+	;; current difference region
+	(ediff-set-overlay-face
+	 overlay
+	 (if (and (ediff-has-face-support-p)
+		  ediff-use-faces ediff-highlight-all-diffs)
+	     (ediff-background-face buf-type ediff-current-difference)))
+	)))
+
+(defun ediff-unhighlight-diffs-totally-in-one-buffer (buf-type)
+  (ediff-unselect-and-select-difference -1)
+  (if (and (ediff-has-face-support-p) ediff-use-faces)
+      (let* ((inhibit-quit t)
+	     (current-diff-overlay-var
+	      (intern (format "ediff-current-diff-overlay-%S" buf-type)))
+	     (current-diff-overlay (symbol-value current-diff-overlay-var)))
+	(ediff-paint-background-regions 'unhighlight)
+	(if (ediff-overlayp current-diff-overlay)
+	    (ediff-delete-overlay current-diff-overlay))
+	(set current-diff-overlay-var nil)
+	)))
 
 (defsubst ediff-highlight-diff (n)
   "Put face on diff N.  Invoked for X displays only."
       (glyph-height ediff-H-glyph (selected-window frame))
     (frame-char-height frame)))
     
+;; Some overlay functions
 
 (defsubst ediff-empty-overlay-p (overl)
   (= (ediff-overlay-start overl) (ediff-overlay-end overl)))
   (if ediff-emacs-p
       (overlay-get overl property)
     (and (extent-live-p overl) (extent-property overl property))))
+
+
+;; These two functions are here because XEmacs refuses to
+;; handle overlays whose buffers were deleted.
+(defun ediff-move-overlay (overlay beg end &optional buffer)
+  "Calls `move-overlay' in Emacs and `set-extent-endpoints' in Lemacs.
+Checks if overlay's buffer exists before actually doing the move."
+  (let ((buf (and overlay (ediff-overlay-buffer overlay))))
+    (if (ediff-buffer-live-p buf)
+	(if ediff-xemacs-p
+	    (set-extent-endpoints overlay beg end)
+	  (move-overlay overlay beg end buffer))
+      ;; buffer's dead
+      (if overlay
+	  (ediff-delete-overlay overlay)))))
+	  
+(defun ediff-overlay-put (overlay prop value)
+  "Calls `overlay-put' or `set-extent-property' depending on Emacs version.
+Checks if overlay's buffer exists."
+  (if (ediff-buffer-live-p (ediff-overlay-buffer overlay))
+      (if ediff-xemacs-p
+	  (set-extent-property overlay prop value)
+	(overlay-put overlay prop value))
+    (ediff-delete-overlay overlay)))
+
+;; Some diff region tests
   
 ;; t if diff region is empty.
 ;; In case of buffer C, t also if it is not a 3way
   (ediff-file-attributes filename 5))
 
 
+(defun ediff-convert-standard-filename (fname)
+  (if ediff-emacs-p
+      (convert-standard-filename fname)
+    ;; hopefully, XEmacs adds this functionality
+    fname))
 
+;;; Local Variables:
+;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; End:
 
-     
 (provide 'ediff-init)
 
 

File lisp/ediff/ediff-merg.el

 	)))
   
 
+;;; Local Variables:
+;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
+;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
+;;; End:
+
 (provide 'ediff-merg)
 
 ;; ediff-merg.el ends here

File lisp/ediff/ediff-mult.el

 (defvar ediff-session-group-setup-hook nil
   "*Hooks run just after a meta-buffer controlling a session group, such as
 ediff-directories, is run.")
+(defvar ediff-quit-session-group-hook nil
+  "*Hooks run just before exiting a session group.")
 (defvar ediff-show-registry-hook nil
   "*Hooks run just after the registry buffer is shown.")
 (defvar ediff-show-session-group-hook nil
   "*Hooks run just after a session group buffer is shown.")
+(defvar ediff-meta-buffer-keymap-setup-hook nil
+  "*Hooks run just after setting up the ediff-meta-buffer-map.
+This keymap controls key bindings in the meta buffer and is a local variable.
+This means that you can set different bindings for different kinds of meta
+buffers.")
 
 ;; buffer holding the multi-file patch. local to the meta buffer
 (ediff-defvar-local ediff-meta-patchbufer nil "")
 ;; group buffer/regexp
 (defun ediff-get-group-buffer (meta-list)
   (nth 0 (car meta-list)))
+
 (defun ediff-get-group-regexp (meta-list)
   (nth 1 (car meta-list)))
 ;; group objects
   (nth 3 (car meta-list)))
 (defun ediff-get-group-objC (meta-list)
   (nth 4 (car meta-list)))
+(defun ediff-get-group-merge-autostore-dir (meta-list)
+  (nth 5 (car meta-list)))
+
 ;; session buffer
 (defun ediff-get-session-buffer (elt)
   (nth 0 elt))
       (define-key ediff-meta-buffer-map [mouse-2] ediff-meta-action-function)
     (define-key ediff-meta-buffer-map [button2] ediff-meta-action-function))
 
-  (use-local-map ediff-meta-buffer-map))
+  (use-local-map ediff-meta-buffer-map)
+  ;; modify ediff-meta-buffer-map here
+  (run-hooks 'ediff-meta-buffer-keymap-setup-hook))
 
 (defun ediff-meta-mode ()
   "This mode controls all operations on Ediff session groups.
 	  (backward-char 1)))
     ))
 
+(defsubst ediff-add-slash-if-directory (dir file)
+  (if (file-directory-p (concat dir file))
+      (file-name-as-directory file)
+    file))
 
 
-;; DIR1, DIR2, DIR3 are directories.
-;; REGEXP is a regexp used to filter
-;; files in the directories.
+;; DIR1, DIR2, DIR3 are directories. DIR3 can be nil.
+;; OUTPUT-DIR is a directory for auto-storing the results of merge jobs.
+;;	      Can be nil.
+;; REGEXP is a regexp used to filter out files in the directories.
 ;; If a file is a directory in dir1 but not dir2 (or vice versa), it is not
 ;; included in the intersection. However, a regular file that is a dir in dir3
 ;; is included, since dir3 files are supposed to be ancestors for merging.
 ;;	((dir1 dir2 dir3) (f1 f2 f3) (f1 f2 f3) ...)
 ;; dir3, f3 can be nil if intersecting only 2 directories.
 ;; If COMPARISON-FUNC is given, use it. Otherwise, use string=
-;; DIFF-VAR is contains the name of the variable in which to return the
-;; difference list. The diff list is of the form:
+;; DIFF-VAR contains the name of the variable in which to return the
+;; difference list (which represents the differences among the contents of
+;; directories). The diff list is of the form:
 ;;	((dir1 dir2 dir3) (file . num) (file . num)...)
 ;; where num encodes the set of dirs where the file is found:
 ;; 2 - only dir1; 3 - only dir2; 5 - only dir3; 6 - dir1&2; 10 - dir1&3; etc.
 (defun ediff-intersect-directories (jobname
 				    diff-var regexp dir1 dir2
-				    &optional dir3 comparison-func)
+				    &optional
+				    dir3 merge-autostore-dir comparison-func)
   (setq comparison-func (or comparison-func 'string=))
   (let (lis1 lis2 lis3 common auxdir1 auxdir2 auxdir3 difflist)
 
     (setq auxdir1	(file-name-as-directory dir1)
 	  lis1		(directory-files auxdir1 nil regexp)
+	  lis1 		(delete "."  lis1)
+	  lis1 		(delete ".." lis1)
+	  lis1 		(mapcar 
+			 (function 
+			  (lambda (elt)
+				  (ediff-add-slash-if-directory auxdir1 elt)))
+			 lis1)
 	  auxdir2	(file-name-as-directory dir2)
-	  lis2		(directory-files auxdir2 nil regexp))
+	  lis2		(mapcar
+			 (function
+			  (lambda (elt)
+				  (ediff-add-slash-if-directory auxdir2 elt)))
+			 (directory-files auxdir2 nil regexp)))
 
     (if (stringp dir3)
 	(setq auxdir3	(file-name-as-directory dir3)
-	      lis3	(directory-files auxdir3 nil regexp)))
+	      lis3	(mapcar
+			 (function
+			  (lambda (elt)
+				  (ediff-add-slash-if-directory auxdir3 elt)))
+			 (directory-files auxdir3 nil regexp))))
 
-    (setq lis1 (delete "."  lis1)
-	  lis1 (delete ".." lis1))
+    (if (stringp merge-autostore-dir)
+	(setq merge-autostore-dir
+	      (file-name-as-directory merge-autostore-dir)))
+    (setq common (ediff-intersection lis1 lis2 comparison-func))
 
-    (setq common (ediff-intersection lis1 lis2 comparison-func))
-    ;; get rid of files that are directories in dir1 but not dir2
-    (mapcar (function (lambda (elt)
-			(if (Xor (file-directory-p (concat auxdir1 elt))
-				 (file-directory-p (concat auxdir2 elt)))
-			    (setq common (delq elt common)))))
-	    common)
-    ;; intersect with the third dir
-    (if lis3 (setq common (ediff-intersection common lis3 comparison-func)))
-    (if (ediff-comparison-metajob3 jobname)
-	(mapcar (function (lambda (elt)
-			    (if (Xor (file-directory-p (concat auxdir1 elt))
-				     (file-directory-p (concat auxdir3 elt)))
-				(setq common (delq elt common)))))
-		common))
+    ;; In merge with ancestor jobs, we don't intersect with lis3.
+    ;; If there is no ancestor, we'll offer to merge without the ancestor.
+    ;; So, we intersect with lis3 only when we are doing 3-way file comparison
+    (if (and lis3 (ediff-comparison-metajob3 jobname))
+	(setq common (ediff-intersection common lis3 comparison-func)))
 
     ;; copying is needed because sort sorts via side effects
     (setq common (sort (ediff-copy-list common) 'string-lessp))
 	    difflist)
     (setq difflist (cons (list regexp auxdir1 auxdir2 auxdir3) difflist))
     
+    ;; return the difference list back to the calling function
     (set diff-var difflist)
 
     ;; return result
-    (cons (list regexp auxdir1 auxdir2 auxdir3)
-	  (mapcar (function (lambda (elt) 
-			      (list (concat auxdir1 elt)
-				    (concat auxdir2 elt)
-				    (if lis3
-					(concat auxdir3 elt)))))
-		  common))
+    (cons (list regexp auxdir1 auxdir2 auxdir3 merge-autostore-dir)
+	  (mapcar
+	   (function
+	    (lambda (elt) 
+	      (list (concat auxdir1 elt)
+		    (concat auxdir2 elt)
+		    (if lis3
+			(progn
+			  ;; The following is done because:
+			  ;;   In merging with ancestor, we don't intersect
+			  ;;   with lis3. So, it is possible that elt is a
+			  ;;   file in auxdir1/2 but a directory in auxdir3
+			  ;;   Or elt may not exist in auxdir3 at all.
+			  ;;   In the first case, we add a slash at the end.
+			  ;;   In the second case, we insert nil.
+			  (setq elt (ediff-add-slash-if-directory auxdir3 elt))
+			  (if (file-exists-p (concat auxdir3 elt))
+			      (concat auxdir3 elt)))))))
+	   common))
     ))
 
 ;; find directory files that are under revision.
-;; display subdirectories, too, since we may visit them recursively.
-(defun ediff-get-directory-files-under-revision (jobname regexp dir1)
+;; Include subdirectories, since we may visit them recursively.
+;; DIR1 is the directory to inspect.
+;; OUTPUT-DIR is the directory where to auto-store the results of merges. Can
+;; be nil.
+(defun ediff-get-directory-files-under-revision (jobname
+						 regexp dir1
+						 &optional merge-autostore-dir)
   (let (lis1 elt common auxdir1)
     (setq auxdir1 (file-name-as-directory dir1)
 	  lis1	  (directory-files auxdir1 nil regexp))
 
+    (if (stringp merge-autostore-dir)
+	(setq merge-autostore-dir
+	      (file-name-as-directory merge-autostore-dir)))
+
     (while lis1
       (setq elt  (car lis1)
 	    lis1 (cdr lis1))
       ) ; while
 
     (setq common (delete "."  common)
-	  common (delete ".." common))
+	  common (delete ".." common)
+	  common (delete "RCS" common))
 
     ;; copying is needed because sort sorts via side effects
     (setq common (sort (ediff-copy-list common) 'string-lessp))
 
     ;; return result
-    (cons (list regexp auxdir1 nil nil)
+    (cons (list regexp auxdir1 nil nil merge-autostore-dir)
 	  (mapcar (function (lambda (elt) 
 			      (list (concat auxdir1 elt)
 				    nil nil)))
 	    ;; meta-buffs.
 	    (define-key
 	      ediff-meta-buffer-map "M" 'ediff-show-meta-buff-from-registry))
-	;; initialize the meta list -- don't do this for registry we prepend
-	;; '(nil nil) to all elts of meta-list, except the first.  The
-	;; first nil will later be replaced by the session buffer. The second
-	;; is reserved for session status.
+	;; Initialize the meta list -- don't do this for registry.
+	;;
+	;; We prepend '(nil nil) to all elts of meta-list, except the first.
+	;; The first nil will later be replaced by the session buffer. The
+	;; second is reserved for session status.
+	;;
 	;; (car ediff-meta-list) gets cons'ed with the session group buffer.
-	;; Also, session objA/B/C are turned into lists (obj eq-indicator)
+	;; Also, session objects A/B/C are turned into lists of the form
+	;; (obj eq-indicator). Eq-indicator is either nil or =. Initialized to
+	;; nil. If later it is discovered that this file is = to some other
+	;; file in the same session, eq-indicator is changed to `='.
 	;; For now, the eq-indicator is used only for 2 and 3-file jobs.
 	(setq ediff-meta-list
 	      (cons (cons meta-buffer (car meta-list))
-		    (mapcar (function
-			     (lambda (elt)
-			       (cons nil
-				     (cons nil
-					   ;; convert each obj to (obj nil),
-					   ;; where nil may later be replaced
-					   ;; by =, if this file equals some
-					   ;; other file in the same session
-					       (mapcar (function
-							(lambda (obj)
-							  (list obj nil)))
-						       elt)))))
-			    (cdr meta-list)))))
+		    (mapcar
+		     (function
+		      (lambda (elt)
+			(cons nil
+			      (cons nil
+				    ;; convert each obj to (obj nil),
+				    ;; where nil is the initial value
+				    ;; for eq-indicator -- see above
+				    (mapcar
+				     (function (lambda (obj) (list obj nil)))
+				     elt)))))
+		     (cdr meta-list)))))
 	
       (or (eq meta-buffer ediff-registry-buffer)
 	  (setq ediff-session-registry
       (set-buffer-modified-p nil)
 
       (run-hooks 'startup-hooks)
-      ;; arrange for showing directory contents differences
-      ;; must be after run startup-hooks, since ediff-dir-difference-list is
+
+      ;; Arrange to show directory contents differences
+      ;; Must be after run startup-hooks, since ediff-dir-difference-list is
       ;; set inside these hooks
       (if (eq action-func 'ediff-filegroup-action)
 	  (progn
 	(empty t)
 	(sessionNum 0)
 	regexp elt session-buf f1 f2 f3 pt 
+	merge-autostore-dir
 	point tmp-list buffer-read-only)
     (ediff-eval-in-buffer meta-buf
       (setq point (point))
       (insert (format ediff-meta-buffer-message
 		      (ediff-abbrev-jobname ediff-metajob-name)))
 
-      (setq regexp (ediff-get-group-regexp meta-list))
+      (setq regexp (ediff-get-group-regexp meta-list)
+	    merge-autostore-dir (ediff-get-group-merge-autostore-dir meta-list))
       
       (cond ((ediff-collect-diffs-metajob)
 	     (insert
 
       (if (and (stringp regexp) (> (length regexp) 0))
 	  (insert (format "Filter-through regular expression: %s\n" regexp)))
-			  
+      (if (and ediff-autostore-merges (ediff-merge-metajob)
+	       (stringp merge-autostore-dir))
+	  (insert (format
+		   "\nMerges are automatically stored in directory: %s\n"
+		   merge-autostore-dir)))
       (insert "\n
         Size   Last modified           Name
     -----------------------------------------------------------------------
       ;; now organize file names like this:
       ;;     use-mark sizeA dateA  sizeB dateB  filename
       ;; make sure directories are displayed with a trailing slash.
-      ;; If one is a directory and another isn't, indicate this with a `?'
       (while meta-list
 	(setq elt (car meta-list)
 	      meta-list (cdr meta-list)
 ;; Check if this is a problematic session.
 ;; Return nil if not. Otherwise, return symbol representing the problem
 ;; At present, problematic sessions occur only in -with-ancestor comparisons
-;; when the ancestor is a directory rather than a file.
+;; when the ancestor is a directory rather than a file, or when there is no
+;; suitable ancestor file in the ancestor directory
 (defun ediff-problematic-session-p (session)
   (let ((f1 (ediff-get-session-objA-name session))
 	(f2 (ediff-get-session-objB-name session))
 	(f3 (ediff-get-session-objC-name session)))
     (cond ((and (stringp f1) (not (file-directory-p f1))
 		(stringp f2) (not (file-directory-p f2))
-		(stringp f3) (file-directory-p f3)
+		;; either invalid file name or a directory
+		(or (not (stringp f3)) (file-directory-p f3))
 		(ediff-ancestor-metajob))
 	   ;; more may be added later
 	   'ancestor-is-dir)
 	  (t nil))))
 
 (defun ediff-meta-insert-file-info (fileinfo)
-  (let ((file-size -1)
-	(fname (car fileinfo))
+  (let ((fname (car fileinfo))
 	(feq (ediff-get-file-eqstatus fileinfo))
-	(file-modtime "*file doesn't exist*"))
+	file-modtime file-size)
 
-    (if (and (stringp fname) (file-exists-p fname))
-	(setq file-size (ediff-file-size fname)
-	      file-modtime (ediff-file-modtime fname)))
+    (cond ((not (stringp fname)) (setq file-size -2)) ; file doesn't exist
+	  ((not (ediff-file-remote-p fname))
+	   (if (file-exists-p fname)
+	       ;; set real size and modtime
+	       (setq file-size (ediff-file-size fname)
+		     file-modtime (ediff-file-modtime fname))
+	     (setq file-size -2)))  ; file doesn't exist
+	  ( t (setq file-size -1))) ; remote file
     (if (stringp fname)
 	(insert
 	 (format
 	  "%s  %s   %-20s   %s\n"
 	  (if feq "=" " ") ; equality indicator