;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for System version 124.45
;;; Reason:
;;;  (zwei:set-lisp-attributes-from-mode-with-translations) requires its
;;;  argument to be a zwei:node, not a zwei:zmacs-buffer.
;;; Written 10-Jun-88 11:34:45 by pld (Peter L. DeWolf) at site Gigamos Cambridge
;;; while running on Azathoth from band 1
;;; with Experimental System 124.44, Experimental Local-File 74.1, Experimental File-Server 23.1, Experimental Unix-Interface 12.0, Experimental ZMail 72.0, Experimental Tape 23.6, Experimental Lambda-Diag 16.1, microcode 1756, SDU Boot Tape 3.14, SDU ROM 8, the old ones.



; From modified file DJ: L.ZWEI; MODES.LISP#163 at 10-Jun-88 11:50:46
#8R ZWEI#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "ZWEI")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: ZWEI; MODES  "

(defun set-lisp-attributes-from-mode-with-translations (&optional (buffer *interval*) &aux realmode)
  (declare(values set-attributes error-flag))
  (check-type buffer node "a ZWEI buffer")
  (cond
    ;;If no real mode determined, punt
    ((null (setq realmode (send buffer :get-attribute :mode))) (values nil :no-mode-attribute))
    ;;Must be a LISP mode buffer
    ((not (eq (send buffer :major-mode) 'lisp-mode)) (values nil :not-lisp-mode))
    ;;If mode says LISP, default as usual
    ((string-equal realmode "LISP") (values nil :must-be-zetalisp))
    ;;If mode is not a valid LISP mode translation, punt.
    ;;See the global *major-mode-translations* for OK modes.
    ((not (string-equal (cdr (assoc realmode *major-mode-translations*)) "LISP"))
     (values nil :not-translated-to-lisp))
    ;;If mode says COMMON-LISP or COMMONLISP, set stuff.
    ((mem #'string-equal realmode '(:COMMON-LISP :COMMONLISP))
     (or (send buffer :get-attribute :readtable)
	 (send buffer :set-attribute :readtable :CL))
     (or (send buffer :get-attribute :syntax)
	 (send buffer :set-attribute :syntax :CL))
     t)
    ;;Apparently the mode is some other translation that may not
    ;;be Common-LISP.
    (t nil)))

))
