Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended the COPYRIGHT property on FILENAME to allow for multiple successive copyright owners. #1527

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
159 changes: 89 additions & 70 deletions sources/PRETTY
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED " 8-Feb-2023 16:21:26" {DSK}<home>larry>il>medley>sources>PRETTY.;3 65500
(FILECREATED " 2-Feb-2024 17:54:23" {DSK}<mnt>e>Interlisp>medley>sources>PRETTY.;2 66897

:EDIT-BY "lmm"
:EDIT-BY "mth"

:CHANGES-TO (FNS PRINTDATE1)
:CHANGES-TO (FNS PRINTCOPYRIGHT1 PRINTCOPYRIGHT)

:PREVIOUS-DATE "19-Jan-2022 20:35:18" {DSK}<home>larry>il>medley>sources>PRETTY.;1)
:PREVIOUS-DATE " 8-Feb-2023 16:21:26" {DSK}<mnt>e>Interlisp>medley>sources>PRETTY.;1)


(* ; "
Copyright (c) 1984-1990, 1999, 2018, 2023 by Venue & Xerox Corporation.
Copyright (c) 1984-1990, 1999, 2018, 2023-2024 by Venue & Xerox Corporation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the copyright owners were something like 1984-1990 Xerox 1999 Venue 2018 Ron Kaplan 2023-24 Interlisp.org. Rather than making auto-generation of (legally dubious) copyright and license statements to make it simpler. Oh, like a file property you can set to point people to the LICENSE statement.

The following program was created in 1984 but has not been published
within the meaning of the copyright law, is furnished under license,
and may not be used, copied and/or disclosed except in accordance
Expand Down Expand Up @@ -491,14 +491,15 @@ must replace the declare: by a nop addvars.") (SETQ PRTTYCOM (SUBPAIR (QUOTE (NL
(DEFINEQ

(PRINTCOPYRIGHT
[LAMBDA (FILENAME) (* ; "Edited 11-Sep-2021 09:07 by larry")
(* ; "Edited 31-Aug-99 09:01 by rmk:")
[LAMBDA (FILENAME) (* ; "Edited 2-Feb-2024 17:18 by mth")
(* ; "Edited 11-Sep-2021 09:07 by larry")
(* ; "Edited 31-Aug-99 09:01 by rmk:")
(* edited%: " 1-Jan-85 20:16")

(* ;;; "CALLED BY PRETTYDEF TO PUT a copyright notice on a file. The globalvar COPYRIGHTOWNERS is used to determine the possible copyright owners when it is determined the file doesn't have a copyright yet and has never been asked if the programmer wanted one. The whole copyright mechanism can be turned off by setting COPYRIGHTFLG to NEVER -- originaly NIL. If the file is copyrighted, any year the file is editted the new year is tacked on to the list of copyright years. The copyright notice comes immediately after the FILECREATED expression ")

(* ;;
 "9/10/2021 LMM: Add COPYRIGHTFLG value PRESERVE meaning no new copyright (or year) but retain old")
 "9/10/2021 LMM: Add COPYRIGHTFLG value PRESERVE meaning no new copyright (or year) but retain old")

(PROG [(OWNER (GETPROP FILENAME 'COPYRIGHT]
(AND [OR OWNER
Expand All @@ -520,14 +521,14 @@ must replace the declare: by a nop addvars.") (SETQ PRTTYCOM (SUBPAIR (QUOTE (NL
(CADR X)
'CONFIRMFLG T]
(CONS (if (SETQ OWNER (ASSOC DEFAULTCOPYRIGHTOWNER
COPYRIGHTOWNERS))
COPYRIGHTOWNERS))
then (LIST (CONSTANT (CHARACTER (CHARCODE LF)))
(CONCAT DEFAULTCOPYRIGHTOWNER "
(CONCAT DEFAULTCOPYRIGHTOWNER "
")
'EXPLAINSTRING
(CONCAT "<LF> - " (CADR OWNER)
" [Default]")
'NOECHOFLG T 'RETURN (CADR OWNER))
'EXPLAINSTRING
(CONCAT "<LF> - " (CADR OWNER)
" [Default]")
'NOECHOFLG T 'RETURN (CADR OWNER))
else '(%
"No copyright notice now
" EXPLAINSTRING "<LF> - no copyright notice now [Default]" NOECHOFLG T RETURN NIL))
Expand All @@ -537,67 +538,85 @@ must replace the declare: by a nop addvars.") (SETQ PRTTYCOM (SUBPAIR (QUOTE (NL
(COND
((NEQ (CAR OWNER)
'NONE)
(PROG ((CURRENTYEAR (SUBATOM (DATE (DATEFORMAT YEAR.LONG NO.TIME))
-4 -1)))
[PROG ((CURRENTYEAR (SUBATOM (DATE (DATEFORMAT YEAR.LONG NO.TIME))
-4 -1))
LATESTOWNER)

(* ;; " see github Interlisp/medley issue #207 (lmm 9/11/2021)")

(OR (EQ COPYRIGHTFLG 'PRESERVE)
(MEMBER CURRENTYEAR (CDR OWNER))
(NCONC1 OWNER CURRENTYEAR)))
(if (NEQ COPYRIGHTFLG 'PRESERVE)
then (if (LISTP (CAR OWNER))
then (SETQ LATESTOWNER (CAR (LAST OWNER)))
else (SETQ LATESTOWNER OWNER))
(if (NEQ CURRENTYEAR (CAR (LAST LATESTOWNER)))
then (NCONC1 LATESTOWNER CURRENTYEAR]
(PRINTCOPYRIGHT1 OWNER])

(PRINTCOPYRIGHT1
[LAMBDA (OWNER) (* ; "Edited 21-Feb-2021 10:58 by rmk:")
(* ; "Edited 6-Apr-90 10:36 by jds")
(PROG ((DATES (CDR OWNER))
(SEMICOLON (AND (READTABLEPROP *READTABLE* 'COMMONLISP)
"; "))
(PRIVATE NIL))
[LAMBDA (OWNER) (* ; "Edited 2-Feb-2024 17:45 by mth")
(* ; "Edited 21-Feb-2021 10:58 by rmk:")
(* ; "Edited 6-Apr-90 10:36 by jds")
(PROG (DATES CREATEDYEAR (SEMICOLON (AND (READTABLEPROP *READTABLE* 'COMMONLISP)
"; "))
(PRIVATE NIL))
(if (NOT (LISTP (CAR OWNER)))
then (SETQ OWNER (LIST OWNER)) (* ;
 "Make the old format into the new format")
)
(COND
((EQ (CAR DATES)
T)
(SETQ PRIVATE T)
(pop DATES)))
(COND
(SEMICOLON (* ; "do CommonLisp style comment")
(SEMICOLON (* ; "do CommonLisp style comment")
(PRIN1 SEMICOLON))
(T (* ;
"Print IL-style comment, with a ; in it so the pretty printer will render it as a CL-style comment.")
(T (* ;
 "Print IL-style comment, with a ; in it so the pretty printer will render it as a CL-style comment.")
(printout NIL "(* ; %"" T)))
(PRIN3 "Copyright (c) ")
[for Y START END on DATES do (* ;
 "print years of copyright, e.g., 1985, 1986. Print intervals for successive years")
(SETQ START (SETQ END (CAR Y)))
(FOR NEXT IN (CDR Y)
WHILE (EQ (ADD1 END)
NEXT) DO (SETQ END NEXT)
(POP Y))
(PRIN3 START)
(CL:UNLESS (EQ START END)
(PRIN3 "-")
(PRIN3 END))
(COND
((CDR Y)
(PRIN3 ", "]
(PRIN3 " by ")
(PRIN3 (CAR OWNER))
(PRIN3 ".")
(for OT O on OWNER do [SETQ DATES (CDR (SETQ O (CAR OT]
(COND
((EQ (CAR DATES)
T)
(SETQ PRIVATE T)
(pop DATES)))
[for Y START END on DATES
do (* ;
 "print years of copyright, e.g., 1985, 1986. Print intervals for successive years")
(SETQ START (SETQ END (CAR Y)))

(* ;;
 "For the PRIVATE notice below. It is always the EARLIEST year")

(SETQ CREATEDYEAR (OR CREATEDYEAR START))
(for NEXT in (CDR Y) while (EQ (ADD1 END)
NEXT) do (SETQ END NEXT)
(pop Y))
(PRIN3 START)
(CL:UNLESS (EQ START END)
(PRIN3 "-")
(PRIN3 END))
(COND
((CDR Y)
(PRIN3 ", "]
(PRIN3 " by ")
(PRIN3 (CAR O))
(PRIN3 ".")
(if (CDR OT)
then (TERPRI)
(COND
(SEMICOLON (PRIN1 SEMICOLON)))
(PRIN3 " And ")))
(AND COPYRIGHTSRESERVED (PRIN3 " All rights reserved."))
(TERPRI)
[COND
(PRIVATE (for LINE in (CONS (CONCAT "The following program was created in "
(CAR DATES)
" but has not been published")
'(
(PRIVATE (for LINE in (CONS (CONCAT "The following program was created in " (CAR DATES)
" but has not been published")
'(
"within the meaning of the copyright law, is furnished under license,"

"and may not be used, copied and/or disclosed except in accordance"
"with the terms of said license."))
"with the terms of said license."))
do (COND
(SEMICOLON (PRIN1 SEMICOLON)))
(PRIN3 LINE)
(TERPRI]
(SEMICOLON (PRIN1 SEMICOLON)))
(PRIN3 LINE)
(TERPRI]
(COND
((NOT SEMICOLON)
(PRIN3 "%")")
Expand Down Expand Up @@ -730,16 +749,16 @@ must replace the declare: by a nop addvars.") (SETQ PRTTYCOM (SUBPAIR (QUOTE (NL
(ADDTOVAR LAMA )
)
(PUTPROPS PRETTY COPYRIGHT ("Venue & Xerox Corporation" T 1984 1985 1986 1987 1988 1989 1990 1999 2018
2023))
2023 2024))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (5917 48569 (PRETTYDEF 5927 . 21600) (PRETTYDEFCOMS 21602 . 22284) (PRETTYDEF0 22286 .
22477) (PRETTYDEF1 22479 . 24242) (PRINTDATE 24244 . 25480) (PRINTDATE1 25482 . 27260) (PRINTFNS 27262
. 27831) (PRETTYCOM 27833 . 34174) (PRETTYVAR 34176 . 35214) (PRETTYVAR1 35216 . 37434) (PRETTYCOM1
37436 . 38140) (ENDFILE 38142 . 38238) (MAKEDEFLIST 38240 . 38644) (PP 38646 . 38922) (PP* 38924 .
39237) (PPT 39239 . 39558) (PRETTYPRINT 39560 . 42712) (PRETTYPRINT1 42714 . 44600) (PRETTYPRINT2
44602 . 45918) (PRETTYPRINT3 45920 . 46875) (PRINTDEF1 46877 . 47813) (SUPERPRINTEQ 47815 . 47909) (
SUPERPRINTGETPROP 47911 . 48055) (CHANGEFONT 48057 . 48567)) (48570 53916 (READARRAY 48580 . 49506) (
PRINTARRAY 49508 . 51248) (READARRAY-FROM-LIST 51250 . 52355) (PRINTARRAY-TO-LIST 52357 . 53914)) (
54043 61561 (PRINTCOPYRIGHT 54053 . 58130) (PRINTCOPYRIGHT1 58132 . 61256) (SAVECOPYRIGHT 61258 .
61559)))))
(FILEMAP (NIL (5946 48598 (PRETTYDEF 5956 . 21629) (PRETTYDEFCOMS 21631 . 22313) (PRETTYDEF0 22315 .
22506) (PRETTYDEF1 22508 . 24271) (PRINTDATE 24273 . 25509) (PRINTDATE1 25511 . 27289) (PRINTFNS 27291
. 27860) (PRETTYCOM 27862 . 34203) (PRETTYVAR 34205 . 35243) (PRETTYVAR1 35245 . 37463) (PRETTYCOM1
37465 . 38169) (ENDFILE 38171 . 38267) (MAKEDEFLIST 38269 . 38673) (PP 38675 . 38951) (PP* 38953 .
39266) (PPT 39268 . 39587) (PRETTYPRINT 39589 . 42741) (PRETTYPRINT1 42743 . 44629) (PRETTYPRINT2
44631 . 45947) (PRETTYPRINT3 45949 . 46904) (PRINTDEF1 46906 . 47842) (SUPERPRINTEQ 47844 . 47938) (
SUPERPRINTGETPROP 47940 . 48084) (CHANGEFONT 48086 . 48596)) (48599 53945 (READARRAY 48609 . 49535) (
PRINTARRAY 49537 . 51277) (READARRAY-FROM-LIST 51279 . 52384) (PRINTARRAY-TO-LIST 52386 . 53943)) (
54072 62953 (PRINTCOPYRIGHT 54082 . 58556) (PRINTCOPYRIGHT1 58558 . 62648) (SAVECOPYRIGHT 62650 .
62951)))))
STOP
Binary file modified sources/PRETTY.LCOM
Binary file not shown.