Commits

Anonymous committed 74af51d

Synch to EFS 1.16
Remove dired

Comments (0)

Files changed (66)

+_pkg.el
+package-info
+auto-autoloads.el
-1998-02-10  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+1998-02-17  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-	* diff.el (diff-beginning-of-buffer): Use zmacs-regions.
-	(diff-end-of-buffer): Ditto.
+	* efs.el (efs-write-region): Would recurse infinitely and thereby
+ 	break file-precious-flag.
 
-1998-01-24  SL Baur  <steve@altair.xemacs.org>
+1998-02-17 Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-	* Makefile (VERSION): Update to package standard 1.0.
-	
-1998-01-14    <jsparkes@internetivity.com (Jeff Sparkes)>
+	* efs-pc.el, efs.el: Added support for Microsoft's NT server.
 
-	* dired.el (dired-readin): don't indent the listing here.
-	  (dired-insert-directory): indent listing here, before the
-	  the text properties are added.
+1998-01-05  Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>
 
-1998-01-17  SL Baur  <steve@altair.xemacs.org>
+	* efs-netrc.el: change char-equal to eq in two instances where nil
+ 	might arise.
 
-	* Makefile (REQUIRES): Make explicit the dependency on VM.
+1997-12-12  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-1998-01-05  SL Baur  <steve@altair.xemacs.org>
+	* efs-18.el, efs-19.23.el, efs-19.el, efs-l19.11.el: Overwrite
+ 	expand-file-name with version that uses file-name handlers.
 
-	* Makefile:  added diff.el.
+	* efs-pc.el: Added support for the Hummingbird ftpd
 
-1997-12-18  Karl M. Hegbloom  <karlheg@bittersweet.inetarena.com>
+	* ChangeLog: created
 
-	* efs-netrc.el (efs-netrc-next-token): replace `char-equal'
-	  with `eq' to avoid error when `char-after' returns nil at
-	  eob.
+1997-12-12  Alastair Burt <alastair.burt@dfki.de>
 
-1998-01-02  SL Baur  <steve@altair.xemacs.org>
+	* efs-dired.el: EFS now confirms overwrites.
 
-	* Makefile: Update to newer package interface.
-
-1997-12-21  SL Baur  <steve@altair.xemacs.org>
-
-	* Makefile: Created.
+There are several mailing lists relevant to efs.  If you wish to join
+a list, send e-mail to their -request address.
+
+  efs-bugs@cuckoo.hpl.hp.com
+
+This is where all bug reports should go.  M-x efs-report-bug is the
+recommended way of sending bug reports about efs, and this will send by
+default to this address.
+
+  efs-help@cuckoo.hpl.hp.com
+
+This is where general discussions about efs should go.  For beta-testing
+discussions, use efs-testers instead.
+
+  efs-testers@cuckoo.hpl.hp.com
+
+This is where discussions about beta testing efs should go.  Bugs should
+however be reported to efs-bugs. Patches for beta test bugs will be
+sent to this list.
+
+  efs-announce@cuckoo.hpl.hp.com
+
+This is where announcements such as new generally available releases of efs
+should go.
+
+Each of the lists have a -request address to join and leave the list.
-# Makefile for efs lisp code
+# Makefile for EFS lisp code
 
 # This file is part of XEmacs.
 
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.06
-AUTHOR_VERSION = 1.15
-MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+include Makefile.efs
+
+VERSION = 1.07
+AUTHOR_VERSION = 1.16
+MAINTAINER = Mike Sperber <sperber@informatik.uni-tuebingen.de>
 PACKAGE = efs
 PKG_TYPE = regular
-REQUIRES = vm xemacs-base
+REQUIRES = xemacs-base vm dired
 CATEGORY = libs
 
-ELCS = default-dir.elc diff.elc dired-cmpr.elc dired-diff.elc dired-faces.elc \
-	dired-grep.elc dired-help.elc dired-mob.elc dired-oas.elc \
-	dired-rgxp.elc dired-sex.elc dired-shell.elc dired-uu.elc \
-	dired-vir.elc dired-xemacs.elc dired-xy.elc dired.elc \
-	efs-auto.elc efs-cms-knet.elc efs-cms.elc efs-coke.elc \
-	efs-cp-p.elc efs-cu.elc efs-defun.elc efs-dired.elc \
-	efs-dl.elc efs-dos-distinct.elc efs-dump.elc efs-fnh.elc \
-	efs-guardian.elc efs-gwp.elc efs-hell.elc efs-ka9q.elc \
-	efs-kerberos.elc efs-mpe.elc efs-ms-unix.elc efs-mts.elc \
-	efs-mvs.elc efs-netrc.elc efs-netware.elc efs-nos-ve.elc \
-	efs-ovwrt.elc efs-pc.elc efs-plan9.elc efs-report.elc \
-	efs-ti-explorer.elc efs-ti-twenex.elc efs-tops-20.elc efs-vm.elc \
-	efs-vms.elc efs-vos.elc efs-x19.15.elc efs.elc
+ELCS = $(EFSOBJS) efs-x19.15.elc $(XEOBJS_EFS) $(MULEOBJS_EFS)
 
 INFO_FILES = efs.info
 
 include ../../XEmacs.rules
 
-all:: $(ELCS) auto-autoloads.elc custom-load.elc $(PACKAGE).info
+all:: $(ELCS) auto-autoloads.elc efs.info
 
 srckit: srckit-std
 
 binkit: binkit-sourceinfo
+

Makefile-ms

