Anonymous avatar Anonymous committed c7528f8

Import from CVS: tag r20-0b34

Comments (0)

Files changed (126)

 							-*- indented-text -*-
+to 20.0 beta34
+-- backup-dir 2.0 courtesy of Greg Klanderman
+-- lazy-lock-1.15
+-- tm-7.100.3
+-- Various patches courtesy of Joel Peterson
+-- viper-2.91
+-- ediff-2.63
+-- psgml-1.01
+-- Miscellaneous bug fixes
+
 to 20.0 beta33
 -- 20k of new zippy quotes from mly
 -- By popular demand, `font-menu-this-frame-only-p' now defaults to nil.
+Sat Jan  4 14:52:57 1997  Steven L Baur  <steve@altair.xemacs.org>
+	* XEmacs 20.0 beta 34 is released.
+	* XEmacs 19.15 beta 7 is released.
+
+Fri Jan  3 15:18:59 1997  Jeff Miller  <jmiller@bay1.bayserve.net>
+
+	* lwlib/Makefile.in.in: lwlib is required if X11 is used.
+
+Sun Dec 29 17:02:49 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in (install-arch-indep): Force compression with `gzip -f'.
+
+	* lib-src/update-elc.sh (NUMTOCOMPILE): Ignore CVS directories.
+
+	* Makefile.in (install-arch-indep): Catch .info-[0-9]* files for
+	installation.
+
+Sat Dec 28 15:33:27 1996 Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.0 beta 33 is released.
+	* XEmacs 19.15 beta 6 is released.
+
 Fri Dec 27 20:34:58 1996  Richard Mlynarik  <mly@adoc.xerox.com>
 
 	* etc/yow.lines: 20k of new zippy quotes.
 	   if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \
 	     ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \
 	   fi ; \
-	   for f in *.info ; do \
+	   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 \

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
 	      ;; 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 

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.
-.TH XEMACS 1 "1996 November 23"
+.TH XEMACS 1 "1997 January 1"
 .UC 4
 .SH NAME
 xemacs \- Emacs: The Next Generation
 /usr/local/lib/xemacs-$VERSION/$CONFIGURATION - various programs that are used
 with XEmacs.
 
-/usr/local/lib/xemacs-$VERSION/$CONFIGURATION/DOC-$VERSION-XEmacs -
+/usr/local/lib/xemacs-$VERSION/$CONFIGURATION/DOC -
 contains the documentation strings for the Lisp primitives and
 preloaded Lisp functions of \fIXEmacs\fP.
 They are stored here to reduce the size of \fIXEmacs\fP proper.
 * 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-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
 * 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-ja::	Tools for Mime for MH-E (Japanese version)
+* gnus-mime-ja::Tools for Mime for Gnus (Japanese version)
 * Locals:

lib-src/ChangeLog

+Sun Dec 29 17:16:45 1996  Martin Buchholz  <mrb@eng.sun.com>
+
+	* update-elc.sh (make_special_commands): Make ilisp be a little
+	smarter about recompilation.
+
 Wed Dec 18 20:22:55 1996  Martin Buchholz  <mrb@eng.sun.com>
 
 	* mmencode.c: Don't declare index().

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

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;

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 */
 

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 */
 

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 \
-  "ChangeLog|CVS|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

lib-src/update-elc.sh

 
 EMACS=${XEMACS:-./src/xemacs}; export EMACS
 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"
 
 # $els  is a list of all .el  files
 # $elcs is a list of all .elc files
 # with the latest version (assuming we're compiling the lisp dir of the emacs
 # we're running, which might not be the case, but often is.)
 echo "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
 
 # Prepare for byte-compiling directories with directory-specific instructions
 make_special_commands=''
 make_special w3
 make_special url		# really part of w3
 make_special hyperbole elc
-make_special oobr HYPB_ELC= elc
+make_special oobr HYPB_ELC='' elc
 make_special eos -k		# not stricly necessary...
-make_special ilisp compile -f Makefile
+make_special ilisp elc -f Makefile
 
 ignore_pattern=''
 for dir in $ignore_dirs ; do
 
 echo "Compiling files without .elc..."
 NUMTOCOMPILE=20			# compile this many files with each invocation
-comm -23 $els $elcs | sed "$ignore_pattern" | \
- xargs -t -n$NUMTOCOMPILE $REAL -batch -q -no-site-file -f batch-byte-compile
+comm -23 $els $elcs | \
+ sed "$ignore_pattern" | \
+ xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
 echo "Compiling files without .elc... Done"
 
 
 echo "Compiling files with out-of-date .elc..."
-find lisp/. -name SCCS -prune -o -type d -print | sed "$ignore_pattern" | \
+find lisp/. -name CVS -prune -o -name SCCS -prune -o -type d -print | \
+ sed "$ignore_pattern" | \
  xargs -t $REAL -batch -q -no-site-file -f batch-byte-recompile-directory
 echo "Compiling files with out-of-date .elc... Done"
 
