(write-abbrev-file): Simplify, and put a coding cookie
authorDave Love <fx@gnu.org>
Thu, 23 Jan 2003 20:37:49 +0000 (20:37 +0000)
committerDave Love <fx@gnu.org>
Thu, 23 Jan 2003 20:37:49 +0000 (20:37 +0000)
in the file.

lisp/ChangeLog
lisp/abbrev.el

index c052e08..6dd1382 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-23  Dave Love  <fx@gnu.org>
+
+       * abbrev.el (write-abbrev-file): Simplify, and put a coding cookie
+       in the file.
+
 2003-01-23  Masatake YAMATO  <jet@gyve.org>
 
        * progmodes/asm-mode.el (asm-mode): Added syntax table entries for
index a73c8e0..8d9b762 100644 (file)
@@ -212,15 +212,11 @@ The argument FILE is the file name to write."
                    abbrev-file-name)))
   (or (and file (> (length file) 0))
       (setq file abbrev-file-name))
-  (save-excursion
-   (set-buffer (get-buffer-create " write-abbrev-file"))
-   (erase-buffer)
-   (let ((tables abbrev-table-name-list))
-     (while tables
-       (insert-abbrev-table-description (car tables) nil)
-       (setq tables (cdr tables))))
-   (write-region (point-min) (point-max) file)
-   (erase-buffer)))
+  (let ((coding-system-for-write 'emacs-mule))
+    (with-temp-file file
+      (insert ";;-*-coding: emacs-mule;-*-\n")
+      (dolist (table abbrev-table-name-list)
+       (insert-abbrev-table-description table nil)))))
 \f
 (defun add-mode-abbrev (arg)
   "Define mode-specific abbrev for last word(s) before point.