Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 83 additions & 56 deletions sources/EDITINTERFACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED " 4-Dec-2021 10:40:27" 
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;21 46036
(FILECREATED " 8-Dec-2021 18:25:33" 
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;29 47473

changes to%: (FNS EDITDATE?)
:CHANGES-TO (FNS EDITDATE? EDITDATE)

previous date%: " 3-Dec-2021 15:45:20"
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;19)
:PREVIOUS-DATE " 8-Dec-2021 16:11:23"
{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;27)


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

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

(* ;;; "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.")

Expand Down Expand Up @@ -629,21 +629,21 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
(FIXEDITDATE
[LAMBDA (EXPR)

(* ;; "Edited 3-Dec-2021 15:35 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.")
 (* ; "Edited 3-Dec-2021 15:03 by rmk")
(* ;; "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.")
(* ; "Edited 3-Dec-2021 15:03 by rmk")
(* ; "Edited 22-Oct-2021 16:58 by rmk:")
(* ; "Edited 27-Sep-2018 22:04 by rmk:")
(* ; "Edited 31-Mar-2000 17:13 by rmk:")
(* ; "Edited 17-Jul-89 11:13 by jtm:")
(* ; "18-JUL-78 21:11")

(* ;; "Inserts or replaces previous edit date. This retains multiple edits (at least one day apart or by different editor) unless *REPLACE-OLD-EDIT-DATES*. Note that the new date doesn't show up within the current SEDIT session, you have to exit and re-edit to see it.")
(* ;; "Inserts or replaces previous edit date. This retains multiple edits (at least one day apart or by different editor) unless *REPLACE-OLD-EDIT-DATES*. Note that the new date doesn't show up within the current SEDIT session, you have to exit and re-edit to see it. ")

(CL:WHEN (AND INITIALS (LISTP EXPR)
(LISTP (CDR EXPR)))
(PROG (E)

(* ;; "Normalize out the colon, add it back if needed.")
(* ;; "Normalize out the colon, add it back if needed. ")

(COND
((FMEMB (CAR EXPR)
Expand Down Expand Up @@ -729,26 +729,36 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
(IF (STRING.EQUAL INITLS (CADR PARSE))
THEN

(* ;; "This is a previous date with this author. 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.")
(* ;; "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.")

[IF (OR (NULL (CAR PARSE))
(IGREATERP (IDIFFERENCE (IDATE)
(IDATE (CAR PARSE)))
(TIMES 24 3600)))
[IF (NULL (CAR PARSE))
THEN
(* ;; "If no date, must have been %"INITIALS: xxx%" and we definitely want to upgraded to the Edited... format")
(* ;; "If no date but %"INITIALS: xxx%", we definitely want to upgraded to the Edited... initials: xxx format")

(/RPLACA E (EDITDATE (CAR E)
INITLS
(CADDR PARSE)))
ELSEIF (IGREATERP (IDIFFERENCE (IDATE)
(IDATE (CAR PARSE)))
(TIMES 24 3600))
THEN
(* ;;
 "If we aren't upgrading, then we don't want to propagate the previous REST.")

(/ATTACH (EDITDATE NIL INITLS (CADDR PARSE))
(/ATTACH (EDITDATE NIL INITLS)
E)
ELSE
(* ;; "Same author, within a day. ")
(* ;;
 "Same author, within a day. Just change the date, keep the REST.")

(/RPLACA E (EDITDATE NIL INITLS (CADDR PARSE]
(/RPLACA E (EDITDATE (CAR E)
INITLS
(CADDR PARSE]
ELSE
(* ;;
 "Not a previous date, or not one with this author. Add a new one.")

(/ATTACH (EDITDATE NIL INITLS (CADDR PARSE))
(* ;; "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.")

(/ATTACH (EDITDATE NIL INITLS)
E))
ELSE
(* ;; "Need a new date, didn't even see %"<initials: xxx%"")
Expand All @@ -758,11 +768,14 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
(RETURN EXPR)))])

(EDITDATE?
[LAMBDA (COMMENT RESTOK) (* ; "Edited 4-Dec-2021 10:39 by rmk")
[LAMBDA (COMMENT RESTOK) (* ; "Edited 8-Dec-2021 18:24 by rmk")

(* ;; "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.")
(* ; "Edited 4-Dec-2021 10:39 by rmk")

(* ;;; "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).")

(* ;;; "If RESTOK, this also parses strings with additional stuff after the <initials> (%"Edited by <initials>: xxx%") and strings that appear to begin with initials but don't have a date (<initials>: xxx). In those cases the return is a triple (DATE INITIALS REST), where DATE may be NIL. ")
(* ;;; "If RESTOK, this also parses strings with additional stuff after the INITLS (%"Edited by <initials>: xxx%") and strings that appear to begin with initials but don't have a date (<initials>: xxx). In those cases the return is a triple (DATE INITIALS REST), where DATE may be NIL. ")

(* ;;; "")

Expand All @@ -772,41 +785,55 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
(* ;;; "There is no harm in not recognizing prehistoric formats, new dates will always be added on.")

(LET ((TAIL COMMENT)
STRING BYPOS DATE I RESTPOS)
STRING BYPOS (IPOS 1)
DATE I IENDPOS RESTPOS)
(CL:WHEN [AND (EQ COMMENTFLG (CAR (LISTP TAIL)))
(MEMB [CAR (LISTP (SETQ TAIL (CDR TAIL]
'(; ;; ;;;))
(STRINGP (SETQ STRING (CAR (SETQ TAIL (CDR TAIL]
(SETQ STRING (CL:STRING-TRIM `(#\Space)
STRING))
(CL:UNLESS [AND [STREQUAL "Edited " (SUBSTRING STRING 1 7 (CONSTANT (CONCAT]
(SETQ BYPOS (STRPOS " by " STRING 8))
[IDATE (SETQ DATE (CL:STRING-TRIM `(#\Space)
(SUBSTRING STRING 8 (SUB1 BYPOS]
(SETQ I (SUBSTRING STRING (IPLUS BYPOS 4)
(OR (SETQ RESTPOS (STRPOS " " STRING (IPLUS BYPOS 4)))
-1]

(* ;; "Could be %"<INITIALS>: abc%" to be upgraded with a date")

(CL:WHEN (SETQ RESTPOS (STRPOS " " STRING))
(SETQ I (SUBSTRING STRING 1 (SUB1 RESTPOS)))))
(CL:WHEN (AND I (ILESSP (NCHARS I)
12)) (* ;
(CL:WHEN [AND [STREQUAL "Edited " (SUBSTRING STRING 1 7 (CONSTANT (CONCAT]
(SETQ BYPOS (STRPOS " by " STRING 8))
(IDATE (SETQ DATE (CL:STRING-TRIM `(#\Space)
(SUBSTRING STRING 8 (SUB1 BYPOS]

(* ;; "Standard format, initials should be next. ")

(SETQ IPOS (IPLUS BYPOS 4)))

(* ;; "Chomp off the next substring--initials?")

(CL:WHEN (IGREATERP (NCHARS STRING)
IPOS)
[SETQ IENDPOS (SUB1 (OR (STRPOS " " STRING IPOS)
(ADD1 (NCHARS STRING]
(SETQ I (SUBSTRING STRING IPOS IENDPOS))
(CL:WHEN (ILESSP (NCHARS I)
12) (* ;
 "Sanity check: Initials should be short.")
(CL:WHEN (EQ (CHARCODE %:)
(NTHCHARCODE I -1)) (* ;
 "Normalize out the colon in the return")
(SETQ I (SUBSTRING I 1 -2)))
(IF RESTOK
THEN (LIST DATE I (AND RESTPOS (SUBSTRING STRING RESTPOS)))
ELSEIF (AND DATE (NOT RESTPOS))
THEN (LIST DATE I))))])
(CL:WHEN (EQ (CHARCODE %:)
(NTHCHARCODE I -1)) (* ; "Normalize out the colon")
(SETQ I (SUBSTRING I 1 -2)))
(CL:WHEN (SETQ REST (SUBSTRING STRING (ADD1 IENDPOS)))
(SETQ REST (CL:STRING-TRIM `(#\Space)
REST)))
(IF (IGREATERP (NCHARS REST)
0)
THEN
(* ;; "Could be %"<initials>: abc%" to be upgraded with a date")

(CL:WHEN RESTOK (LIST DATE I REST))
ELSEIF DATE
THEN
(* ;; "If we saw just initials")

(LIST DATE I)))))])

(EDITDATE
[LAMBDA (OLDDATE INITLS REST)

(* ;; "Edited 3-Dec-2021 13:17 by rmk: Upgraded to make sure that the comment includes REST")
(* ;; "Edited 8-Dec-2021 17:58 by rmk: Upgraded to make sure that the comment includes REST")
(* ; " 20-Nov-86 23:23 by Masinter")

(* ;; "Generates a new date from an old one. Packs : onto INITLS if there is a REST. In the REST case we upgrade a singe semicolon to a double.")
Expand All @@ -815,7 +842,7 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
" by " INITLS))
NEWDATE OLDSEMI)
(CL:WHEN REST
(SETQ EDITSTRING (CONCAT EDITSTRING ":" REST)))
(SETQ EDITSTRING (CONCAT EDITSTRING ": " REST)))
(CL:WHEN OLDDATE
(SETQ OLDSEMI (CADR OLDDATE)))
(SETQ NEWDATE (LIST (CL:IF REST
Expand Down Expand Up @@ -901,11 +928,11 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
)
(PUTPROPS EDITINTERFACE COPYRIGHT ("Venue & Xerox Corporation" 1986 1987 1988 1990 1991))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (4080 10379 (ED 4080 . 10379)) (10381 14357 (INSTALL-PROTOTYPE-DEFN 10381 . 14357)) (
14358 31141 (EDITDEF.FNS 14368 . 15704) (EDITF 15706 . 16586) (EDITFB 16588 . 17436) (EDITFNS 17438 .
18758) (EDITLOADFNS? 18760 . 22560) (EDITMODE 22562 . 24572) (EDITP 24574 . 25085) (EDITV 25087 .
25726) (DC 25728 . 26409) (DF 26411 . 27453) (DP 27455 . 28539) (DV 28541 . 29113) (EDITPROP 29115 .
29334) (EF 29336 . 29665) (EP 29667 . 29850) (EV 29852 . 30031) (EDITE 30033 . 30911) (EDITL 30913 .
31139)) (31491 45181 (NEW/EDITDATE 31501 . 31723) (FIXEDITDATE 31725 . 39112) (EDITDATE? 39114 . 41927
) (EDITDATE 41929 . 43184) (SETINITIALS 43186 . 45179)))))
(FILEMAP (NIL (4086 10381 (ED 4086 . 10381)) (10383 14359 (INSTALL-PROTOTYPE-DEFN 10383 . 14359)) (
14360 31143 (EDITDEF.FNS 14370 . 15706) (EDITF 15708 . 16588) (EDITFB 16590 . 17438) (EDITFNS 17440 .
18760) (EDITLOADFNS? 18762 . 22562) (EDITMODE 22564 . 24574) (EDITP 24576 . 25087) (EDITV 25089 .
25728) (DC 25730 . 26411) (DF 26413 . 27455) (DP 27457 . 28541) (DV 28543 . 29115) (EDITPROP 29117 .
29336) (EF 29338 . 29667) (EP 29669 . 29852) (EV 29854 . 30033) (EDITE 30035 . 30913) (EDITL 30915 .
31141)) (31493 46618 (NEW/EDITDATE 31503 . 31725) (FIXEDITDATE 31727 . 39874) (EDITDATE? 39876 . 43363
) (EDITDATE 43365 . 44621) (SETINITIALS 44623 . 46616)))))
STOP
Binary file modified sources/EDITINTERFACE.LCOM
Binary file not shown.
Loading