+Sat Jan  4 12:25:34 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/faces.el (init-other-random-faces): Guard against adding
+	modeline buffer tty face if no tty support.
+
+Fri Jan  3 23:15:22 1997  Greg Klanderman  <greg@alphatech.com>
+
+	* packages/backup-dir.el: Added to distribution.
+
+Fri Jan  3 16:20:42 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* gnus/gnus-setup.el: Updated to gracefully handle installed
+ 	auxilliary packages like tm, and handle eventual integration of
+ 	Red Gnus/Gnus 5.4.
+
+Fri Jan  3 14:32:07 1997  Vinnie Shelton  <shelton@icd.teradyne.com>
+
+	* packages/gnuserv.el (gnuserv-frame): Autoload.
+
+	* x11/x-menubar.el (default-menubar): Add option to control gnuserv
+	creating a new frame.
+	(options-menu-saved-forms): Ditto.
+
+Fri Jan  3 12:18:41 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* x11/x-mouse.el: Protect creation of scrollbar-pointer-glyph with
+	feature test on 'scrollbar.
+
+Fri Jan  3 10:37:48 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* packages/mic-paren.el (paren-activate): Update to v1.2.
+
+Fri Jan  3 10:21:58 1997  Pete Ware  <ware@cis.ohio-state.edu>
+
+	* x11/x-menubar.el (default-menubar): Add require-final-newline
+	and next-line-add-newlines as options in the options menu.
+	(options-menu-saved-forms): Ditto.
+
+Thu Jan  2 18:52:32 1997  Joel Peterson  <tarzan@aosi.com>
+
+	* prim/simple.el (blink-matching-open): Make sure point is visible
+	when blinking.
+
+Thu Jan  2 11:25:05 1997  Vinnie Shelton  <shelton@icd.teradyne.com>
+
+	* prim/replace.el (occur-mode-mouse-goto): Fix typo in Emacs 19.34
+	synch up.
+	(occur-mode-map): Ditto.
+
+Wed Nov 20 19:40:05 1996  Lennart Staflin  <lenst@lysator.liu.se>
+
+	* psgml-parse.el (sgml-modify-dtd): set sgml-current-tree to
+	sgml-top-tree. Needed by sgml-open-element.
+
+Mon Nov 11 01:50:40 1996  Lennart Staflin  <lenst@lysator.liu.se>
+
+	* Version 1.0 released.
+
+Sun Sep 15 14:07:24 1996  Lennart Staflin  <lenst@lysator.liu.se>
+
+	* psgml.el (sgml-mode): modify mode-line-format with subst, don't
+	replicate the whole format in the code.
+
+Thu Sep 12 20:27:38 1996  Lennart Staflin  <lenst@lysator.liu.se>
+
+	* psgml-parse.el (sgml-external-file): Try to find system
+	identifiers using the sgml-public-map
+	if sgml-system-identifiers-are-preferred; this way that flag will
+	have effect even if the sgml-public-map contains `%s'.
+	(sgml-final): moved to be defined before use.
+
+	* psgml-dtd.el (sgml-parse-parameter-literal): Try to handle
+	character references to character number above 255 by leaving a
+	character reference in then parsed entity text.
+
+Thu Sep  5 14:11:00 1996  Dave Love  <d.love@dl.ac.uk>
+
+	* psgml-other.el (sgml-set-face-for): Nullify
+	{after,before}-change-functions as well as (obsolete)
+ 	{after,before}-change-function.
+
+Tue Dec 31 11:34:37 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* comint/gdb.el (gdb-mode): Require 'cc-mode if not already loaded
+	prior to starting gdb.
+
+Mon Dec 30 17:59:48 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* comint/telnet.el (telnet-check-software-type-initialize): Remove
+	default in cond (which allows special treatment of password prompt
+	to work).
+
+Mon Dec 30 09:36:04 1996  Valdis Kletnieks  <Valdis.Kletnieks@vt.edu>
+
+	* packages/gnuserv.el (server-edit): Add option to allow killing
+	last visible frame.
+
+Sun Dec 29 21:36:44 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/files-nomule.el: Add trailing newline.
+
+Sun Dec 29 18:45:34 1996  James LewisMoss  <dres@dres.elam.org>
+
+	* modes/perl-mode.el: Add (provide 'perl-mode).
+
+Sun Dec 29 17:15:57 1996  Martin Buchholz  <mrb@eng.sun.com>
+
+	* ilisp/Makefile (elc): Be a little smarter about recompilation.
+
+Sun Dec 29 17:14:27 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* tm/tm-edit-tipgp.el: Don't unconditionally require tinypgpa.el.
+
 Sat Dec 28 11:15:55 1996  Steven L Baur  <steve@altair.xemacs.org>
 
 	* x11/x-menubar.el (default-menubar): Move Frame-local font menu

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)

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)

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 ""

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
 
 

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)

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

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
 
 

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-skip-diff-region-function 'ediff-show-all-diffs
 (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)
 
 

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

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)