summaryrefslogtreecommitdiff
path: root/lisp/abbrev.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-09-12 03:19:25 +0000
committerRichard M. Stallman <rms@gnu.org>2002-09-12 03:19:25 +0000
commitad9d51b2115f2bfdc4c7cd87c6c8c16cff0729b5 (patch)
tree67adb619147837c38d459b9f24d2f272ecc246b1 /lisp/abbrev.el
parent4af77d9fce153a410a7525f1ab99e84f73145d17 (diff)
downloademacs-ad9d51b2115f2bfdc4c7cd87c6c8c16cff0729b5.tar.gz
(copy-abbrev-table): New function.
Diffstat (limited to 'lisp/abbrev.el')
-rw-r--r--lisp/abbrev.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 25bfcf70585..8e6b3ae69d8 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -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."