diff -u psgml-1.2.2/psgml-debug.el psgml-1.2.2-Emacs21-patch/psgml-debug.el
--- psgml-1.2.2/psgml-debug.el	Fri Feb  9 17:33:58 2001
+++ psgml-1.2.2-Emacs21-patch/psgml-debug.el	Sun Mar 25 16:29:32 2001
@@ -664,8 +664,8 @@
     (cond
      (sgml-use-text-properties
       (let ((inhibit-read-only t)
-	    (after-change-function nil)	; obsolete variable
-	    (before-change-function nil) ; obsolete variable
+;	    (after-change-function nil)	; obsolete variable
+;	    (before-change-function nil) ; obsolete variable
 	    (after-change-functions nil)
 	    (before-change-functions nil))
 	(put-text-property start end 'face face)
diff -u psgml-1.2.2/psgml-edit.el psgml-1.2.2-Emacs21-patch/psgml-edit.el
--- psgml-1.2.2/psgml-edit.el	Fri Feb  9 17:33:58 2001
+++ psgml-1.2.2-Emacs21-patch/psgml-edit.el	Sun Mar 25 16:29:32 2001
@@ -262,6 +262,7 @@
 					; perhaps some old version of
 					; emacs does not understand
 					; inhibit-read-only
+	(inhibit-modification-hooks t)
 	(before-change-function nil)
 	(after-change-function nil))
     (setq selective-display t)
@@ -703,7 +704,6 @@
 	    (when tem			; more than one req elem
 	      (insert "\n")
 	      (when sgml-insert-missing-element-comment
-		(insert (format "<!-- one of %s -->" tem))
 		(sgml-indent-line)))))
 	(setq newpos (or newpos (point)))
 	(when sgml-insert-end-tag-on-new-line
@@ -1542,6 +1542,7 @@
   (let ((buffer-modified-p (buffer-modified-p))
 	(inhibit-read-only t)
 	(buffer-read-only nil)
+	(inhibit-modification-hooks t)
 	(before-change-function nil)
 	(markup-index			; match-data index in tag regexp
 	 (if attr-p 2 1))
@@ -1594,7 +1595,8 @@
 ;;;; SGML mode: Normalize (and misc manipulations)
 
 (defun sgml-expand-shortref-to-text (name)
-  (let (before-change-function
+   (let ((before-change-function nil)
+       (inhibit-modification-hooks t)
 	(entity (sgml-lookup-entity name (sgml-dtd-entities sgml-dtd-info))))
     (cond
      ((null entity) (sgml-error "Undefined entity %s" name))
@@ -1611,7 +1613,8 @@
 (defun sgml-expand-shortref-to-entity (name)
   (let ((end (point))
 	(re-found nil)
-	before-change-function)
+	(before-change-function nil)
+	(inhibit-modification-hooks t))
     (goto-char sgml-markup-start)
     (setq re-found (search-forward "\n" end t))
     (delete-region sgml-markup-start end)	   
@@ -1644,7 +1647,8 @@
   (let ((only-one (not (null element))))
     (setq element (or element (sgml-top-element)))
     (goto-char (sgml-element-end element)) 
-    (let ((before-change-function nil))
+    (let ((before-change-function nil)
+         (inhibit-modification-hooks t))
       (sgml-normalize-content element only-one)))
   (sgml-note-change-at (sgml-element-start element))
   (sgml-message "Done"))
diff -u psgml-1.2.2/psgml-other.el psgml-1.2.2-Emacs21-patch/psgml-other.el
--- psgml-1.2.2/psgml-other.el	Fri Feb  9 17:33:58 2001
+++ psgml-1.2.2-Emacs21-patch/psgml-other.el	Sun Mar 25 16:29:32 2001
@@ -111,8 +111,9 @@
     (cond
      (sgml-use-text-properties
       (let ((inhibit-read-only t)
-	    (after-change-function nil)	; obsolete variable
-	    (before-change-function nil) ; obsolete variable
+;	    (after-change-function nil)	; obsolete variable
+;	    (before-change-function nil) ; obsolete variable
+           (inhibit-modification-hooks t) 
 	    (after-change-functions nil)
 	    (before-change-functions nil))
 	(put-text-property start end 'face face)
diff -u psgml-1.2.2/psgml-parse.el psgml-1.2.2-Emacs21-patch/psgml-parse.el
--- psgml-1.2.2/psgml-parse.el	Fri Feb  9 17:33:58 2001
+++ psgml-1.2.2-Emacs21-patch/psgml-parse.el	Sun Mar 25 16:29:32 2001
@@ -2491,13 +2491,13 @@
     (when (eq sgml-scratch-buffer (default-value 'sgml-scratch-buffer))
       (make-local-variable 'sgml-scratch-buffer)
       (setq sgml-scratch-buffer nil))
-    (when after-change-function		;***
-      (message "OOPS: after-change-function not NIL in scratch buffer %s: %s"
+    (when (memq 'sgml-set-face-after-change after-change-functions) ;***
+      (message "OOPS: after-change-functions not NIL in scratch buffer %s: %s"
 	       (current-buffer)
-	       after-change-function)
-      (setq before-change-function nil
-	    after-change-function nil))
-    (setq sgml-last-entity-buffer (current-buffer))
+              after-change-functions)
+      (remove-hook 'before-change-function 'sgml-note-change-at t)
+      (remove-hook 'after-change-function 'sgml-set-face-after-change t))
+   (setq sgml-last-entity-buffer (current-buffer))
     (erase-buffer)
     (setq default-directory dd)
     (make-local-variable 'sgml-current-file)
@@ -2875,11 +2875,11 @@
   (sgml-element-mixed sgml-current-tree))
 
 (defun sgml-set-initial-state (dtd)
-  "Set initial state of parsing"
-  (make-local-variable 'before-change-function)
-  (setq before-change-function 'sgml-note-change-at)
-  (make-local-variable 'after-change-function)
-  (setq after-change-function 'sgml-set-face-after-change)
+  "Set initial state of parsing."
+  (make-local-hook 'before-change-functions)
+  (add-hook 'before-change-functions 'sgml-note-change-at nil t)
+  (make-local-hook 'after-change-functions)
+  (add-hook 'after-change-functions 'sgml-set-face-after-change nil t)
   (sgml-set-active-dtd-indicator (sgml-dtd-doctype dtd))
   (let ((top-type			; Fake element type for the top
 					; node of the parse tree
@@ -3923,11 +3923,11 @@
 called in the parser loop, and the loop is exited if the function returns t.
 If third argument QUIT is non-nil, no \"Parsing...\" message will be displayed."
   (sgml-need-dtd)
-  (unless before-change-function
-    (message "WARN: before-change-function has been lost, restoring (%s)"
+  (unless (memq 'sgml-note-change-at before-change-functions)
+    (message "WARN: before-change-functions has been lost, restoring (%s)"
 	     (current-buffer))
-    (setq before-change-function 'sgml-note-change-at)
-    (setq after-change-function 'sgml-set-face-after-change))
+    (add-hook 'before-change-functions 'sgml-note-change-at nil t)
+    (add-hook 'after-change-functions 'sgml-set-face-after-change nil t))
   (sgml-with-parser-syntax-ro
    (sgml-goto-start-point (min sgml-goal (point-max)))
    (setq quiet (or quiet (< (- sgml-goal (sgml-mainbuf-point)) 500)))
diff -u psgml-1.2.2/psgml.el psgml-1.2.2-Emacs21-patch/psgml.el
--- psgml-1.2.2/psgml.el	Fri Feb  9 17:33:58 2001
+++ psgml-1.2.2-Emacs21-patch/psgml.el	Sun Mar 25 16:29:32 2001
@@ -365,7 +365,7 @@
 (defvar sgml-catalog-files (or (delete nil
 				       (sgml-parse-colon-path
 					(getenv "SGML_CATALOG_FILES")))
-			       '("catalog" "/usr/local/lib/sgml/catalog"))
+			       '("catalog" "/usr/lib/sgml/catalog"))
   "*List of catalog entry files.
 The files are in the format defined in the SGML Open Draft Technical
 Resolution on Entity Management.")
