]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
Make autoloads populate a new definition-prefixes table
[gnu-emacs] / lisp / subr.el
index 438f00a6f134c2ccf54fddf4342b6dabc7792ab4..b5d6f6fa01b2828aadd2e299fc485200fa7ecf23 100644 (file)
@@ -5150,6 +5150,17 @@ as a list.")
 
 \f
 ;;; Misc.
+
+(defvar definition-prefixes (make-hash-table :test 'equal)
+  "Hash table mapping prefixes to the files in which they're used.
+This can be used to automatically fetch not-yet-loaded definitions.")
+
+(defun register-definition-prefixes (file prefixes)
+  "Register that FILE uses PREFIXES."
+  (dolist (prefix prefixes)
+    (puthash prefix (cons file (gethash prefix definition-prefixes))
+             definition-prefixes)))
+
 (defconst menu-bar-separator '("--")
   "Separator for menus.")