Skip to content

Commit 293c973

Browse files
committed
EDITINTERFACE: bug fix in date-comment recognition, improvements to dated change-note behavior
1 parent fe62e8e commit 293c973

File tree

2 files changed

+57
-56
lines changed

2 files changed

+57
-56
lines changed

sources/EDITINTERFACE

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

3-
(FILECREATED " 8-Dec-2021 18:25:33" 
4-
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;29 47473
3+
(FILECREATED "19-Jan-2022 23:09:02" 
4+
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;34 47559
55

6-
:CHANGES-TO (FNS EDITDATE? EDITDATE)
6+
:CHANGES-TO (FNS FIXEDITDATE EDITDATE?)
77

8-
:PREVIOUS-DATE " 8-Dec-2021 16:11:23"
9-
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;27)
8+
:PREVIOUS-DATE "19-Jan-2022 10:22:03"
9+
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;31)
1010

1111

1212
(* ; "
@@ -109,7 +109,7 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
109109
(DEFGLOBALVAR XCL::ED-LAST-INFO NIL
110110
"used in ED to stash last call info so (ED NIL) will restart last edit")
111111

112-
(CL:DEFUN ED (CL::NAME CL::OPTIONS) (* ; "Edited 5-Jul-88 16:03 by woz")
112+
(CL:DEFUN ED (CL::NAME CL::OPTIONS) (* ; "Edited 5-Jul-88 16:03 by woz")
113113

114114
(* ;;; "Standard Common Lisp editor entry. CLtL say's ED does something reasonable when passed a pathname. We coerce name into something that might be the name of something with an IL:FILES definition, & try to edit that. Then save call info in ED-LAST-INFO, so (ED) will start last edit over again.")
115115

@@ -627,13 +627,11 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
627627
OLDATE INITLS])
628628

629629
(FIXEDITDATE
630-
[LAMBDA (EXPR)
630+
[LAMBDA (EXPR) (* ; "Edited 19-Jan-2022 23:08 by rmk")
631631

632632
(* ;; "Edited 8-Dec-2021 16:11 by rmk: Updated to add dates to the initial undated comments that begins with current-editor initials, to provide a kind of dated change-log capability.")
633-
(* ; "Edited 3-Dec-2021 15:03 by rmk")
634-
(* ; "Edited 22-Oct-2021 16:58 by rmk:")
635-
(* ; "Edited 27-Sep-2018 22:04 by rmk:")
636-
(* ; "Edited 31-Mar-2000 17:13 by rmk:")
633+
 (* ; "Edited 27-Sep-2018 22:04 by rmk:")
634+
(* ; "Edited 31-Mar-2000 17:13 by rmk:")
637635
(* ; "Edited 17-Jul-89 11:13 by jtm:")
638636
(* ; "18-JUL-78 21:11")
639637

@@ -722,56 +720,57 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
722720
ELSEIF (SETQ PARSE (EDITDATE? (CAR E)
723721
T))
724722
THEN
725-
(* ;; "Attach the new timestamp at the beginning of E, provided the new date is either more than a day later than the previous one or by a different editor.")
723+
(* ;; "If edited by the same editor within a day, then update the previous timestamp rather than cluttering with a new one. Presumably this is the next event in the same longer editing session, and it avoids stacking up uninformative dates from in-and-out editing during a session. ")
726724

727-
(* ;; "If edited by the same editor within a day, then update the previous timestamp rather than just leaving the original time. Presumably this is the next event in the same longer editing session, and it avoids stacking up uninformative dates from in-and-out editing during a session. ")
728-
729-
(IF (STRING.EQUAL INITLS (CADR PARSE))
725+
(IF [AND (STRING.EQUAL INITLS (CADR PARSE))
726+
(ILEQ (IDIFFERENCE (IDATE)
727+
(IDATE (CAR PARSE)))
728+
(CONSTANT (TIMES 24 3600]
730729
THEN
731730

732-
(* ;; "Another edit by the same author. If not dated but contains a rest, then upgrade the rest comment with a date Otherwise,If more than a day later, add a new date. If less than a day, assume we are in essentially the same session, and update (CAR E) to the current time.")
733-
734-
[IF (NULL (CAR PARSE))
735-
THEN
736-
(* ;; "If no date but %"INITIALS: xxx%", we definitely want to upgraded to the Edited... initials: xxx format")
731+
(* ;; "Same edit session with the same author: update the last previous timestamp. If the (CAR PARSE) is NIL, we are looking at an initialed comment that becomes a timestamp, and we convert it. If just after this we see another timestamp for the same session, we take that out.")
737732

738-
(/RPLACA E (EDITDATE (CAR E)
739-
INITLS
740-
(CADDR PARSE)))
741-
ELSEIF (IGREATERP (IDIFFERENCE (IDATE)
733+
(/RPLACA E (EDITDATE (CAR E)
734+
INITLS
735+
(CADDR PARSE)))
736+
(CL:WHEN [AND (SETQ PARSE (EDITDATE? (CADR E)
737+
T))
738+
(NULL (CADDR PARSE))
739+
(STRING.EQUAL INITLS (CADR PARSE))
740+
(ILEQ (IDIFFERENCE (IDATE)
742741
(IDATE (CAR PARSE)))
743-
(TIMES 24 3600))
744-
THEN
745-
(* ;;
746-
 "If we aren't upgrading, then we don't want to propagate the previous REST.")
747-
748-
(/ATTACH (EDITDATE NIL INITLS)
749-
E)
750-
ELSE
751-
(* ;;
752-
 "Same author, within a day. Just change the date, keep the REST.")
753-
754-
(/RPLACA E (EDITDATE (CAR E)
755-
INITLS
756-
(CADDR PARSE]
742+
(CONSTANT (TIMES 24 3600]
743+
(/RPLACD E (CDDR E)))
757744
ELSE
745+
(* ;;
746+
 "Different edit sequence, attach a new timestamp in front of any old ones.")
758747

759-
(* ;; "Not a previous date, or not one with this author. Add a new one. If rmk is editing and sees an lmm: rest, we don't want to attribute that rest to rmk in the new one.")
748+
(/ATTACH (EDITDATE NIL INITLS (CADDR PARSE))
749+
E))
760750

761-
(/ATTACH (EDITDATE NIL INITLS)
762-
E))
751+
(* ;; "If the new date has an upgraded comment-level, update all of the previous dates so that they align on the left instead of the right.")
752+
753+
(CL:UNLESS (EQ (CADR (CAR E))
754+
';)
755+
(FOR PREV (NEWTYPE _ (CADR (CAR E))) IN (CDR E)
756+
WHILE (EDITDATE? PREV T) UNTIL (EQ (CADR PREV)
757+
NEWTYPE)
758+
DO (/RPLACA (CDR PREV)
759+
NEWTYPE)))
763760
ELSE
764-
(* ;; "Need a new date, didn't even see %"<initials: xxx%"")
761+
(* ;;
762+
 "First edit: we didn't see an old date to compare with or smash, not even an initials: xxx form.")
765763

766764
(/ATTACH (EDITDATE NIL INITLS)
767765
E)))
768766
(RETURN EXPR)))])
769767

770768
(EDITDATE?
771-
[LAMBDA (COMMENT RESTOK) (* ; "Edited 8-Dec-2021 18:24 by rmk")
769+
[LAMBDA (COMMENT RESTOK) (* ; "Edited 19-Jan-2022 22:49 by rmk")
770+
(* ; "Edited 8-Dec-2021 18:24 by rmk")
772771

773772
(* ;; "Edited 6-Dec-2021 16:04 by rmk: Return will have date/initial, initial/rest, or date/initial/rest. Always an initial and something, or NIL.")
774-
(* ; "Edited 4-Dec-2021 10:39 by rmk")
773+
 (* ; "Edited 4-Dec-2021 10:39 by rmk")
775774

776775
(* ;;; "This determines whether this is a dated or initialed comment that is potentially reusable in the current context. Unless RESTOK, this only recognizes modern-format configurations of the form %"Edited <date> by <initials>%", and returns a parsed pair (DATE INITIALS).")
777776

@@ -818,12 +817,14 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
818817
(CL:WHEN (SETQ REST (SUBSTRING STRING (ADD1 IENDPOS)))
819818
(SETQ REST (CL:STRING-TRIM `(#\Space)
820819
REST)))
821-
(IF (IGREATERP (NCHARS REST)
822-
0)
823-
THEN
824-
(* ;; "Could be %"<initials>: abc%" to be upgraded with a date")
820+
(IF (AND REST (IGREATERP (NCHARS REST)
821+
0))
822+
THEN (CL:WHEN RESTOK
823+
824+
(* ;; "Could be %"<initials>: abc%" , we fill in the date")
825825

826-
(CL:WHEN RESTOK (LIST DATE I REST))
826+
(LIST (DATE (DATEFORMAT NO.SECONDS))
827+
I REST))
827828
ELSEIF DATE
828829
THEN
829830
(* ;; "If we saw just initials")
@@ -928,11 +929,11 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
928929
)
929930
(PUTPROPS EDITINTERFACE COPYRIGHT ("Venue & Xerox Corporation" 1986 1987 1988 1990 1991))
930931
(DECLARE%: DONTCOPY
931-
(FILEMAP (NIL (4086 10381 (ED 4086 . 10381)) (10383 14359 (INSTALL-PROTOTYPE-DEFN 10383 . 14359)) (
932-
14360 31143 (EDITDEF.FNS 14370 . 15706) (EDITF 15708 . 16588) (EDITFB 16590 . 17438) (EDITFNS 17440 .
933-
18760) (EDITLOADFNS? 18762 . 22562) (EDITMODE 22564 . 24574) (EDITP 24576 . 25087) (EDITV 25089 .
934-
25728) (DC 25730 . 26411) (DF 26413 . 27455) (DP 27457 . 28541) (DV 28543 . 29115) (EDITPROP 29117 .
935-
29336) (EF 29338 . 29667) (EP 29669 . 29852) (EV 29854 . 30033) (EDITE 30035 . 30913) (EDITL 30915 .
936-
31141)) (31493 46618 (NEW/EDITDATE 31503 . 31725) (FIXEDITDATE 31727 . 39874) (EDITDATE? 39876 . 43363
937-
) (EDITDATE 43365 . 44621) (SETINITIALS 44623 . 46616)))))
932+
(FILEMAP (NIL (4089 10388 (ED 4089 . 10388)) (10390 14366 (INSTALL-PROTOTYPE-DEFN 10390 . 14366)) (
933+
14367 31150 (EDITDEF.FNS 14377 . 15713) (EDITF 15715 . 16595) (EDITFB 16597 . 17445) (EDITFNS 17447 .
934+
18767) (EDITLOADFNS? 18769 . 22569) (EDITMODE 22571 . 24581) (EDITP 24583 . 25094) (EDITV 25096 .
935+
25735) (DC 25737 . 26418) (DF 26420 . 27462) (DP 27464 . 28548) (DV 28550 . 29122) (EDITPROP 29124 .
936+
29343) (EF 29345 . 29674) (EP 29676 . 29859) (EV 29861 . 30040) (EDITE 30042 . 30920) (EDITL 30922 .
937+
31148)) (31500 46704 (NEW/EDITDATE 31510 . 31732) (FIXEDITDATE 31734 . 39753) (EDITDATE? 39755 . 43449
938+
) (EDITDATE 43451 . 44707) (SETINITIALS 44709 . 46702)))))
938939
STOP

sources/EDITINTERFACE.LCOM

375 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)