-###############################################################################
-#
-# File:         Makefile
-# Release:      $efs release: 1.15 $
-# Version:      $Revision$
-# RCS:
-# Description:  Makefile for byte-compiling efs and dired.
-# Author:       Andy Norman, HPLabs, Bristol, UK.
-# Created:      Sat Jan 30 00:18:56 1993
-# Language:     Text (make script)
-#
-###############################################################################
-
-## Installation Instructions
-############################
-# 1. Edit the configuration variables below.
-#    EMACS should be the name of the emacs program on your system.
-#    VERSION should be the emacs version. This must be one of:
-#      18     for all versions of Emacs 18.
-#      19     for all versions of the original GNU Emacs from FSF between
-#             19.1 and 19.22, inclusive.
-#      19.23  for version 19.23 and later of the original GNU Emacs from FSF
-#      l19.11 for XEmacs 19.11 trhu 19.14
-#      x19.15 for XEmacs 19.15
-#      x20    for XEmacs 20.1 and later
-#    LISPDIR should be the directory in which you want the .elc
-#      files installed.
-#    BDIR should be the directory containing the .elc files for the
-#      byte-compiler.  Although efs byte-compiles and works with the
-#      Emacs V18 byte-compiler, it is strongly recommended to use
-#      Jamie Zawinski's V19 byte-compiler. This byte-compiler is
-#      standard with Lucid Emacs, XEmacs, and GNU Emacs V19, so in this
-#      case you can set BDIR to nothing.
-#    VMDIR should be set to the directory containing the .elc files for
-#      VM. If you aren't using VM, then set this to nothing.
-#
-# 2. To byte-compile the entire package, except for VM support (efs-vm.el),
-#    run make VERSION, where VERSION is the emacs version that you are
-#    compiling for.  It must be one of:
-#    18     for Emacs 18
-#    19     for the original GNU Emacs from FSF, versions 19.1 through
-#             19.22, inclusive
-#    19.23  for the original GNU Emacs from FSF, version 19.23 and later.
-#    l19.11 for Lucid XEmacs 19.11 thru 19.14
-#    x19.15 for XEmacs 19.15
-#    x20    for XEmacs 20.1 and later
-#
-#    If you have set the VERSION variable correctly, then typing just    
-#    make will suffice.
-#
-# 3. To byte-compile everything, including VM support, run make all.
-#
-# 4. To byte-compile all the efs files, except for VM support,
-#    run make efs.
-#
-# 5. To byte-compile only the core efs files run make core.
-#
-# 6. To byte compile an efs-XXX.el file, run make XXX.
-#    This means that VM support can be compiled by running make vm.
-#
-# 7. To byte compile only dired, run make dired.
-#
-# 8. To byte-compile only efs-auto.el, for autoloading efs, run make auto.
-#
-
-## Edit these variables according to your configuration.
-
-# Name of Emacs program
-EMACS=xemacs
-# Emacs version. This must be set to one of 18, 19, 19.23,
-# l19.11, x19.15
-VERSION=x19.15
-# Current working directory
-CWD=`pwd`
-# Directory in which to install the lisp files
-LISPDIR=
-# Directory in which to install the info files
-INFODIR=
-# Directory in which to install the Texinfo file
-TEXIDIR=
-# Directory containing byte-compiler.  This is used by fixup.el
-BDIR=
-# Directory containing VM's .elc files.
-VMDIR=
-# Bourne shell executable, please.
-SHELL=/bin/sh
-
-###### It should not be necessary to edit anything below this line. ######
-
-COREOBJS = efs-defun.elc efs-ovwrt.elc efs-fnh.elc efs-cu.elc efs-netrc.elc \
-           efs.elc efs-dired.elc efs-report.elc \
-           efs-cp-p.elc \
-	   efs-dump.elc
-CORESRC = efs-defun.el efs-ovwrt.el efs-fnh.el efs-cu.el efs-netrc.el \
-          efs.el efs-dired.el efs-report.el \
-          efs-cp-p.el \
-	  efs-dump.el
-DOBJS = default-dir.elc dired.elc dired-mob.elc dired-oas.elc \
-        dired-rgxp.elc dired-shell.elc dired-vir.elc dired-xy.elc \
-        dired-grep.elc dired-uu.elc \
-        dired-cmpr.elc dired-diff.elc dired-help.elc dired-sex.elc
-DSRC = default-dir.el dired.el dired-mob.el dired-oas.el \
-       dired-rgxp.el dired-shell.el dired-vir.el dired-xy.el \
-       dired-grep.el dired-uu.el \
-       dired-cmpr.el dired-diff.el dired-help.el dired-sex.el
-EFSOBJS = $(COREOBJS) efs-auto.elc \
-          efs-cms.elc efs-cms-knet.elc efs-dos-distinct.elc efs-nos-ve.elc \
-          efs-gwp.elc efs-kerberos.elc efs-hell.elc efs-ka9q.elc \
-          efs-mpe.elc efs-mts.elc efs-mvs.elc efs-netware.elc \
-          efs-pc.elc efs-ti-explorer.elc efs-ti-twenex.elc \
-          efs-tops-20.elc efs-dl.elc efs-guardian.elc efs-coke.elc \
-          efs-vms.elc efs-vos.elc efs-plan9.elc efs-ms-unix.elc
-EFSSRC = $(CORESRC) efs-auto.el \
-          efs-cms.el efs-cms-knet.el efs-dos-distinct.el efs-nos-ve.el \
-          efs-gwp.el efs-kerberos.el efs-hell.el efs-ka9q.el \
-          efs-mpe.el efs-mts.el efs-mvs.el efs-netware.el \
-          efs-pc.el efs-ti-explorer.el efs-ti-twenex.el \
-          efs-tops-20.el efs-dl.el efs-guardian.el efs-coke.el \
-          efs-vms.el efs-vos.el efs-plan9.el efs-ms-unix.el
-VMOBJS = efs-vm.elc
-VMSRC = efs-vm.el
-MULEOBJS = dired-mule.elc efs-dired-mule.elc
-MULESRC = dired-mule.el efs-dired-mule.el
-GEOBJS = dired-fsf.elc \
-	 passwd.elc diff.elc auto-save.elc \
-	 $(MULEOBJS)
-GESRC = dired-fsf.el \
-	passwd.el diff.el auto-save.el \
-	$(MULESRC)
-XEOBJS = dired-faces.elc dired-xemacs.elc \
-	$(VMOBJS)
-XESRC = dired-faces.el dired-xemacs.el \
-	$(VMSRC) $(MULESRC)
-OBJS = $(DOBJS) $(EFSOBJS) $(VMOBJS) $(GEOBJS) $(XEOBJS) \
-       efs-18.elc efs-19.elc efs-19.23.elc \
-       efs-l19.11.elc efs-x19.15.elc \
-       emacs-19.elc fn-handler.elc \
-       reporter.elc
-
-# fixup.el is never byte-compiled.  It would do no harm, but be a waste
-# of time.
-
-## Specify new rules.
-
-.SUFFIXES: .elc .el .texi .info
-
-.el.elc:
-	BDIR=$(BDIR) CWD=$(CWD) VMDIR=$(VMDIR) \
-  $(EMACS) -batch -no-site-file -l $(CWD)/fixup -f batch-byte-compile $(CWD)/$<
-
-.texi.info:
-	$(EMACS) -batch -f batch-texinfo-format $(CWD)/$<
-
-## targets
-
-# What lazy fingers buys you
-default: $(VERSION) dired
-
-# .elc files depend on .el source
-# Do this in this brain-dead way because different makes do pattern
-# rules differently. grumble grumble...
-#
-# dired
-dired.elc: dired.el
-dired-mob.elc: dired-mob.el
-dired-oas.elc: dired-oas.el
-dired-rgxp.elc: dired-rgxp.el
-dired-shell.elc: dired-shell.el
-dired-vir.elc: dired-vir.el
-dired-xy.elc: dired-xy.el
-dired-grep.elc: dired-grep.el
-dired-uu.elc: dired-uu.el
-dired-fsf.elc: dired-fsf.el
-dired-cmpr.elc: dired-cmpr.el
-dired-help.elc: dired-help.el
-dired-diff.elc: dired-diff.el
-dired-sex.elc: dired-sex.el
-dired-mule.elc: dired-mule.el
-dired-xemacs.elc: dired-xemacs.el
-dired-faces.elc: dired-faces.el
-default-dir.elc: default-dir.el
-diff.elc: diff.el
-# efs core files
-efs.elc: efs.el
-efs-defun.elc: efs-defun.el
-efs-cp-p.elc: efs-cp-p.el
-efs-cu.elc: efs-cu.el
-efs-netrc.elc: efs-netrc.el
-efs-auto.elc: efs-auto.el
-efs-dired.elc: efs-dired.el
-efs-dired-mule.elc: efs-dired-mule.el
-efs-report.elc: efs-report.el
-efs-ovwrt.elc: efs-ovwrt.el
-efs-fnh.elc: efs-fnh.el
-# efs multi-OS and FTP server support
-efs-cms.elc: efs-cms.el
-efs-cms-knet.elc: efs-cms-knet.el
-efs-coke.elc: efs-coke.el
-efs-dos-distinct.elc: efs-dos-distinct.el
-efs-nos-ve.elc: efs-nos-ve.el
-efs-gwp.elc:  efs-gwp.el
-efs-hell.elc: efs-hell.el
-efs-ka9q.elc: efs-ka9q.el
-efs-kerberos.elc: efs-kerberos.el
-efs-mpe.elc: efs-mpe.el
-efs-mts.elc: efs-mts.el
-efs-mvs.elc: efs-mvs.el
-efs-netware.elc: efs-netware.el
-efs-pc.elc: efs-pc.el
-efs-ti-explorer.elc: efs-ti-explorer.el
-efs-ti-twenex.elc: efs-ti-twenex.el
-efs-tops-20.elc: efs-tops-20.el
-efs-dl.elc: efs-dl.el
-efs-vms.elc: efs-vms.el
-efs-vos.elc: efs-vos.el
-efs-guardian.elc: efs-guardian.el
-efs-plan9.elc: efs-plan9.el
-efs-ms-unix.elc: efs-ms-unix.el
-# efs support for different Emacs versions
-efs-18.elc: efs-18.el
-efs-19.elc: efs-19.el
-efs-19.23.elc: efs-19.23.el
-efs-l19.11.elc: efs-l19.11.el
-efs-x19.15.elc: efs-x19.15.el
-# efs vm support
-efs-vm.elc: efs-vm.el
-# backward compatibility files
-fn-handler.elc: fn-handler.el
-emacs-19.elc: emacs-19.el
-# auto-save package
-auto-save.elc: auto-save.el
-
-# Core targets
-core: $(COREOBJS)
-
-# Extra perks
-auto: core efs-auto.elc
-cms: core efs-cms.elc
-cms-knet: core efs-cms-knet.elc
-dos-distinct: core efs-dos-distinct.elc
-nos-ve: core efs-nos-ve.elc
-gwp: core efs-gwp.elc
-hell: core efs-hell.elc
-ka9q: core efs-ka9q.elc
-kerberos: core efs-kerberos.elc
-mpe: core efs-mpe.elc
-mts: core efs-mts.elc
-mvs: core efs-mvs.elc
-netware: core efs-netware.elc
-pc: core efs-pc.elc
-ti-explorer: core efs-ti-explorer.elc
-ti-twenex: core efs-ti-twenex.elc
-tops-20: core efs-tops-20.elc
-dl: core efs-dl.elc
-vms: core efs-vms.elc
-vos: core efs-vos.elc
-guardian: core efs-guardian.elc
-plan9: core efs-plan9.elc
-coke: core efs-coke.elc
-vm: core $(VMOBJS)
-
-# The grand tour
-efs: $(EFSOBJS)
-dired: $(DOBJS)
-all: $(OBJS)
-info: efs.info
-
-# Making for a specific emacs version
-18: emacs-19.elc fn-handler.elc efs dired efs-18.elc dired-mule.elc \
-    efs-dired-mule.elc reporter.elc passwd.elc diff.elc auto-save.elc
-19: fn-handler.elc efs dired efs-19.elc $(GEOBJS)
-19.23: efs dired efs-19.23.elc $(GEOBJS)
-l19.11: efs dired efs-l19.11.elc $(XEOBJS)
-x19.15: efs dired efs-x19.15.elc $(XEOBJS)
-x20: efs dired efs-x19.15.elc $(XEOBJS) $(MULEOBJS)
-
-# Installation
-install:
-	@echo "Installing in $(LISPDIR)..."
-	cp *.elc $(LISPDIR)
-	cp efs.info $(INFODIR)
-install_src:
-	@echo "Installing in $(LISPDIR)..."
-	cp `ls *.el | grep -v "fixup"` $(LISPDIR)
-	cp efs.texi $(TEXIDIR)
-install_xemacs:
-	@echo "Installing source in $(LISPDIR)..."
-	cp $(EFSSRC) $(DSRC) $(XESRC) efs-x19.15.el $(LISPDIR)
-	cp Makefile README fixup.el $(LISPDIR)
-	cp efs.texi $(TEXIDIR)
-diff_xemacs:
-	for f in $(EFSSRC) $(DSRC) $(XESRC) efs-x19.15.el \
-	         Makefile README fixup.el; do \
-		if [ -e $(LISPDIR)/$$f ]; \
-		then\
-		  diff -c $(LISPDIR)/$$f $$f; \
-		else \
-		  diff -c /dev/null $$f; \
-		fi \
-	done
-install_all: install_src install
-clean:
-	rm -f $(OBJS)
-
-autoloads: auto-autoloads.el
-
-auto-autoloads.el: $(EFSSRC) $(DSRC) efs-x19.15.el $(XESRC) $(MULESRC)
-	$(EMACS) -batch -q -no-site-file \
-		-eval '(setq autoload-target-directory "'`pwd`'/")' \
-		-eval '(setq autoload-package-name "efs")' \
-		-l autoload \
-		-f batch-update-autoloads $?
-
-## end of Makefile ##
+###############################################################################
+#
+# File:         Makefile
+# Release:      $EFS release: 1.16 $
+# Release:      $dired release: 7.9 $
+# Version:      $Revision$
+# RCS:
+# Description:  Makefile for byte-compiling EFS (primarily) and dired.
+# Author:       Andy Norman, HPLabs, Bristol, UK.
+# Created:      Sat Jan 30 00:18:56 1993
+# Language:     Text (make script)
+#
+###############################################################################
+
+## Installation Instructions
+############################
+# 1. Edit the configuration variables below.
+#    EMACS should be the name of the emacs program on your system.
+#    EMACS_VERSION should be the emacs version. This must be one of:
+#      18     for all versions of Emacs 18.
+#      19     for all versions of the original GNU Emacs from FSF between
+#             19.1 and 19.22, inclusive.
+#      19.23  for version 19.23 and later of the original GNU Emacs from FSF
+#      l19.11 for XEmacs 19.11 trhu 19.14
+#      x19.15 for XEmacs 19.15
+#      x20    for XEmacs 20.1 and later
+#    LISPDIR should be the directory in which you want the .elc
+#      files installed.
+#    BDIR should be the directory containing the .elc files for the
+#      byte-compiler.  Although efs byte-compiles and works with the
+#      Emacs V18 byte-compiler, it is strongly recommended to use
+#      Jamie Zawinski's V19 byte-compiler. This byte-compiler is
+#      standard with Lucid Emacs, XEmacs, and GNU Emacs V19, so in this
+#      case you can set BDIR to nothing.
+#    VMDIR should be set to the directory containing the .elc files for
+#      VM. If you aren't using VM, then set this to nothing.
+#
+# 2. To byte-compile the entire package, except for VM support (efs-vm.el),
+#    run make EMACS_VERSION, where EMACS_VERSION is the emacs version that you are
+#    compiling for.  It must be one of:
+#    18     for Emacs 18
+#    19     for the original GNU Emacs from FSF, versions 19.1 through
+#             19.22, inclusive
+#    19.23  for the original GNU Emacs from FSF, version 19.23 and later.
+#    l19.11 for Lucid XEmacs 19.11 thru 19.14
+#    x19.15 for XEmacs 19.15
+#    x20    for XEmacs 20.1 and later
+#
+#    If you have set the EMACS_VERSION variable correctly, then typing just    
+#    make will suffice.
+#
+# 3. To byte-compile everything, including VM support, run make all.
+#
+# 4. To byte-compile all the efs files, except for VM support,
+#    run make efs.
+#
+# 5. To byte-compile only the core efs files run make core.
+#
+# 6. To byte compile an efs-XXX.el file, run make XXX.
+#    This means that VM support can be compiled by running make vm.
+#
+# 7. To byte compile only dired, run make dired.
+#
+# 8. To byte-compile only efs-auto.el, for autoloading efs, run make auto.
+#
+
+## Edit these variables according to your configuration.
+
+# Name of Emacs program
+EMACS=xemacs
+# Emacs version. This must be set to one of 18, 19, 19.23,
+# l19.11, x19.15
+EMACS_VERSION=x19.15
+# Current working directory
+CWD=`pwd`
+# Directory in which to install the lisp files
+LISPDIR=
+# Directory in which to install the info files
+INFODIR=
+# Directory in which to install the Texinfo file
+TEXIDIR=
+# Directory containing byte-compiler.  This is used by fixup.el
+BDIR=
+# Directory containing VM's .elc files.
+VMDIR=
+# Bourne shell executable, please.
+SHELL=/bin/sh
+
+###### It should not be necessary to edit anything below this line. ######
+
+COREOBJS = efs-defun.elc efs-ovwrt.elc efs-fnh.elc efs-cu.elc efs-netrc.elc \
+           efs.elc efs-dired.elc efs-report.elc \
+           efs-cp-p.elc \
+	   efs-dump.elc
+CORESRC = efs-defun.el efs-ovwrt.el efs-fnh.el efs-cu.el efs-netrc.el \
+          efs.el efs-dired.el efs-report.el \
+          efs-cp-p.el \
+	  efs-dump.el
+DOBJS = dired.elc dired-mob.elc dired-oas.elc \
+        dired-rgxp.elc dired-shell.elc dired-vir.elc dired-xy.elc \
+        dired-grep.elc dired-uu.elc \
+        dired-cmpr.elc dired-diff.elc dired-help.elc dired-sex.elc
+DSRC = dired.el dired-mob.el dired-oas.el \
+       dired-rgxp.el dired-shell.el dired-vir.el dired-xy.el \
+       dired-grep.el dired-uu.el \
+       dired-cmpr.el dired-diff.el dired-help.el dired-sex.el
+EFSOBJS = $(COREOBJS) default-dir.elc efs-auto.elc \
+          efs-cms.elc efs-cms-knet.elc efs-dos-distinct.elc efs-nos-ve.elc \
+          efs-gwp.elc efs-kerberos.elc efs-hell.elc efs-ka9q.elc \
+          efs-mpe.elc efs-mts.elc efs-mvs.elc efs-netware.elc \
+          efs-pc.elc efs-ti-explorer.elc efs-ti-twenex.elc \
+          efs-tops-20.elc efs-dl.elc efs-guardian.elc efs-coke.elc \
+          efs-vms.elc efs-vos.elc efs-plan9.elc efs-ms-unix.elc
+EFSSRC = $(CORESRC) default-dir.el efs-auto.el \
+          efs-cms.el efs-cms-knet.el efs-dos-distinct.el efs-nos-ve.el \
+          efs-gwp.el efs-kerberos.el efs-hell.el efs-ka9q.el \
+          efs-mpe.el efs-mts.el efs-mvs.el efs-netware.el \
+          efs-pc.el efs-ti-explorer.el efs-ti-twenex.el \
+          efs-tops-20.el efs-dl.el efs-guardian.el efs-coke.el \
+          efs-vms.el efs-vos.el efs-plan9.el efs-ms-unix.el
+VMOBJS = efs-vm.elc
+VMSRC = efs-vm.el
+MULEOBJS_EFS = efs-dired-mule.elc
+MULEOBJS_DIRED = dired-mule.elc
+MULESRC_EFS = efs-dired-mule.el
+MULESRC_DIRED = dired-mule.el
+GEOBJS_EFS = passwd.elc auto-save.elc \
+	 $(MULEOBJS_EFS)
+GEOBJS_DIRED = dired-fsf.elc \
+	 passwd.elc diff.elc \
+	 $(MULEOBJS_DIRED)
+GEOBJS = $(GEOBJS_EFS) $(GEOBJS_DIRED)
+GESRC_EFS = passwd.el auto-save.el \
+	$(MULESRC_EFS)
+GESRC_DIRED = dired-fsf.el \
+	diff.el\
+	$(MULESRC_DIRED)
+XEOBJS_EFS = $(VMOBJS)
+XEOBJS_DIRED = dired-faces.elc dired-xemacs.elc diff.elc
+XEOBJS = $(XEOBJS_EFS) $(XEOBJS_DIRED)
+XESRC_EFS = dired-faces.el dired-xemacs.el \
+	$(VMSRC) $(MULESRC_EFS)
+XESRC_DIRED = dired-faces.el dired-xemacs.el diff.el \
+	$(MULESRC_DIRED)
+OBJS = $(DOBJS) $(EFSOBJS) $(VMOBJS) $(GEOBJS) $(XEOBJS) \
+       efs-18.elc efs-19.elc efs-19.23.elc \
+       efs-l19.11.elc efs-x19.15.elc \
+       emacs-19.elc fn-handler.elc \
+       reporter.elc
+
+# fixup.el is never byte-compiled.  It would do no harm, but be a waste
+# of time.
+
+## Specify new rules.
+
+.SUFFIXES: .elc .el .texi .info
+
+.el.elc:
+	BDIR=$(BDIR) CWD=$(CWD) VMDIR=$(VMDIR) \
+  $(EMACS) -batch -no-site-file -l $(CWD)/fixup -f batch-byte-compile $(CWD)/$<
+
+.texi.info:
+	$(EMACS) -batch -f batch-texinfo-format $(CWD)/$<
+
+## targets
+
+# What lazy fingers buys you
+default: efs-$(EMACS_VERSION)
+
+# .elc files depend on .el source
+# Do this in this brain-dead way because different makes do pattern
+# rules differently. grumble grumble...
+#
+# dired
+dired.elc: dired.el
+dired-mob.elc: dired-mob.el
+dired-oas.elc: dired-oas.el
+dired-rgxp.elc: dired-rgxp.el
+dired-shell.elc: dired-shell.el
+dired-vir.elc: dired-vir.el
+dired-xy.elc: dired-xy.el
+dired-grep.elc: dired-grep.el
+dired-uu.elc: dired-uu.el
+dired-fsf.elc: dired-fsf.el
+dired-cmpr.elc: dired-cmpr.el
+dired-help.elc: dired-help.el
+dired-diff.elc: dired-diff.el
+dired-sex.elc: dired-sex.el
+dired-mule.elc: dired-mule.el
+dired-xemacs.elc: dired-xemacs.el
+dired-faces.elc: dired-faces.el
+default-dir.elc: default-dir.el
+diff.elc: diff.el
+# efs core files
+efs.elc: efs.el
+efs-defun.elc: efs-defun.el
+efs-cp-p.elc: efs-cp-p.el
+efs-cu.elc: efs-cu.el
+efs-netrc.elc: efs-netrc.el
+efs-auto.elc: efs-auto.el
+efs-dired.elc: efs-dired.el
+efs-dired-mule.elc: efs-dired-mule.el
+efs-report.elc: efs-report.el
+efs-ovwrt.elc: efs-ovwrt.el
+efs-fnh.elc: efs-fnh.el
+# efs multi-OS and FTP server support
+efs-cms.elc: efs-cms.el
+efs-cms-knet.elc: efs-cms-knet.el
+efs-coke.elc: efs-coke.el
+efs-dos-distinct.elc: efs-dos-distinct.el
+efs-nos-ve.elc: efs-nos-ve.el
+efs-gwp.elc:  efs-gwp.el
+efs-hell.elc: efs-hell.el
+efs-ka9q.elc: efs-ka9q.el
+efs-kerberos.elc: efs-kerberos.el
+efs-mpe.elc: efs-mpe.el
+efs-mts.elc: efs-mts.el
+efs-mvs.elc: efs-mvs.el
+efs-netware.elc: efs-netware.el
+efs-pc.elc: efs-pc.el
+efs-ti-explorer.elc: efs-ti-explorer.el
+efs-ti-twenex.elc: efs-ti-twenex.el
+efs-tops-20.elc: efs-tops-20.el
+efs-dl.elc: efs-dl.el
+efs-vms.elc: efs-vms.el
+efs-vos.elc: efs-vos.el
+efs-guardian.elc: efs-guardian.el
+efs-plan9.elc: efs-plan9.el
+efs-ms-unix.elc: efs-ms-unix.el
+# efs support for different Emacs versions
+efs-18.elc: efs-18.el
+efs-19.elc: efs-19.el
+efs-19.23.elc: efs-19.23.el
+efs-l19.11.elc: efs-l19.11.el
+efs-x19.15.elc: efs-x19.15.el
+# efs vm support
+efs-vm.elc: efs-vm.el
+# backward compatibility files
+fn-handler.elc: fn-handler.el
+emacs-19.elc: emacs-19.el
+# auto-save package
+auto-save.elc: auto-save.el
+
+# Core targets
+core: $(COREOBJS)
+
+# Extra perks
+auto: core efs-auto.elc
+cms: core efs-cms.elc
+cms-knet: core efs-cms-knet.elc
+dos-distinct: core efs-dos-distinct.elc
+nos-ve: core efs-nos-ve.elc
+gwp: core efs-gwp.elc
+hell: core efs-hell.elc
+ka9q: core efs-ka9q.elc
+kerberos: core efs-kerberos.elc
+mpe: core efs-mpe.elc
+mts: core efs-mts.elc
+mvs: core efs-mvs.elc
+netware: core efs-netware.elc
+pc: core efs-pc.elc
+ti-explorer: core efs-ti-explorer.elc
+ti-twenex: core efs-ti-twenex.elc
+tops-20: core efs-tops-20.elc
+dl: core efs-dl.elc
+vms: core efs-vms.elc
+vos: core efs-vos.elc
+guardian: core efs-guardian.elc
+plan9: core efs-plan9.elc
+coke: core efs-coke.elc
+vm: core $(VMOBJS)
+
+# The grand tour
+efs: $(EFSOBJS)
+dired: $(DOBJS)
+info: efs.info
+
+# Making for a specific emacs version
+efs-18: emacs-19.elc fn-handler.elc efs efs-18.elc \
+    efs-dired-mule.elc reporter.elc passwd.elc auto-save.elc
+efs-19: fn-handler.elc efs efs-19.elc $(GEOBJS_EFS)
+efs-19.23: efs efs-19.23.elc $(GEOBJS_EFS)
+efs-l19.11: efs efs-l19.11.elc $(XEOBJS_EFS)
+efs-x19.15: efs efs-x19.15.elc $(XEOBJS_EFS)
+efs-x20: efs efs-x19.15.elc $(XEOBJS_EFS) $(MULEOBJS_EFS)
+
+dired-18: emacs-19.elc fn-handler.elc efs dired dired-mule.elc \
+    reporter.elc diff.elc
+dired-19: fn-handler.elc efs dired $(GEOBJS_DIRED)
+dired-19.23: dired $(GEOBJS_DIRED)
+dired-l19.11: dired $(XEOBJS_DIRED)
+dired-x19.15: dired $(XEOBJS_DIRED)
+dired-x20: dired $(XEOBJS_DIRED) $(MULEOBJS_DIRED)
+
+# Installation
+install:
+	@echo "Installing in $(LISPDIR)..."
+	cp *.elc $(LISPDIR)
+	cp *.info $(INFODIR)
+install_src:
+	@echo "Installing in $(LISPDIR)..."
+	cp `ls *.el | grep -v "fixup"` $(LISPDIR)
+	cp *texi $(TEXIDIR)
+clean::
+	rm -f $(OBJS)
+
+## end of Makefile ##
 --------------------------------------------
 
 For documentation, see the first page of the file efs.el.  If you
