  ;; nomunge.mut :
  ;; Make the file in the current buffer unmungeable - ie allow
  ;;   no changes to buffer contents.
  ;; Note that this method is full of holes but works OK for people not
  ;;   going out of their way to munge the buffer.
  ;; C Durland	Public Domain

(include me2.h)

(defun
  self-nomunge { (msg "buffer unmungeable!") }
  nomungeCR { (forward-line 1) }
  buffer-nomunge
  {
    (small-int i)

    (for (i 0x20) (< i 0x7F) (+= i 1)
      (bind-local-key "self-nomunge" (convert-to CHARACTER i)))

    (bind-local-key "self-nomunge"	"C-d")
    (bind-local-key "self-nomunge"	"C-H")
    (bind-local-key "self-nomunge"	"C-d")
    (bind-local-key "self-nomunge"	"C-xC-s")
    (bind-local-key "self-nomunge" 	"C-q")
    (bind-local-key "self-nomunge"	"C-k")
    (bind-local-key "self-nomunge"	"C-o")
    (bind-local-key "self-nomunge"	"M-Q")
    (bind-local-key "self-nomunge"	"C-T")
    (bind-local-key "self-nomunge"	"C-I")
    (bind-local-key "self-nomunge"	"C-Y")
    (bind-local-key "self-nomunge"	"M-d")

    (bind-local-key "nomungeCR"		"C-m")
    (bind-local-key "nomungeCR"		"C-j")

    (file-name -1 "")
    (buffer-flags -1 BFFoo)
    (local-modeline-hook "nomunge-modeline")
  }
  nomunge-modeline
  {
    (concat
      "!!!!!!!!!!!!!!!!!"
      (buffer-name -1)
      " is READ ONLY"
      "!"
    )
  }
)
