]> code.delx.au - gnu-emacs/blobdiff - lisp/loadhist.el
*** empty log message ***
[gnu-emacs] / lisp / loadhist.el
index 635059f93e534b467f31bc99628ea6249c2a41c5..8ca1de4aeca093aeb08ff6077258c78daaad8438 100644 (file)
@@ -1,7 +1,7 @@
 ;;; loadhist.el --- lisp functions for working with feature groups
 
-;; Copyright (C) 1995, 1998, 2000, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: FSF
@@ -119,7 +119,9 @@ return the feature \(symbol\)."
                           (mapcar (lambda (feature)
                                     (list (symbol-name feature)))
                                   features)
-                          nil t)))
+                          ;; Complete only features loaded from a file
+                          #'(lambda (f) (feature-file (intern (car f))))
+                          t)))
 
 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
 (defvar unload-feature-special-hooks
@@ -213,7 +215,7 @@ such as redefining an Emacs function."
           ;; Remove any feature names that this file provided.
           (provide
            (setq features (delq (cdr x) features)))
-          (defun
+          ((defun autoload)
            (let ((fun (cdr x)))
              (when (fboundp fun)
                (when (fboundp 'ad-unadvise)
@@ -222,8 +224,8 @@ such as redefining an Emacs function."
                  (if aload
                       (fset fun (cons 'autoload aload))
                     (fmakunbound fun))))))
-           (require nil)
-           (t (message "Unexpected element %s in load-history" x)))
+           ((t require defface) nil)
+          (t (message "Unexpected element %s in load-history" x)))
        ;; Kill local values as much as possible.
        (dolist (buf (buffer-list))
          (with-current-buffer buf
@@ -236,7 +238,9 @@ such as redefining an Emacs function."
        (unless (local-variable-if-set-p x)
          (makunbound x))))
     ;; Delete the load-history element for this file.
-    (setq load-history (delq (assoc file load-history) load-history))))
+    (setq load-history (delq (assoc file load-history) load-history)))
+  ;; Don't return load-history, it is not useful.
+  nil)
 
 (provide 'loadhist)