problems with lemacs 19.10 -- possible solution.

Andy Norman (ange@hplb.hpl.hp.com)
Thu, 16 Jun 1994 18:46:40 +0100


Gentle reader,

If you are having infinite recursion problems with Lucid Emacs 19.10 and efs,
it is possible that the following patches posted to alt.lucid-emacs.bugs may
be of help.

There are other problems (mainly due to abbreviate-file-name) with 19.10 which
are being fixed for efs 1.9.

					-- ange -- <><

#---------------------------------- cut here ----------------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Andy Norman <ange@flobalob> on Thu Jun 16 18:44:41 1994
#
# This archive contains:
#	hamish.1	hamish.2	
#
# Error checking via wc(1) will be performed.

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH

echo x - hamish.1
sed 's/^@//' >hamish.1 <<'@EOF'
@From: Hamish.Macdonald@bnr.ca (Hamish Macdonald)
Subject: bug in Lucid Emacs 19.10 regarding find-file-name-handler

A misplaced parenthesis in the find-file-name-handler function in
fileio.c results in filenames *always* matching a string in the
file-name-handler-alist.

This breaks efs-1.6.

Patch to fix this problem follows:

*** src/fileio.c~	Sun May 15 03:05:30 1994
--- src/fileio.c	Tue May 31 11:50:08 1994
***************
*** 261,267 ****
  	  if (STRINGP (string)
  	      && fast_string_match (string,
                                      (char *) XSTRING (filename)->data,
!                                     string_length (XSTRING (filename)) >= 0))
  	    {
  	      Lisp_Object handler = XCONS (elt)->cdr;
  	      if (NILP (Fmemq (handler, inhibited_handlers)))
--- 261,267 ----
  	  if (STRINGP (string)
  	      && fast_string_match (string,
                                      (char *) XSTRING (filename)->data,
!                                     string_length (XSTRING (filename))) >= 0)
  	    {
  	      Lisp_Object handler = XCONS (elt)->cdr;
  	      if (NILP (Fmemq (handler, inhibited_handlers)))
-------------------------------------------------------------------------------
@EOF
set `wc -lwc <hamish.1`
if test $1$2$3 != 311161212
then
	echo ERROR: wc results of hamish.1 are $* should be 31 116 1212
fi

chmod 640 hamish.1

echo x - hamish.2
sed 's/^@//' >hamish.2 <<'@EOF'
@From: Hamish.Macdonald@bnr.ca (Hamish Macdonald)
Subject: another bug in fileio.c in Lucid Emacs 19.10

The function insert-file-contents changes one of its arguments before
it offers the job to the file-name-handler-alist.  If the function
from the file-name-handler-alist later calls insert-file-contents with
the arguments it was provided, the error "Attempt to visit less than
an entire file" is generated, since beg is non-nil and visit is
non-nil (assuming that visit was non-nil when insert-file-contents was
originally called).

This problem occurs with efs-1.6 which has been modified to *not*
supply its own version of insert-file-contents, but to use the
file-name-handler-alist for this function, since Lucid Emacs 19.10
supports the file-name-handler-alist for insert-file-contents.

The following patch fixes the problem with efs.  I'm not sure if there
are any other ramifications.  What the patch does is move the argument
checking to after file-name-handler-alist has been consulted (and any
appropriate function called).

*** fileio.c~	Fri Jun  3 11:05:24 1994
--- fileio.c	Fri Jun  3 11:24:07 1994
***************
*** 2532,2549 ****
  
    val = Qnil;
  
-   if (!NILP (beg) || !NILP (end))
-     if (!NILP (visit))
-       error (GETTEXT ("Attempt to visit less than an entire file"));
- 
-   if (!NILP (beg))
-     CHECK_FIXNUM (beg, 0);
-   else
-     beg = Qzero;
- 
-   if (!NILP (end))
-     CHECK_FIXNUM (end, 0);
- 
    GCPRO2 (filename, visit);
    if (!NILP (current_buffer->read_only))
      Fbarf_if_buffer_read_only ();
--- 2532,2537 ----
***************
*** 2559,2564 ****
--- 2547,2564 ----
                     visit, beg, end, replace);
        goto handled;
      }
+ 
+   if (!NILP (beg) || !NILP (end))
+     if (!NILP (visit))
+       error (GETTEXT ("Attempt to visit less than an entire file"));
+ 
+   if (!NILP (beg))
+     CHECK_FIXNUM (beg, 0);
+   else
+     beg = Qzero;
+ 
+   if (!NILP (end))
+     CHECK_FIXNUM (end, 0);
  
    fd = -1;
  
-------------------------------------------------------------------------------
@EOF
set `wc -lwc <hamish.2`
if test $1$2$3 != 662892071
then
	echo ERROR: wc results of hamish.2 are $* should be 66 289 2071
fi

chmod 640 hamish.2

exit 0