]> code.delx.au - gnu-emacs/blobdiff - lisp/abbrev.el
Misc changes to avoid using path == file name.
[gnu-emacs] / lisp / abbrev.el
index 25bfcf705857c14aece64aeaae967260fc69a579..a73c8e0fe8d9aeb7edba1bca50ff944b8eb6eef4 100644 (file)
@@ -74,6 +74,18 @@ buffer."
       (clear-abbrev-table (symbol-value (car tables)))
       (setq tables (cdr tables)))))
 
+(defun copy-abbrev-table (table)
+  "Make a new abbrev-table with the same abbrevs as TABLE."
+  (let ((new-table (make-abbrev-table)))
+    (mapatoms
+     (lambda (symbol)
+       (define-abbrev new-table
+        (symbol-name symbol)
+        (symbol-value symbol)
+        (symbol-function symbol)))
+     table)
+    new-table))
+
 (defun insert-abbrevs ()
   "Insert after point a description of all defined abbrevs.
 Mark is set after the inserted text."
@@ -207,7 +219,7 @@ The argument FILE is the file name to write."
      (while tables
        (insert-abbrev-table-description (car tables) nil)
        (setq tables (cdr tables))))
-   (write-region 1 (point-max) file)
+   (write-region (point-min) (point-max) file)
    (erase-buffer)))
 \f
 (defun add-mode-abbrev (arg)