- (let ((tables abbrev-table-name-list))
- (while tables
- (insert-abbrev-table-description (car tables) t)
- (setq tables (cdr tables))))
- (point))))
-
-(defun list-abbrevs ()
- "Display a list of all defined abbrevs."
- (interactive)
- (display-buffer (prepare-abbrev-list-buffer)))
+ (let ((tables abbrev-table-name-list))
+ (while tables
+ (insert-abbrev-table-description (car tables) t)
+ (setq tables (cdr tables))))
+ (point))))
+
+(defun list-abbrevs (&optional local)
+ "Display a list of defined abbrevs.
+If LOCAL is non-nil, interactively when invoked with a
+prefix arg, display only local, i.e. mode-specific, abbrevs.
+Otherwise display all abbrevs."
+ (interactive "P")
+ (display-buffer (prepare-abbrev-list-buffer local)))
+
+(defun abbrev-table-name (table)
+ "Value is the name of abbrev table TABLE."
+ (let ((tables abbrev-table-name-list)
+ found)
+ (while (and (not found) tables)
+ (when (eq (symbol-value (car tables)) table)
+ (setq found (car tables)))
+ (setq tables (cdr tables)))
+ found))