From 92bad2aa0589d837e48af58f09134b48b32cfbb7 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Wed, 17 Dec 2014 16:57:09 -0500 Subject: [PATCH] load-history may contain nil "filenames" * lisp/emacs-lisp/package.el (package--list-loaded-files): Handle `(nil ...)' elements in `load-history'. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a5672e52bdb..87c39447d0c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-17 Sam Steingold + + * emacs-lisp/package.el (package--list-loaded-files): Handle + `(nil ...)' elements in `load-history'. + 2014-12-17 Teodor Zlatanov * net/tramp-sh.el (tramp-histfile-override): New variable. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 60beebd8a5f..199eac5cf6c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -559,12 +559,15 @@ Return the max version (as a string) if the package is held at a lower version." "Recursively list all files in DIR which correspond to loaded features. Returns the `file-name-sans-extension' of each file, relative to DIR, sorted by most recently loaded last." - (let* ((history (mapcar (lambda (x) (file-name-sans-extension (car x))) - load-history)) + (let* ((history (delq nil + (mapcar (lambda (x) + (let ((f (car x))) + (and f (file-name-sans-extension f)))) + load-history))) (dir (file-truename dir)) ;; List all files that have already been loaded. (list-of-conflicts - (remove + (delq nil (mapcar (lambda (x) (let* ((file (file-relative-name x dir))