-access FTP via a gateway, then be sure to read the documentation in
-efs.el on how to configure efs to use a gateway.  To find the section
-on user customization variables in efs.el, search for the first
-occurrence of the string ">>>>".  TeXinfo documentation is
-forthcoming.
-
-The file CHANGES contains a description of changes to EFS from the
-previous release to this release.  It also tells you where you can get
-the latest version of efs.
+access FTP via a gateway, then be sure to read the TeXinfo
+documentation in efs.info.
 
 The file LISTS contains a description of mailing lists relevant to
 efs.  It too tells you where you can get the latest version of efs.
+;; -*- Emacs-Lisp -*-
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; File:          auto-save.el
+;; Version:       #Revision: 1.25 $
+;; RCS:           
+;; Description:   Safer autosaving with support for efs and /tmp.
+;;                This version of auto-save is designed to work with efs,
+;;                instead of ange-ftp.
+;; Author:        Sebastian Kremer <sk@thp.uni-koeln.de>,
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defconst auto-save-version (substring "#Revision: 1.25 $" 11 -2)
+  "Version number of auto-save.")
+
+;;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de>
+
+;;; This program 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 1, or (at your option)
+;;; any later version.
+
+;;; This program 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 this program; if not, write to the Free Software
+;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;;; OVERVIEW ==========================================================
+
+;;; Combines autosaving for efs (to a local or remote directory)
+;;; with the ability to do autosaves to a fixed directory on a local
+;;; disk, in case NFS is slow.  The auto-save file used for
+;;;     /usr/foo/bar/baz.txt
+;;; will be
+;;;     AUTOSAVE/#\!usr\!foo\!bar\!baz.txt#
+;;; assuming AUTOSAVE is the non-nil value of the variable
+;;; `auto-save-directory'.
+
+;;; Takes care that autosave files for non-file-buffers (e.g. *mail*)
+;;; from two simultaneous Emacses don't collide.
+
+;;; Autosaves even if the current directory is not writable.
+
+;;; Can limit autosave names to 14 characters using a hash function,
+;;; see `auto-save-hash-p'.
+
+;;; See `auto-save-directory' and `make-auto-save-file-name' and
+;;; references therein for complete documentation.
+
+;;; Meta-x recover-all-files will effectively do recover-file on all
+;;; files whose autosave file is newer (one of the benefits of having
+;;; all autosave files in the same place).
+
+;;;; INSTALLATION ======================================================
+
+;;; Put this file into your load-path and the following in your ~/.emacs:
+
+;;; If you want to autosave in the fixed directory /tmp/USER-autosave/
+;;; (setq auto-save-directory
+;;;       (concat "/tmp/" (user-login-name) "-autosave/"))
+
+;;; If you don't want to save in /tmp (e.g., because it is swap
+;;; mounted) but rather in ~/autosave/
+;;;   (setq auto-save-directory (expand-file-name "~/autosave/"))
+
+;;; If you want to save each file in its own directory (the default)
+;;;   (setq auto-save-directory nil)
+;;; You still can take advantage of autosaving efs remote files
+;;; in a fixed local directory, `auto-save-directory-fallback' will
+;;; be used.
+
+;;; If you want to use 14 character hashed autosave filenames
+;;;   (setq auto-save-hash-p t)
+
+;;; Finally, put this line after the others in your ~/.emacs:
+;;;   (require 'auto-save)
+
+
+;;;; ACKNOWLEDGEMENT ===================================================
+
+;;; This code is loosely derived from autosave-in-tmp.el by Jamie
+;;; Zawinski <jwz@lucid.com> (the version I had was last modified 22
+;;; dec 90 jwz) and code submitted to ange-ftp-lovers on Sun, 5 Apr
+;;; 92 23:20:47 EDT by drw@BOURBAKI.MIT.EDU (Dale R. Worley).
+;;; auto-save.el tries to cover the functionality of those two
+;;; packages.
+
+;;; Valuable comments and help from Dale Worley, Andy Norman, Jamie
+;;; Zawinski and Sandy Rutherford are gratefully acknowledged.
+
+;;;; PROVISION ========================================================
+
+(provide 'auto-save)
+
+;;;; CUSTOMIZATION =====================================================
+
+(defvar auto-save-directory nil
+
+  ;;; Don't make this user-variable-p, it should be set in .emacs and
+  ;;; left at that.  In particular, it should remain constant across
+  ;;; several Emacs session to make recover-all-files work.
+
+  "If non-nil, fixed directory for autosaving: all autosave files go
+there.  If this directory does not yet exist at load time, it is
+created and its mode is set to 0700 so that nobody else can read your
+autosave files.
+
+If nil, each autosave files goes into the same directory as its
+corresponding visited file.
+
+A non-nil `auto-save-directory' could be on a local disk such as in
+/tmp, then auto-saves will always be fast, even if NFS or the
+automounter is slow.  In the usual case of /tmp being locally mounted,
+note that if you run emacs on two different machines, they will not
+see each other's auto-save files.
+
+The value \(expand-file-name \"~/autosave/\"\) might be better if /tmp
+is mounted from swap (possible in SunOS, type `df /tmp' to find out)
+and thus vanishes after a reboot, or if your system is particularly
+thorough when cleaning up /tmp, clearing even non-empty subdirectories.
+
+It should never be an efs remote filename because that would
+defeat `efs-auto-save-remotely'.
+
+Unless you set `auto-save-hash-p', you shouldn't set this to a
+directory in a filesystem that does not support long filenames, since
+a file named
+
+    /home/sk/lib/emacs/lisp/auto-save.el
+
+will have a longish filename like
+
+    AUTO-SAVE-DIRECTORY/#\\!home\\!sk\\!lib\\!emacs\\!lisp\\!auto-save.el#
+
+as auto save file.
+
+See also variables `auto-save-directory-fallback',
+`efs-auto-save' and `efs-auto-save-remotely'.")
+
+(defvar auto-save-hash-p nil
+  "If non-nil, hashed autosave names of length 14 are used.
+This is to avoid autosave filenames longer than 14 characters.
+The directory used is `auto-save-hash-directory' regardless of
+`auto-save-directory'.
+Hashing defeats `recover-all-files', you have to recover files
+individually by doing `recover-file'.")
+
+;;; This defvar is in efs.el now, but doesn't hurt to give it here as
+;;; well so that loading first auto-save.el does not abort.
+(or (boundp 'efs-auto-save) (defvar efs-auto-save 0))
+(or (boundp 'efs-auto-save-remotely) (defvar efs-auto-save-remotely nil))
+
+(defvar auto-save-offer-delete nil
+  "*If non-nil, `recover-all-files' offers to delete autosave files
+that are out of date or were dismissed for recovering.
+Special value 'always deletes those files silently.")
+
+;;;; end of customization
+
+
+;;; Preparations to be done at load time
+
+(defvar auto-save-directory-fallback (expand-file-name "~/autosave/")
+  ;; not user-variable-p, see above
+  "Directory used for local autosaving of remote files if
+both `auto-save-directory' and `efs-auto-save-remotely' are nil.
+Also used if a working directory to be used for autosaving is not writable.
+This *must* always be the name of directory that exists or can be
+created by you, never nil.")
+
+(defvar auto-save-hash-directory
+  (expand-file-name "hash/" (or auto-save-directory
+				auto-save-directory-fallback))
+  "If non-nil, directory used for hashed autosave filenames.")
+
+(defun auto-save-check-directory (var)
+  (let ((dir (symbol-value var)))
+    (if (null dir)
+	nil
+      ;; Expand and store back into the variable
+      (set var (setq dir (expand-file-name dir)))
+      ;; Make sure directory exists
+      (if (file-directory-p dir)
+	  nil
+	;; Else we create and chmod 0700 the directory
+	(setq dir (directory-file-name dir)) ; some systems need this
+	(if (fboundp 'make-directory)	; V19 or tree dired
+	    (make-directory dir)
+	  (call-process "mkdir" nil nil nil dir))
+	(set-file-modes dir (* 7 8 8))))))
+
+(mapcar (function auto-save-check-directory)
+	'(auto-save-directory auto-save-directory-fallback))
+
+(and auto-save-hash-p
+     (auto-save-check-directory 'auto-save-hash-directory))
+
+
+;;; Computing an autosave name for a file and vice versa
+
+(defun make-auto-save-file-name ();; redefines files.el
+  ;; auto-save-file-name-p need not be redefined.
+
+  "Return file name to use for auto-saves of current buffer.
+Does not consider `auto-save-visited-file-name'; that is checked
+before calling this function.
+
+Offers to autosave all files in the same `auto-save-directory'.  All
+autosave files can then be recovered at once with function
+`recover-all-files'.
+
+Takes care to make autosave files for files accessed through efs
+be local files if variable `efs-auto-save-remotely' is nil.
+
+Takes care of slashes in buffer names to prevent autosave errors.
+
+Takes care that autosave files for buffers not visiting any file (such
+as `*mail*') from two simultaneous Emacses don't collide by prepending
+the Emacs pid.
+
+Uses 14 character autosave names if `auto-save-hash-p' is true.
+
+Autosaves even if the current directory is not writable, using
+directory `auto-save-directory-fallback'.
+
+You can redefine this for customization (he he :-).
+See also function `auto-save-file-name-p'."
+
+  ;; We have to be very careful about not signalling an error in this
+  ;; function since files.el does not provide for this (e.g. find-file
+  ;; would fail for each new file).
+
+  (condition-case error-data
+      (let* ((file-name (or (and (boundp 'buffer-file-truename)
+				 buffer-file-truename
+				 ;; Make sure that the file name is expanded.
+				 (expand-file-name buffer-file-name))
+			    (and buffer-file-name
+				 (expand-file-name buffer-file-name))))
+	     ;; So autosavename looks like #%...#, roughly as with the
+	     ;; old make-auto-save-file-name function.  The
+	     ;; make-temp-name inserts the pid of this Emacs: this
+	     ;; avoids autosaving from two Emacses into the same file.
+	     ;; It cannot be recovered automatically then because in
+	     ;; the next Emacs session (the one after the crash) the
+	     ;; pid will be different, but file-less buffers like
+	     ;; *mail* must be recovered manually anyway.
+
+	     ;; jwz: putting the emacs PID in the auto-save file name is bad
+	     ;; news, because that defeats auto-save-recovery of *mail*
+	     ;; buffers -- the (sensible) code in sendmail.el calls
+	     ;; (make-auto-save-file-name) to determine whether there is
+	     ;; unsent, auto-saved mail to recover. If that mail came from a
+	     ;; previous emacs process (far and away the most likely case)
+	     ;; then this can never succeed as the pid differs.
+;;	     (name-prefix (if file-name nil (make-temp-name "#%")))
+	     (name-prefix (if file-name nil "#%"))
+
+	     (save-name (or file-name
+			    ;; Prevent autosave errors.  Buffername
+			    ;; (to become non-dir part of filename) will
+			    ;; be unslashified twice.  Don't care.
+			    (auto-save-unslashify-name (buffer-name))))
+	     (remote-p (and (stringp file-name)
+			    (fboundp 'efs-ftp-path)
+			    (efs-ftp-path file-name))))
+	;; Return the appropriate auto save file name:
+	(expand-file-name;; a buffername needs this, a filename not
+	 (if remote-p
+	     (if efs-auto-save-remotely
+		 (auto-save-name-in-same-directory save-name)
+	       ;; We have to use the `fixed-directory' now since the
+	       ;; `same-directory' would be remote.
+	       ;; It will use the fallback if needed.
+	       (auto-save-name-in-fixed-directory save-name))
+	   ;; Else it is a local file (or a buffer without a file, hence
+	       ;; the name-prefix).
+	   ;; Hashed files always go into the special hash dir, never
+	   ;; in the same directory, to make recognizing reliable.
+	   (if (or auto-save-directory auto-save-hash-p)
+	       (auto-save-name-in-fixed-directory save-name name-prefix)
+	     (auto-save-name-in-same-directory save-name name-prefix)))))
+    
+    ;; If any error occurs in the above code, return what the old
+    ;; version of this function would have done.  It is not ok to
+    ;; return nil, e.g., when after-find-file tests
+    ;; file-newer-than-file-p, nil would bomb.
+
+    (error (progn
+	     (message "make-auto-save-file-name %s" error-data)
+	     (sit-for 2)
+	     (if buffer-file-name
+		 (concat (file-name-directory buffer-file-name)
+			 "#"
+			 (file-name-nondirectory buffer-file-name)
+			 "#")
+	       (expand-file-name (concat "#%" (buffer-name) "#")))))))
+
+(defun auto-save-original-name (savename)
+  "Reverse of `make-auto-save-file-name'.
+Returns nil if SAVENAME was not associated with a file (e.g., it came
+from an autosaved `*mail*' buffer) or does not appear to be an
+autosave file at all.
+Hashed files are not understood, see `auto-save-hash-p'."
+  (let ((basename (file-name-nondirectory savename))
+	(savedir (file-name-directory savename)))
+    (cond ((or (not (auto-save-file-name-p basename))
+	       (string-match "^#%" basename))
+	   nil)
+	  ;; now we know it looks like #...# thus substring is safe to use
+	  ((or (equal savedir auto-save-directory) ; 2nd arg may be nil
+	       (equal savedir auto-save-directory-fallback))
+	   ;; it is of the `-fixed-directory' type
+	   (auto-save-slashify-name (substring basename 1 -1)))
+	  (t
+	   ;; else it is of `-same-directory' type
+	   (concat savedir (substring basename 1 -1))))))
+
+(defun auto-save-name-in-fixed-directory (filename &optional prefix)
+  ;; Unslashify and enclose the whole FILENAME in `#' to make an auto
+  ;; save file in the auto-save-directory, or if that is nil, in
+  ;; auto-save-directory-fallback (which must be the name of an
+  ;; existing directory).  If the results would be too long for 14
+  ;; character filenames, and `auto-save-hash-p' is set, hash FILENAME
+  ;; into a shorter name.
+  ;; Optional PREFIX is string to use instead of "#" to prefix name.
+  (let ((base-name (concat (or prefix "#")
+			   (auto-save-unslashify-name filename)
+			   "#")))
+    (if (and auto-save-hash-p
+	     auto-save-hash-directory
+	     (> (length base-name) 14))
+	(expand-file-name (auto-save-cyclic-hash-14 filename)
+			  auto-save-hash-directory)
+      (expand-file-name base-name
+			(or auto-save-directory
+			    auto-save-directory-fallback)))))
+
+(defun auto-save-name-in-same-directory (filename &optional prefix)
+  ;; Enclose the non-directory part of FILENAME in `#' to make an auto
+  ;; save file in the same directory as FILENAME.  But if this
+  ;; directory is not writable, use auto-save-directory-fallback.
+  ;; FILENAME is assumed to be in non-directory form (no trailing slash).
+  ;; It may be a name without a directory part (pesumably it really
+  ;; comes from a buffer name then), the fallback is used then.
+  ;; Optional PREFIX is string to use instead of "#" to prefix name.
+  (let ((directory (file-name-directory filename)))
+    (or (null directory)
+	(file-writable-p directory)
+	(setq directory auto-save-directory-fallback))
+    (concat directory			; (concat nil) is ""
+	    (or prefix "#")
+	    (file-name-nondirectory filename)
+	    "#")))
+
+(defun auto-save-unslashify-name (s)
+  ;;  "Quote any slashes in string S by replacing them with the two
+  ;;characters `\\!'.
+  ;;Also, replace any backslash by double backslash, to make it one-to-one."
+  (let ((limit 0))
+    (while (string-match "[/\\]" s limit)
+      (setq s (concat (substring s 0 (match-beginning 0))
+		      (if (string= (substring s
+					      (match-beginning 0)
+					      (match-end 0))
+				   "/")
+			  "\\!"
+			"\\\\")
+		      (substring s (match-end 0))))
+      (setq limit (1+ (match-end 0)))))
+  s)
+
+(defun auto-save-slashify-name (s)
+  ;;"Reverse of `auto-save-unslashify-name'."
+  (let (pos)
+    (while (setq pos (string-match "\\\\[\\!]" s pos))
+      (setq s (concat (substring s 0 pos)
+		      (if (eq ?! (aref s (1+ pos))) "/" "\\")
+		      (substring s (+ pos 2)))
+	    pos (1+ pos))))
+  s)
+
+
+;;; Hashing for autosave names
+
+;;; Hashing function contributed by Andy Norman <ange@hplb.hpl.hp.com>
+;;; based upon C code from pot@fly.cnuce.cnr.IT (Francesco Potorti`).
+
+(defun auto-save-cyclic-hash-14 (s)
+  ;;   "Hash string S into a string of length 14.
+  ;; A 7-bytes cyclic code for burst correction is calculated on a
+  ;; byte-by-byte basis. The polynomial used is D^7 + D^6 + D^3 +1.
+  ;; The resulting string consists of hexadecimal digits [0-9a-f].
+  ;; In particular, it contains no slash, so it can be used as autosave name."
+  (let ((crc (make-string 7 0))
+	result)
+    (mapcar
+     (function
+      (lambda (new)
+	(setq new (+ new (aref crc 6)))
+	(aset crc 6 (+ (aref crc 5) new))
+	(aset crc 5 (aref crc 4))
+	(aset crc 4 (aref crc 3))
+	(aset crc 3 (+ (aref crc 2) new))
+	(aset crc 2 (aref crc 1))
+	(aset crc 1 (aref crc 0))
+	(aset crc 0 new)))
+     s)
+    (setq result (format "%02x%02x%02x%02x%02x%02x%02x"
+			 (aref crc 0)
+			 (aref crc 1)
+			 (aref crc 2)
+			 (aref crc 3)
+			 (aref crc 4)
+			 (aref crc 5)
+			 (aref crc 6)))
+    result))
+
+;; This leaves two characters that could be used to wrap it in `#' or
+;; make two filenames from it: one for autosaving, and another for a
+;; file containing the name of the autosaved filed, to make hashing
+;; reversible.
+(defun auto-save-cyclic-hash-12 (s)
+  "Outputs the 12-characters ascii hex representation of a 6-bytes
+cyclic code for burst correction calculated on STRING on a
+byte-by-byte basis. The used polynomial is D^6 + D^5 + D^4 + D^3 +1."
+  (let ((crc (make-string 6 0)))
+    (mapcar
+     (function
+      (lambda (new)
+        (setq new (+ new (aref crc 5)))
+        (aset crc 5 (+ (aref crc 4) new))
+        (aset crc 4 (+ (aref crc 3) new))
+        (aset crc 3 (+ (aref crc 2) new))
+        (aset crc 2 (aref crc 1))
+        (aset crc 1 (aref crc 0))
+        (aset crc 0 new)))
+     s)
+    (format "%02x%02x%02x%02x%02x%02x"
+            (aref crc 0)
+            (aref crc 1)
+            (aref crc 2)
+            (aref crc 3)
+            (aref crc 4)
+            (aref crc 5))))
+
+
+
+;;; Recovering files
+
+(defun recover-all-files (&optional silent)
+  "Do recover-file for all autosave files which are current.
+Only works if you have a non-nil `auto-save-directory'.
+
+Optional prefix argument SILENT means to be silent about non-current
+autosave files.  This is useful if invoked automatically at Emacs
+startup.
+
+If `auto-save-offer-delete' is t, this function will offer to delete
+old or rejected autosave files.
+
+Hashed files (see `auto-save-hash-p') are not understood, use
+`recover-file' to recover them individually."
+  (interactive "P")
+  (let ((savefiles (directory-files auto-save-directory t "^#"))
+	afile				; the auto save file
+	file				; its original file
+	(total 0)			; # of files offered to recover
+	(count 0))			; # of files actually recovered
+    (or (equal auto-save-directory auto-save-directory-fallback)
+	(setq savefiles
+	      (append savefiles
+		      (directory-files auto-save-directory-fallback t "^#"))))
+    (while savefiles
+      (setq afile (car savefiles)
+	    file (auto-save-original-name afile)
+	    savefiles (cdr savefiles))
+      (cond ((and file (not (file-newer-than-file-p afile file)))
+	     (message "autosave file \"%s\" is not current." afile)
+	     (sit-for 2))
+	    (t
+	     (setq total (1+ total))
+	     (with-output-to-temp-buffer "*Directory*"
+	       (apply 'call-process "ls" nil standard-output nil
+		      "-l" afile (if file (list file))))
+	     (if (yes-or-no-p (format "Recover %s from auto save file? "
+				      (or file "non-file buffer")))
+		 (let* ((obuf (current-buffer))
+			(buf (set-buffer
+			      (if file
+				  (find-file-noselect file t)
+				(generate-new-buffer "*recovered*"))))
+			(buffer-read-only nil))
+		   (erase-buffer)
+		   (insert-file-contents afile nil)
+		   (condition-case ()
+		       (after-find-file nil)
+		     (error nil))
+		   (setq buffer-auto-save-file-name nil)
+		   (setq count (1+ count))
+		   (message "\
+Auto-save off in buffer \"%s\" till you do M-x auto-save-mode."
+			    (buffer-name))
+		   (set-buffer obuf)
+		   (sit-for 1))
+	       ;; If not used for recovering, offer to delete
+	       ;; autosave file
+	       (and auto-save-offer-delete
+		    (or (eq 'always auto-save-offer-delete)
+			(yes-or-no-p
+			 (format "Delete autosave file for `%s'? " file)))
+		    (delete-file afile))))))
+    (if (zerop total)
+	(or silent (message "Nothing to recover."))
+      (message "%d/%d file%s recovered." count total (if (= count 1) "" "s"))))
+  (if (get-buffer "*Directory*") (kill-buffer "*Directory*")))
+
+;;; end of auto-save.el

diff.el

-;; -*-Emacs-Lisp-*-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; File:         diff.el
-;; Version:      $Revision$
-;; Author:       This file is based on diff.el by
-;;               sunpitt!wpmstr!fbresz@Sun.COM 1/27/89.
-;;               It has been completely rewritten in July 1994 by
-;;               Sandy Rutherford <sandy@ibm550.sissa.it>
-;; RCS:          
-;; Description:  diff-mode for handling output from unix diff utility.
-;; Modified:     Wed Jul 17 10:26:57 1996 (Andy Norman) ange@hplb.hpl.hp.com
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;; Copyright (C) 1990 Free Software Foundation, Inc.
-;;; Copyright (C) 1994 Sandy Rutherford
-
-;;; This file is based on diff.el by sunpitt!wpmstr!fbresz@Sun.COM 1/27/89.
-;;; It has been completely rewritten in July 1994 by
-;;; Sandy Rutherford <sandy@ibm550.sissa.it>
-
-;;; This program 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 1, or (at your option)
-;;; any later version.
-;;;
-;;; This program 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.
-;;;
-;;; A copy of the GNU General Public License can be obtained from this
-;;; program's author (send electronic mail to sandy@ibm550.sissa.it) or
-;;; from the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
-;;; MA 02139, USA.
-
-(provide 'diff)
-
-;;; User Variables
-
-(defgroup diff nil
-  "Handling output from Unix diff utility"
-  :group 'tools)
-
-;; should be in to loaddefs.el now.
-;;;###autoload
-(defcustom diff-switches "-c"
-  "*A list of switches (strings) to pass to the diff program."
-  :type '(choice string
-		 (repeat string))
-  :group 'diff)
-
-(defcustom diff-do-narrow nil
-  "*If non-nil diff buffers are initialized narrowed to each difference."
-  :type 'boolean
-  :group 'diff)
-
-(defcustom diff-load-hooks nil
-  "Hooks to run after loading diff.el"
-  :type 'hook
-  :group 'diff)
-
-;;; Internal variables
-
-(defconst diff-emacs-19-p
-  (let ((ver (string-to-int (substring emacs-version 0 2))))
-    (>= ver 19)))
-
-(or diff-emacs-19-p (require 'emacs-19))
-
-(defvar diff-old-file nil)
-;; A list whose car is the name of the old file, and whose cdr indicates
-;; whether we should delete the buffer on quit.
-(defvar diff-new-file nil)
-;; Same as diff-old-file, except for the new file.
-(defvar diff-total-differences "0")
-;; Total number of difference hunks as a string.
-(defvar diff-current-difference "0")
-;; Current difference hunk as a string.
-(defvar diff-current-hunk 0)
-;; Current difference hunk as an integer.
-(defvar diff-total-hunks 0)
-;; Total number of difference hunks as an integer.
-(defvar diff-hunk-vector (vector 0))
-;; Vector storing the starting positions of the difference hunks.
-(defvar diff-old-file-pattern nil)
-(defvar diff-new-file-pattern nil)
-(defvar diff-hunk-pattern nil)
-;; Regexps to use when parsing file lines in difference hunks.
-
-
-(defvar diff-search-pattern-alist
-  (list
-    (list ?e "^[0-9]\\(,[0-9]+\\)?[acd]$" "^\\([0-9]+\\)" nil)
-    (list ?c "^\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\n"
-	  "^\\*+ \\([0-9]+\\)" "^-+ \\([0-9]+\\)")
-    (list ?u "^@@ " "^@@ -\\([0-9]+\\)" "^@@ -[0-9,]+ \\+\\([0-9]+\\)")
-    (list nil "^[0-9]+" "^\\([0-9]+\\)" "^[0-9,]+[acd]\\([0-9]+\\)")))
-
-(defvar diff-keymap-grokked nil)
-
-(defvar diff-temp-template "/tmp/diff")
-
-;; Initialize the keymap if it isn't already
-
-(defvar diff-mode-map nil
-  "Keymap used in diff mode.")
-
-(if diff-mode-map
-    nil
-  (setq diff-mode-map (make-keymap))
-  (suppress-keymap diff-mode-map)
-  (define-key diff-mode-map "?" 'describe-mode)
-  (define-key diff-mode-map "." 'diff-display-file)
-  (define-key diff-mode-map "N" 'diff-narrow)
-  (define-key diff-mode-map "W" 'widen)
-  (define-key diff-mode-map "f" 'diff-find-file)
-  (define-key diff-mode-map "h" 'diff-show-header)
-  (define-key diff-mode-map "j" 'diff-show-difference)
-  (define-key diff-mode-map "n" 'diff-next-difference)
-  (define-key diff-mode-map "o" 'diff-find-file-other-window)
-  (define-key diff-mode-map "p" 'diff-previous-difference)
-  (define-key diff-mode-map "q" 'diff-quit)
-  (define-key diff-mode-map "w" 'diff-find-file-other-frame)
-  (define-key diff-mode-map "\C-c\C-c" 'diff-find-file-other-window)
-  (define-key diff-mode-map " " 'diff-advertised-scroll-up)
-  (define-key diff-mode-map 'backspace 'diff-advertised-scroll-down)
-  (define-key diff-mode-map 'delete 'diff-advertised-scroll-down)
-  (define-key diff-mode-map "\C-n" 'diff-next-line)
-  (define-key diff-mode-map "\C-p" 'diff-previous-line)
-  (define-key diff-mode-map "\M->" 'diff-end-of-buffer)
-  (define-key diff-mode-map "\M-<" 'diff-beginning-of-buffer))
-
-;;; Internal functions
-
-(defun diff-grok-keys (to-command from-command)
-  ;; Assigns to TO-COMMAND the keys for the global binding of FROM-COMMAND.
-  ;; Does not clobber anything in the local keymap.
-  (let ((keys (where-is-internal from-command)))
-    (while keys
-      (condition-case nil
-	  (if (eq (global-key-binding (car keys)) (key-binding (car keys)))
-	      (local-set-key (car keys) to-command))
-	(error nil))
-      (setq keys (cdr keys)))))
-
-(defun diff-grok-keymap ()
-  (if diff-keymap-grokked
-      ()
-    (if (and term-setup-hook (boundp 'command-line-args-left))
-	(progn
-	  (if diff-emacs-19-p
-	      (run-hooks term-setup-hook)
-	    (funcall term-setup-hook))
-	  (setq term-setup-hook nil)))
-    (setq diff-keymap-grokked t)
-    (diff-grok-keys 'diff-next-line 'next-line)
-    (diff-grok-keys 'diff-previous-line 'previous-line)
-    (diff-grok-keys 'diff-forward-char 'forward-char)
-    (diff-grok-keys 'diff-backward-char 'backward-char)
-    (diff-grok-keys 'diff-scroll-up 'scroll-up)
-    (diff-grok-keys 'diff-scroll-down 'scroll-down)
-    (diff-grok-keys 'diff-beginning-of-buffer 'beginning-of-buffer)
-    (diff-grok-keys 'diff-end-of-buffer 'end-of-buffer)))
-
-(defun diff-buffer-narrowed-p ()
-  ;; Returns t if the current buffer is narrowed
-  (save-restriction
-    (let ((min (point-min))
-	  (max (point-max)))
-      (widen)
-      (not (and (= min (point-min)) (= max (point-max)))))))
-
-(defun diff-current-hunk ()
-  ;; Returns the current diff hunk.
-  (let ((pt (point))
-	(start 0)
-	(end (1+ diff-total-hunks))
-	m)
-    (while (> (- end start) 1)
-      (setq m (/ (+ start end) 2))
-      (if (>= pt (aref diff-hunk-vector m))
-	  (setq start m)
-	(setq end m)))
-    (if (>= pt (aref diff-hunk-vector end))
-	(setq m end)
-      (setq m start))
-    ;; Don't treat end of buffer as start of next hunk
-    (if (eobp) (1- m) m)))
-
-(defun diff-hunk-min (n)
-  ;; Returns the start of the current diff hunk.
-  (aref diff-hunk-vector n))
-
-(defun diff-hunk-max (n)
-  ;; Returns the end of the current diff hunk.
-  (aref diff-hunk-vector (1+ n)))
-
-(defun diff-parse-hunks ()
-  ;; Parses a buffer of diff output.
-  (save-excursion
-    (save-restriction
-      (message "Parsing differences...")
-      (widen)
-      (goto-char (point-min))
-      (let ((hunks (list 1)))
-	(while (re-search-forward diff-hunk-pattern nil t)
-	  (setq hunks (cons (match-beginning 0) hunks)))
-	(setq diff-total-hunks (1- (length hunks))
-	      diff-hunk-vector (apply 'vector
-				      (nreverse (cons (point-max) hunks)))))))
-  (message "Parsing differences...done"))
-
-(defun diff-update-modeline ()
-  ;; Updates the mode line to show current diff hunk.
-  (if (or (< (point) (diff-hunk-min diff-current-hunk))
-	  (>= (point) (diff-hunk-max diff-current-hunk)))
-      (progn
-	(setq diff-current-hunk (diff-current-hunk)
-	      diff-current-difference (int-to-string diff-current-hunk))
-	(set-buffer-modified-p (buffer-modified-p)))))
-
-(defun diff-read-args (oldprompt newprompt switchprompt
-				 &optional file-for-backup)
-  ;; Grab the args for diff.  OLDPROMPT and NEWPROMPT are the prompts
-  ;; for the old & new filenames, SWITCHPROMPT for the list of
-  ;; switches.  If FILE_FOR_BACKUP is provided (it must be a string if
-  ;; so), then it will be used to try & work out a file & backup to
-  ;; diff, & in this case the prompting order is backwards.  %s in a
-  ;; prompt has a guess substituted into it.  This is nasty.
-  (let (oldf newf)
-    (if file-for-backup
-	(setq newf file-for-backup
-	      newf (if (and newf (file-exists-p newf))
-		       (read-file-name
-			(format newprompt (file-name-nondirectory newf))
-			nil newf t)
-		     (read-file-name (format newprompt "") nil nil t))
-	      oldf (file-newest-backup newf)
-	      oldf (if (and oldf (file-exists-p oldf))
-		       (read-file-name
-			(format oldprompt (file-name-nondirectory oldf))
-			nil oldf t)
-		     (read-file-name (format oldprompt "")
-				     (file-name-directory newf) nil t)))
-      ;; Else we aren't trying to be bright...
-      (setq oldf (read-file-name (format oldprompt "") nil nil t)
-	    newf (read-file-name
-		  (format newprompt (file-name-nondirectory oldf))
-		  nil (file-name-directory oldf) t)))
-	(list oldf newf (diff-read-switches switchprompt))))
-
-(defun diff-read-switches (switchprompt)
-  ;; Read and return a list of switches
-  (if current-prefix-arg
-      (let ((default (if (listp diff-switches)
-			 (mapconcat 'identity diff-switches " ")
-		       diff-switches)))
-	(diff-fix-switches
-	 (read-string (format switchprompt default) default)))))
-
-(defun diff-fix-switches (switch-spec)
-  ;; Parse a string into a list of switches or leave it be if it's
-  ;; not a string
-  (if (stringp switch-spec)
-      (let (result (start 0))
-	(while (string-match "\\(\\S-+\\)" switch-spec start)
-	  (setq result (cons (substring switch-spec (match-beginning 1)
-					(match-end 1))
-			     result)
-		start (match-end 0)))
-	(nreverse result))
-    switch-spec))
-
-(defun diff-get-file-buffer (file)
-  ;; Returns \(BUFFER . DEL-P\), where DEL-P is t if diff is expected
-  ;; to delete the buffer, and nil otherwise.
-  (let* ((buff (get-file-buffer file))
-	 (del-p (null buff)))
-    (if (and buff (buffer-modified-p buff))
-	(progn
-	  (message
-	   "Buffer %s is modified.  Diffing against buffer contents."
-	   (buffer-name buff))
-	  (sit-for 1)))
-    ;; Call find-file-noselect even if we already have the buffer,
-    ;; as it will run verify-buffer-file-modtime.
-    (cons (find-file-noselect file) del-p)))
-
-(defun diff-cleanup-buffers ()
-  ;; Cleans up diff buffers by deleting buffers that we don't expect
-  ;; the user to care about.
-  (let ((files (list diff-old-file diff-new-file)))
-    (while files
-      (let ((ent (car files))
-	    buff)
-	(and (cdr ent)
-	     (setq buff (get-file-buffer (car ent)))
-	     (not (buffer-modified-p buff))
-	     (kill-buffer buff)))
-      (setq files (cdr files)))
-    (if (get-buffer "*Diff Header*")
-	(kill-buffer "*Diff Header*"))))
-
-(defun diff-latest-backup-file (file)
-  "Return the latest existing backup of FILE, or nil."
-  ;; First try simple backup, then the highest numbered of the
-  ;; numbered backups.
-  ;; Ignore the value of version-control because we look for existing
-  ;; backups, which maybe were made earlier or by another user with
-  ;; a different value of version-control.
-  (let* ((file (expand-file-name file))
-	 (handler (find-file-name-handler file 'diff-latest-backup-file)))
-    (if handler
-	(funcall handler 'diff-latest-backup-file file)
-      (or
-       (let ((bak (make-backup-file-name file)))
-	 (if (file-exists-p bak) bak))
-       (let* ((dir (file-name-directory file))
-	      (base-versions (concat (file-name-nondirectory file) ".~"))
-	      (bv-length (length base-versions)))
-	 (concat dir
-		 (car (sort
-		       (file-name-all-completions base-versions dir)
-		       ;; bv-length is a fluid var for backup-extract-version:
-		       (function
-			(lambda (fn1 fn2)
-			  (> (backup-extract-version fn1)
-			     (backup-extract-version fn2))))))))))))
-
-(defun diff-file-line (&optional old-file-p)
-  "Return line number of current hunk in `diff-new-file'.
-With optional argument OLD-FILE-P, use `diff-old-file' instead."
-  (save-excursion
-    (let ((min (diff-hunk-min diff-current-hunk))
-	  (max (diff-hunk-max diff-current-hunk))
-	  (regexp (if old-file-p diff-old-file-pattern diff-new-file-pattern)))
-      (goto-char min)
-      (or (and regexp (re-search-forward regexp max t))
-	  (error "Unable to locate a file line for %s file."
-		 (if old-file-p "old" "new")))
-      (string-to-int (buffer-substring (match-beginning 1) (match-end 1))))))
-
-(defun diff-run-diff (switches old old-temp new new-temp)
-  ;; Actually run the diff process with SWITCHES on OLD and NEW.
-  ;; OLD-TEMP and NEW-TEMP are names of temp files that can be used
-  ;; to dump the data out to.
-  (insert "diff " (mapconcat 'identity switches " ") " " old
-	  " " new "\n")
-  (apply 'call-process "diff" nil t nil
-	 (append switches (list old-temp new-temp))))
-
-
-(defun diff-fix-file-names (old old-temp new new-temp pattern)
-  ;; Replaces any temp file names with the real names of files.
-  (save-excursion
-    (save-restriction
-      (let ((files (list old new))
-	    (temps (list old-temp new-temp))
-	    buffer-read-only case-fold-search)
-	(goto-char (point-min))
-	(if (re-search-forward pattern nil t)
-	    (narrow-to-region (point-min) (match-beginning 0)))
-	(while files
-	  (let ((regexp (concat "[ \t\n]\\("
-				(regexp-quote (car temps))
-				"\\)[ \t\n]")))
-	    (goto-char (point-min))
-	    (forward-line 1)
-	    (while (re-search-forward regexp nil t)
-	      (goto-char (match-beginning 1))
-	      (delete-region (point) (match-end 1))
-	      (insert (car files))))
-	  (setq files (cdr files)
-		temps (cdr temps)))))))
-
-;;;; User commands	 
-
-(defun diff-mode ()
-  "Diff Mode is used by \\[diff] for perusing the output from the diff program.
-All normal editing commands are turned off.  Instead, these are available:
-\\<diff-mode-map>
-\\[diff-advertised-scroll-up]	Scroll to next screen of this difference.
-\\[diff-advertised-scroll-down]	Scroll to previous screen of this difference.
-\\[diff-next-difference]	Move to Next Difference.
-\\[diff-previous-difference]	Move to Previous Difference.
-\\[diff-show-difference]	Jump to difference specified by numeric position.
-\\[diff-find-file]	Find current diff in file
-\\[diff-find-file-other-window]	Find current diff in file in other window
-\\[diff-display-file]	Display file in other window
-\\[diff-narrow]	Narrow diff buffer to current difference
-\\[widen]	Widen diff buffer
-\\[diff-show-header]	Show diff header describing file name etc.
-\\[diff-quit]	Quit diff
-"
-  (interactive)
-  (use-local-map diff-mode-map)
-  (diff-grok-keymap)
-  (setq buffer-read-only t
-	major-mode 'diff-mode
-	mode-name "Diff"
-	mode-line-modified "--- "
-	mode-line-process
-	'(" " diff-current-difference "/" diff-total-differences))
-  (diff-parse-hunks)
-  (setq diff-total-differences (int-to-string diff-total-hunks)))
-
-;;; Motion commands
-
-(defun diff-next-difference (n)
-  "In diff-mode go the the beginning of the next difference hunk."
-  (interactive "p")
-  (if (zerop n)
-      (goto-char (diff-hunk-min diff-current-hunk))
-    (let ((narrow (diff-buffer-narrowed-p))
-	  (max (point-max))
-	  (min (point-min)))
-      (unwind-protect
-	  (progn
-	    (widen)
-	    (setq diff-current-hunk (+ n diff-current-hunk))
-	    (cond ((> diff-current-hunk diff-total-hunks)
-		   (setq diff-current-hunk diff-total-hunks)
-		   (message "No following difference hunks."))
-		  ((< diff-current-hunk 0)
-		   (setq diff-current-hunk 0)
-		   (message "No preceding difference hunks.")))
-	    (setq diff-current-difference (int-to-string diff-current-hunk)
-		  min (goto-char (diff-hunk-min diff-current-hunk))
-		  max (diff-hunk-max diff-current-hunk)))
-	(if narrow (narrow-to-region min max))))
-    (set-buffer-modified-p (buffer-modified-p))))
-
-(defun diff-previous-difference (n)
-  "In diff-mode go the the beginning of the previous difference hunk."
-  (interactive "p")
-  (diff-next-difference (- n)))
-
-(defun diff-next-line (n)
-  "In diff-mode go to the next line."
-  (interactive "p")
-  (condition-case nil
-      (next-line n)
-    (error (if (> n 0) (message "End of difference hunk"))))
-  (diff-update-modeline))
-
-(defun diff-previous-line (n)
-  "In diff-mode go to the previous line."
-  (interactive "p")
-  (diff-next-line (- n)))
-
-(defun diff-forward-char (n)
-  "In diff-mode move the point forward."
-  (interactive "p")
-  (forward-char n)
-  (diff-update-modeline))
-
-(defun diff-backward-char (n)
-  "In diff-mode move the point backward."
-  (interactive "p")
-  (backward-char n)
-  (diff-update-modeline))
-
-(defun diff-scroll-up (n)
-  "In diff-mode scroll the buffer up."
-  (interactive "P")
-  (scroll-up n)
-  (diff-update-modeline))
-
-(fset 'diff-advertised-scroll-up 'diff-scroll-up)
-
-(defun diff-scroll-down (n)
-  "In diff-mode scroll the buffer down."
-  (interactive "P")
-  (scroll-down n)
-  (diff-update-modeline))
-
-(fset 'diff-advertised-scroll-down 'diff-scroll-down)
-
-(defun diff-beginning-of-buffer (n)
-  "In diff-mode go to the beginning of the buffer."
-  (interactive "P")
-  (setq zmacs-region-stays t)
-  (beginning-of-buffer n)
-  (diff-update-modeline))
-
-(defun diff-end-of-buffer (n)
-  "In diff-mode go to the end of the buffer."
-  (interactive "P")
-  (setq zmacs-region-stays t)
-  (end-of-buffer n)
-  (diff-update-modeline))
-
-;;; The main command.
-
-;;;###autoload
-(defun diff (old new &optional switches)
-  "Find and display the differences between OLD and NEW files.
-Interactively you are prompted with the current buffer's file name for NEW
-and what appears to be its backup for OLD."
-  ;; Support for diffing directories is rather limited.  It needs work.
-  (interactive (diff-read-args "Diff original file (%s) "
-			       "Diff new file (%s) "
-			       "Switches for diff (%s) "
-			       (buffer-file-name)))
-  (setq switches (diff-fix-switches (or switches diff-switches))
-	old (expand-file-name old)
-	new (expand-file-name new))
-  (let ((curr-buff (current-buffer))
-	doing-dirs old-temp new-temp old-buffer new-buffer flag)
-    (let ((fdp-old (file-directory-p old))
-	  (fdp-new (file-directory-p new)))
-      (cond
-       ((null (or fdp-new fdp-old)))
-       ((null fdp-new)
-	(setq old (expand-file-name (file-name-nondirectory new) old)))
-       ((null fdp-old)
-	(setq new (expand-file-name (file-name-nondirectory old) new)))
-       (t (setq doing-dirs t))))
-;;    (message "diff %s %s %s..."
-;;	     (mapconcat (function identity) switches " ") new old)
-    (message "diff %s %s %s..."
-	     (mapconcat (function identity) switches " ") old new)
-    (if doing-dirs
-	(setq diff-old-file nil
-	      diff-new-file nil)
-      (setq old-temp (make-temp-name (concat diff-temp-template "1"))
-	    new-temp (make-temp-name (concat diff-temp-template "2"))
-	    old-buffer (diff-get-file-buffer old)
-	    new-buffer (diff-get-file-buffer new)
-	    diff-old-file (cons old (cdr old-buffer))
-	    diff-new-file (cons new (cdr new-buffer))))
-    (let (case-fold-search)
-      (mapcar (function
-	       (lambda (x)
-		 (if (string-match "[ecu]" x)
-		     (setq flag (aref x (match-beginning 0))))))
-	      switches))
-    (unwind-protect
-	(let ((patterns (assq flag diff-search-pattern-alist)))
-	  (set-buffer (get-buffer-create "*Diff Output*"))
-	  (setq default-directory (file-name-directory new)
-		diff-old-file-pattern (nth 2 patterns)
-		diff-new-file-pattern (nth 3 patterns)
-		diff-hunk-pattern (nth 1 patterns))
-	  (let (buffer-read-only)
-	    (if (fboundp 'buffer-disable-undo)
-		(buffer-disable-undo (current-buffer))
-	      ;; old style (Emacs 18.55 and earlier)
-	      (buffer-disable-undo (current-buffer)))
-	    (widen)
-	    (erase-buffer)
-	    (if doing-dirs
-		(progn
-		  (diff-run-diff switches old old new new)
-		  (setq diff-hunk-pattern (concat diff-hunk-pattern
-						  "\\|^Only in ")))
-	      (save-excursion
-		(set-buffer (car old-buffer))
-		(write-region (point-min) (point-max) old-temp nil 'quiet)
-		(set-buffer (car new-buffer))
-		(write-region (point-min) (point-max) new-temp nil 'quiet))
-	      (diff-run-diff switches old old-temp new new-temp))
-	    ;; Need to replace file names
-	    (if (and (not doing-dirs) (memq flag '(?c ?u)))
-		(diff-fix-file-names old old-temp new new-temp
-				     diff-hunk-pattern))
-	    (diff-mode)
-	    (goto-char (point-min))
-	    (setq diff-current-difference "0"
-		  diff-current-hunk 0)
-	    (if (zerop diff-total-hunks)
-		(progn
-		  (diff-cleanup-buffers)
-		  (message "No differences"))
-	      (if diff-do-narrow (narrow-to-region (point) (diff-hunk-max 0)))
-	      (display-buffer (current-buffer))
-	      (message "%s difference hunk%s" diff-total-differences
-		       (if (= diff-total-hunks 1) "" "s")))))
-      (condition-case nil
-	  (delete-file old-temp)
-	(error nil))
-      (condition-case nil
-	  (delete-file new-temp)
-	(error nil))
-      (set-buffer curr-buff))))
-
-;;;###autoload
-(defun diff-backup (file &optional switches)
-  "Diff this file with its backup file or vice versa.
-Uses the latest backup, if there are several numerical backups.
-If this file is a backup, diff it with its original.
-The backup file is the first file given to `diff'."
-  (interactive (list (read-file-name "Diff (file with backup): ")
-		     (and current-prefix-arg
-			  (diff-read-switches "Diff switches: "))))
-  (let (bak ori)
-    (if (backup-file-name-p file)
-	(setq bak file
-	      ori (file-name-sans-versions file))
-      (setq bak (or (diff-latest-backup-file file)
-		    (error "No backup found for %s" file))
-	    ori file))
-    (diff bak ori switches)))
-
-(defun diff-show-difference (n)
-  "Show difference number N (prefix argument)."
-  (interactive "p")
-  (let ((narrowedp (diff-buffer-narrowed-p))
-	(min (diff-hunk-min diff-current-hunk))
-	(max (diff-hunk-max diff-current-hunk)))
-    (unwind-protect
-	(progn
-	  (widen)
-	  (cond
-	   ((< n 0)
-	    (message "No negative hunks.")
-	    (setq n 0))
-	   ((> n diff-total-hunks)
-	    (message "No hunk %d." n)
-	    (setq n diff-total-hunks)))
-	  (setq diff-current-hunk n
-		diff-current-difference (int-to-string diff-current-hunk)
-		min (diff-hunk-min n)
-		max (diff-hunk-max n))
-	  (goto-char min))
-      (if narrowedp (narrow-to-region min max))
-      (set-buffer-modified-p (buffer-modified-p)))))
-
-(defun diff-show-header ()
-  "Show `diff-header'."
-  (interactive)
-  (with-output-to-temp-buffer "*Diff Header*"
-    (princ (save-restriction
-	     (widen)
-	     (buffer-substring (diff-hunk-min 0) (diff-hunk-max 0))))))
-
-
-(defun diff-find-file (old-file-p)
-  "Visit diffed file, at the point corresponding to the current hunk.
-Default is to visit the new file; prefix means visit old file instead."
-  (interactive "P")
-  (let ((line (diff-file-line old-file-p)))
-    (find-file 
-     (if old-file-p
-	 (car diff-old-file)
-       (car diff-new-file)))
-    (goto-line line)
-    (recenter 0)))
-
-(defun diff-find-file-other-window (old-file-p)
-  "Visit the diffed file in other window, with the point at the current hunk.
-Default is to visit the new file; prefix means visit the old file instead."
-  (interactive "P")
-  (let ((line (diff-file-line old-file-p)))
-    (find-file-other-window
-     (if old-file-p
-	 (car diff-old-file)
-       (car diff-new-file)))
-    (goto-line line)
-    (recenter 0)))
-
-(defun diff-find-file-other-frame (old-file-p)
-  "Visit the diffed file in other frame, with point at the current hunk.
-Default is to visit the new file; prefix means visit the old file instead."
-  (interactive "P")
-  (let ((line (diff-file-line old-file-p)))
-    (find-file-other-frame
-     (if old-file-p
-	 (car diff-old-file)
-       (car diff-new-file)))
-    (goto-line line)
-    (recenter 0)))
-
-(defun diff-display-file (old-file-p)
-  "Display the diffed file in other window, with point at the current hunk.
-Default is to visit the new file; prefix means visit the old file instead."
-  (interactive "P")
-  (let ((line (diff-file-line old-file-p))
-	(wind (display-buffer (find-file-noselect (if old-file-p
-						      (car diff-old-file)
-						    (car diff-new-file)))))
-	(curr-wind (selected-window)))
-    (unwind-protect
-	(progn
-	  (select-window wind)
-	  (goto-line line)
-	  (recenter 0))
-      (select-window curr-wind))))
-
-(defun diff-quit ()
-  "Quit diff by killing the diff buffer."
-  (interactive)
-  (kill-buffer "*Diff Output*")
-  (diff-cleanup-buffers))
-
-(defun diff-narrow ()
-  "Narrow diff buffer to current difference hunk."
-  (interactive)
-  (narrow-to-region (diff-hunk-min diff-current-hunk)
-		    (diff-hunk-max diff-current-hunk)))
-
-;;; Run any load hooks
-(run-hooks 'diff-load-hook)
-
-;;; end of diff.el

dired-cmpr.el

-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; File:          dired-cmpr.el
-;; Dired Version: #Revision: 7.9 $
-;; RCS:
-;; Description:   Commands for compressing marked files.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;; Requirements and provisions
-(provide 'dired-cmpr)
-(require 'dired)
-
-;;; Entry points.
-
-(defun dired-do-compress (&optional arg files)
-  "Compress or uncompress marked (or next ARG) files.
-With a zero prefix, prompts for a new value of `dired-compression-method'."
-  (interactive
-   (let ((arg (prefix-numeric-value current-prefix-arg))
-	 files)
-     (if (zerop arg)
-	 (let ((new (completing-read
-		     (format "Set compression method (currently %s): "
-			     dired-compression-method)
-		     (mapcar
-		      (function
-		       (lambda (x)
-			 (cons (symbol-name (car x)) nil)))
-		      dired-compression-method-alist)
-		     nil t)))
-	   (or (string-equal new "")
-	       (setq dired-compression-method (intern new))))
-       (setq files (dired-get-marked-files nil current-prefix-arg))
-       (or (memq 'compress dired-no-confirm)
-	   (let* ((dir (dired-current-directory))
-		  (rfiles (mapcar (function
-				   (lambda (fn)
-				     (dired-make-relative fn dir t)))
-				    files))
-		  (prompt "")
-		  (comp 0)
-		  (uncomp nil)
-		  (total (length files))
-		  elt)
-	     (mapcar (function
-		      (lambda (fn)
-			(if (listp (setq elt
-					 (dired-make-compressed-filename fn)))
-			    (let* ((method (car (nth 3 elt)))
-				   (count (assoc method uncomp)))
-			      (if count
-				  (setcdr count (1+ (cdr count)))
-				(setq uncomp (cons (cons method 1) uncomp))))
-			  (setq comp (1+ comp)))))
-		     files)
-	     (if (/= comp 0)
-		 (setq prompt
-		       (format "%s %d"
-			       (car
-				(nth 2
-				     (assq dired-compression-method
-					   dired-compression-method-alist)))
-			       comp)))
-	     (if uncomp
-		 (let ((case-fold-search t)
-		       method)
-		   (or (string-equal prompt "")
-		       (setq prompt (concat prompt "; ")))
-		   (setq uncomp
-			 (sort
-			  (mapcar
-			   (function
-			    (lambda (elt)
-			      (setq method (car elt))
-			      (if (string-equal method "gzip")
-				  (setq method "gunzip")
-				(or (string-match "^un" method)
-				    (setq method (concat "un" method))))
-			      (setcar elt method)
-			      elt))
-			   uncomp)
-			  (function
-			   (lambda (x y)
-			     (string< (car x) (car y))))))
-		   (setq prompt
-			 (concat prompt
-				 (mapconcat
-				  (function
-				   (lambda (elt)
-				     (format "%s %d" (car elt) (cdr elt))))
-				  uncomp ", ")))))
-	     (cond
-	      ((= (length rfiles) 1)
-	       (setq prompt (format "%s %s? "
-				    ;; Don't need the number 1
-				    (substring prompt 0 -2)
-				    (car rfiles))))
-	      ((or (> (length uncomp) 1) (and (/= 0 comp) uncomp))
-	       (setq prompt (format "%s? Total: %d file%s " prompt total
-				    (dired-plural-s total))))
-	      ((setq prompt (format "%s file%s? " prompt
-				    (dired-plural-s total)))))
-	     (or (dired-mark-pop-up nil 'compress rfiles 'y-or-n-p prompt)
-		 (setq arg 0)))))
-     (list arg files)))
-       
-  (if (not (zerop arg))
-      (dired-create-files
-       'dired-compress-file
-       "Compress or Uncompress"
-       files
-       (function
-	(lambda (fn)
-	  (let ((cfn (dired-make-compressed-filename fn)))
-	    (if (stringp cfn)
-		cfn
-	      (substring fn 0 (- (length (nth 1 cfn))))))))
-       dired-keep-marker-compress nil t)))
-
-(defun dired-compress-subdir-files (&optional uncompress)
-  "Compress all uncompressed files in the current subdirectory.
-With a prefix argument uncompresses all compressed files."
-  (interactive "P")
-  (let ((dir (dired-current-directory))
-	files methods uncomp elt)
-    (save-excursion
-      (save-restriction
-	(narrow-to-region (dired-subdir-min) (dired-subdir-max))
-	(dired-map-dired-file-lines
-	 (function
-	  (lambda (f)
-	    (if uncompress
-		(and (listp (setq uncomp (dired-make-compressed-filename f)))
-		     (let ((program (car (nth 3 uncomp))))
-		       (setq files (cons f files))
-		       (if (setq elt (assoc program methods))
-			   (setcdr elt (1+ (cdr elt)))
-			 (setq methods (cons (cons program 1) methods)))))
-	      (and (stringp (dired-make-compressed-filename f))
-		   (setq files (cons f files)))))))))
-    (if files
-	(let ((total (length files))
-	      (rfiles (mapcar
-		       (function
-			(lambda (fn)
-			  (dired-make-relative fn dir t)))
-		       files))
-	      prompt)
-	  (if uncompress
-	      (progn
-		(setq prompt (mapconcat
-			      (function
-			       (lambda (x)
-				 (format "%s %d"
-					 (if (string-equal (car x) "gzip")
-					     "gunzip"
-					   (if (string-match "^un" (car x))
-					       (car x)
-					     (concat "un" (car x))))
-					 (cdr x))))
-			      methods ", "))
-		(cond
-		 ((= total 1)
-		  (setq prompt
-			(concat (substring prompt 0 -1) (car rfiles) "? ")))
-		 ((= (length methods) 1)
-		  (setq prompt
-			(format "%s file%s? " prompt (dired-plural-s total))))
-		 (t
-		  (setq prompt (format "%s? Total: %d file%s " prompt total
-				       (dired-plural-s total))))))
-	    (setq prompt
-		  (if (= total 1)
-		      (format "%s %s? " dired-compression-method (car rfiles))
-		    (format "%s %d file%s? "
-			    dired-compression-method total
-			    (dired-plural-s total)))))
-	  (if (dired-mark-pop-up nil 'compress rfiles 'y-or-n-p prompt)
-	      (dired-create-files
-	       'dired-compress-file
-	       "Compress or Uncompress"
-	       files
-	       (function
-		(lambda (fn)
-		  (let ((cfn (dired-make-compressed-filename fn)))
-		    (if (stringp cfn)
-			cfn
-		      (substring fn 0 (- (length (nth 1 cfn))))))))
-	       dired-keep-marker-compress nil t)))
-      (message "No files need %scompressing in %s."
-	       (if uncompress "un" "")
-	       (dired-abbreviate-file-name dir)))))
-
-(defun dired-compress-file (file ok-flag)
-  ;; Compress or uncompress FILE.
-  ;; If ok-flag is non-nil, it is OK to overwrite an existing
-  ;; file. How well this actually works may depend on the compression
-  ;; program.
-  ;; Return the name of the compressed or uncompressed file.
-  (let ((handler (find-file-name-handler file 'dired-compress-file)))
-    (if handler
-	(funcall handler 'dired-compress-file file ok-flag)
-      (let ((compressed-fn (dired-make-compressed-filename file))
-	    (err-buff (get-buffer-create " *dired-check-process output*")))
-	(save-excursion
-	  (set-buffer err-buff)
-	  (erase-buffer)
-	  (cond ((file-symlink-p file)
-		 (signal 'file-error (list "Error compressing file"
-					   file "a symbolic link")))
-		((listp compressed-fn)
-		 (message "Uncompressing %s..." file)
-		 (let* ((data (nth 3 compressed-fn))
-			(ret
-			 (apply 'call-process
-				(car data) file t nil
-				(append (cdr data)
-					(and ok-flag
-					     (list (nth 4 compressed-fn)))
-					(list file)))))
-		   (if (or (and (integerp ret) (/= ret 0))
-			   (not (bobp)))
-		       (signal 'file-error
-			       (nconc
-				(list "Error uncompressing file"
-				      file)
-				(and (not (bobp))
-				     (list
-				      (progn
-					(goto-char (point-min))
-					(buffer-substring
-					 (point) (progn (end-of-line)
-							(point))))))))))
-		 (message "Uncompressing %s...done" file)
-		 (dired-remove-file file)
-		 (let ((to (substring file 0
-				      (- (length (nth 1 compressed-fn))))))
-		   ;; rename any buffers
-		   (and (get-file-buffer file)
-			(save-excursion
-			  (set-buffer (get-file-buffer file))
-			  (let ((modflag (buffer-modified-p)))
-			    ;; kills write-file-hooks
-			    (set-visited-file-name to)	
-			    (set-buffer-modified-p modflag))))
-		   to))
-		((stringp compressed-fn)
-		 (message "Compressing %s..." file)
-		 (let* ((data (assq dired-compression-method
-				    dired-compression-method-alist))
-			(compr-args (nth 2 data))
-			(ret
-			 (apply 'call-process
-				(car compr-args) file t nil
-				(append (cdr compr-args)
-					(and ok-flag
-					     (list (nth 4 data)))