Synch to No Gnus 200506290837.
[elisp/gnus.git-] / lisp / nndraft.el
index 9061c3a..5cd5ee7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nndraft.el --- draft article access for Gnus
 
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
     (setq buffer-file-name (expand-file-name file)
          buffer-auto-save-file-name (make-auto-save-file-name))
     (clear-visited-file-modtime)
-    (make-local-variable 'write-contents-hooks)
-    (push 'nndraft-generate-headers write-contents-hooks)
+    (let ((hook (if (boundp 'write-contents-functions)
+                   'write-contents-functions
+                 'write-contents-hooks)))
+      (gnus-make-local-hook hook)
+      (add-hook hook 'nndraft-generate-headers nil t))
     article))
 
 (deffoo nndraft-request-group (group &optional server dont-check)