Re: re:well, efs kills lemacs-19.10..
sandy@ibm550.sissa.it
Wed, 29 Jun 1994 17:33:29 +0200
>>>>> On Wed, 29 Jun 1994 09:32:00 -0400 ,
"jeff (j.d.) sparkes" <jsparkes@bnr.ca> said:
> In message "well, efs kills lemacs-19.10..",
> 'mly@adoc.xerox.com' writes:
>> The file-handler-alist code has worried me for some time because
>> some very low level function are now running Lisp code. I have a
>> nagging, wholly unsubstantiated feeling that some variable isn't
>> being GCPRO'd before one of these functions is called. It's one
>> place to start looking anyway.
In my experience, the file-name-handler-alist stuff works better than
the only alternative that I know of -- overloading functions. I think
that it could be better, if the file-name-handler-alist supported
predicates, instead of just regexps as its keys. As things stand now,
handlers are frequently called when they actually have nothing to do
for the operation. i.e. the regexp may match the sort of file names
that the handler is looking for, but the operation may not be one that
is handled by this handler. The way that this works now, is that the
handler is supposed to inhibit itself, and then re-call the original
operation. It is important that it inhibit only itself, as other
handlers may be interested in the operation.
It seems that in Lucid Emacs, there are problems with GCPRO and file
name handlers. I think that this is the cause of the spurious "file
has changed on disk" warnings. Mark Borges has managed to get the
following traceback (it was a bit of work, as he kept getting bus
errors).
* write-region(1 54 "/cray2/mdb/tmp/efs-test" nil -16778017)
* apply(write-region (1 54 "/cray2/mdb/tmp/efs-test" nil -16778017))
* dired-handler-fn(write-region 1 54 "/cray2/mdb/tmp/efs-test" nil -16778017)
* write-region(1 54 "/cray2/mdb/tmp/efs-test" nil t)
Note that when write-region was originally called, it had VISIT = t.
The dired-handler-fn then gets called (to update any dired-buffers,
that a file is being written to disk). The handler function than
recalls write-region with the _same_ args. The re-call is wrapped in
prog1, with the trailing forms being to update the dired buffers.
Note that in the recall, VISIT is now -16778017. Because this is
neither a string, nor t, the visited-file-modtime will not get
updated. Hence, the spurious "file has changed on disk" warning. It
seems that write-region is losing the VISIT arg when it calls a file
name handler. This is probably due to GC lossage. Also, Mark tells
me that the patches that Jeff just posted don't fix this. I guess
that more scouring of filesio.c is needed. Unfortunately, I'm not
going to be able to do this.
--sandy