--- tex.el.old	2013-02-10 11:52:21.000000000 +0100
+++ tex.el	2013-02-10 11:53:23.000000000 +0100
@@ -3336,16 +3336,24 @@
 	  TeX-macro-global))
   (byte-recompile-directory TeX-auto-global 0))
 
+(defvar TeX-auto-store-pre-string nil
+  "List of strings to be written at the beginning of parsed file.")
+
+(make-variable-buffer-local 'TeX-auto-store-pre-string)
+
 (defun TeX-auto-store (file)
   "Extract information for AUCTeX from current buffer and store it in FILE."
   (TeX-auto-parse)
 
   (if (member nil (mapcar 'TeX-auto-entry-clear-p TeX-auto-parser))
-      (let ((style (TeX-strip-extension nil TeX-all-extensions t)))
+      (let ((style (TeX-strip-extension nil TeX-all-extensions t))
+	    (pre-string (mapconcat 'identity TeX-auto-store-pre-string "\n")))
 	(TeX-unload-style style)
 	(save-excursion
 	  (set-buffer (generate-new-buffer file))
 	  (erase-buffer)
+	  (unless (zerop (length pre-string))
+	    (insert pre-string "\n\n"))
 	  (insert "(TeX-add-style-hook\n \""
 		  style "\"\n (lambda ()")
 	  (mapc (lambda (el) (TeX-auto-insert el style))
