[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Meaning of "Changed Definitions" in release 8



    Date: Mon, 27 Aug 90 10:31 EDT
    From: WJL@ZERMATT.lcs.mit.edu (Bill Long)
    Subject: Meaning of "Changed Definitions" in release 8

	    I just noticed that "Add Patch Changed Definitions" seems to
    have different behavior in release 8 than it did in release 7.  It used
    to be that adding a function to the patch file was the only thing that
    cleared it from the changed list, saving buffers had no effect.  Over
    the past few days I changed many functions in a system, used "Write
    Buffer" (our file server was down for two days) and finally "Save File
    Buffers".  When I went to "Add Patch Changed Definitions", there weren't
    any.

Release 8.0 introduced a change in the default behavior of M-X List
Changed Definitions of Buffer and friends (i.e., Compiled Changed Definitions,
Evaluate Changed Definitions, Edit Changed Definitions).  These commands take
optional numeric arguments.  In release 7.2, the arguments were
interpreted as:

  Arg = 1 means definitions changed since the file was last read (default).
  Arg = 2 means definitions changed since the file was last saved.
  Arg = 3 means definitions changed since the definition was last compiled.

However, in 8.0, the meanings are 1 and 2 were reversed, so the default
behavior changed only to consider changed definitions since the file was saved.

For M-X List Changed Definitions, you can recover the old default
behavior by specifying a numeric argument of 2.  If you want this
permanently, you might apply advice, as

  (si:advise-permanently Zwei:EDIT-CHANGED-DEFINITIONS-INTERNAL :around
			 restore-old-default-behavior nil
    (let-if (not zwei:*numeric-arg-p*)
	    ((zwei:*numeric-arg* 2))
      :do-it))


M-X Add Patch Changed Definitions (of Buffer) was also carefully
changed only to consider changes since the file was saved.  This command
doesn't take an argument, or offer any other way to restore the old behavior.

Given the hard-coded change in Zwei:Add-Patch-Buffer-Changed-Definitions,
you can restore the old code.  The local variable READ-TICK used to be
bound to the read-tick of the buffer; now it's bound to the save-tick!
Another way is to alter the behavior of :SAVE-TICK inside of this
command, so that it considers all sections changed since the buffer
was read in (i.e., since its read-tick.  Here's a way to do that:

  (defvar *Inside-Add-Patch-Changed-Definitions* nil
    "Flag to make :Save-Tick look like :Read-Tick when
     inside of M-X Add Patch Changed Definitions")

  (si:advise-permanently zwei:ADD-PATCH-BUFFER-CHANGED-DEFINITIONS :around
			 restore-old-default-behavior nil
    (let ((*inside-add-patch-changed-definitions* t))
      :do-it))

  (defmethod (:Save-Tick Zwei:File-Buffer) ()
    (if *inside-add-patch-changed-definitions*
	(send self :read-tick)
	zwei:save-tick)) 

	    I checked the documentation and it seems to be unchanged (except
    for the Ignore option, which I applaud), but the definition of changed
    definitions is never really spelled out.  What is the behavior of these
    functions supposed to be?  Also, do the bugs with meta-shift-C also
    extend to these functions?

Show Documentation for Add Patches Changed Definitions of Buffer says:

   A definition needs to be patched if it has been changed since it was
   last patched or if it has not been patched since the file was read into
   the buffer.

The new version of this command only patches definitions since the file
was last saved, and so does not conform to the documentation.

-- Rich
-------