;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Private patches made by keith
;;; Reason:
;;;  ZWEI:READ-SYSTEM-NAME was returning a system instance instead of a string
;;;  when default is taken from null string.
;;;  This causes lossage with corruption in *zmacs-tag-table-alist*
;;;  such that selecting the corresponding tag table aborts with STRING-LENGTH error.
;;; Written 25-Jun-87 18:27:39 by keith (Keith Corbett) at site LMI
;;; while running on Cousin It from band 2
;;; with System 110.232, Local-File 68.7, FILE-Server 18.4, Unix-Interface 9.1, Tape 6.39, Tiger 24.0, KERMIT 31.3, ZMail 65.14, Lambda-Diag 7.17, TCP-Kernel 41.2, TCP-User 63.1, TCP-Server 46.0, Site Data Editor 3.4, System Revision Level 3.279, Object Lisp 5.0, Laser1+ 1.0, Iris 10.0, VISTA-LIBRARY 31.0, VISOBS 37.0, microcode 1600, SDU Boot Tape 3.14, SDU ROM 8, t,l+,iv.



; From modified file IT: RELEASE-3.ZWEI; SECTIO.LISP#282 at 25-Jun-87 18:27:51
#8R ZWEI#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "ZWEI")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: ZWEI; SECTIO  "


(DEFUN READ-SYSTEM-NAME (PROMPT
			 &OPTIONAL (DEFAULT (SYSTEM-OF-PATHNAME
					      (BUFFER-GENERIC-PATHNAME *INTERVAL*) T)))
  "Read a system name in the mini buffer, defaulting to DEFAULT.
Prompts with PROMPT (which should end with a colon and not mention the default).
DEFAULT defaults to a guess based on the current buffer."
  (LET ((SYSTEM-NAME (COMPLETING-READ-FROM-MINI-BUFFER
		       (IF DEFAULT
			   (FORMAT NIL "~A (Default ~A)" PROMPT (SI:SYSTEM-NAME DEFAULT))
			 PROMPT)
		       (SI:ALL-SYSTEMS-NAME-ALIST)
		       T)))
    (COND ((CONSP SYSTEM-NAME)
	   (SETQ SYSTEM-NAME (CAR SYSTEM-NAME)))
	  ((STRING-EQUAL SYSTEM-NAME "")
	   (OR (SETQ SYSTEM-NAME (si:system-name DEFAULT)) (BARF)))
	  ((STRINGP SYSTEM-NAME)
	   (CONDITION-CASE (SYSTEM) (SI:FIND-SYSTEM-NAMED SYSTEM-NAME NIL NIL)
	     (ERROR (BARF "~A" SYSTEM))
	     (:NO-ERROR (SETQ SYSTEM-NAME (SI:SYSTEM-NAME SYSTEM))))))
    SYSTEM-NAME))



))
