Re: [19.25, efs 1.9] dired-handler-fn

sandy@ibm550.sissa.it
Wed, 20 Jul 1994 16:13:21 +0200


>>>>> On Wed, 20 Jul 94 03:26:17 -0400,
      rms@gnu.ai.mit.edu (Richard Stallman) said:

 > This could be a good idea, but I think the right way to implement
 > automatic-updating Dired is with a separate feature.

Sure it could be done with a separate feature.  I'd be happy with any
way of doing it.  But note that any way of doing this must catch _all_
writes to disk.  That includes autosaving, backups, changing a file's
modes, etc.  Simply hanging something on write-region is not good
enough.  Furthermore, it must be possible to add this feature to lisp
functions at will, as with the file-name-handler-alist one can now
just add a call to find-file-name-handler.  This is because lisp
functions which call processes may write files.  There needs to be
some way of having such functions tell dired that they are doing so.

The mandate of the file-name-handler-alist is that it should catch
all I/O operations.  That's close to (well twice) dired's requirement.
I think that the easiest would be to simply allow predicates to be
tested in the file-name-handler-alist.  The car's of elements in this
alist could be either lambda's or strings.  If a string they would be
tested as a regexp, as now.  If a lambda, they would be called with
two args, FILENAME and OPERATION.  Then dired's predicate would simply
be (memq OPERATION '(write-region ...)).

I suspect that introducing a separate feature to handle all O (in I/O)
functions would be saddling yourself with more work than is necessary
to solve the problem. 

--sandy