]> git.eshelyaron.com Git - emacs.git/commitdiff
(copy-abbrev-table): New function.
authorRichard M. Stallman <rms@gnu.org>
Thu, 12 Sep 2002 03:19:25 +0000 (03:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 12 Sep 2002 03:19:25 +0000 (03:19 +0000)
lisp/abbrev.el

index 25bfcf705857c14aece64aeaae967260fc69a579..8e6b3ae69d8ec19ef9f9da2ba8f036754294f533 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."