From 585ed95be782d98a3ec4f5db0cf812cb31dc8083 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 28 Nov 2012 12:07:56 +0900 Subject: [PATCH] update lazyload-eval --- emacs.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/emacs.el b/emacs.el index 72704e2..37e4791 100644 --- a/emacs.el +++ b/emacs.el @@ -78,17 +78,21 @@ FEATURE is a symbol. FUNCTIONS is a list of symbols. FORM is passed to `eval-after-load'. When this macro is evaluated, this returns the path to library if feature found, otherwise returns nil." - `(progn - ,@(mapcar (lambda (f) - `(autoload (quote ,f) - ,(symbol-name (eval feature)) - "" - t)) - (eval functions)) - (eval-after-load ,feature - '(progn - ,@form)) - (locate-library ,(symbol-name (eval feature))))) + (let* ((libname (symbol-name (eval feature))) + (libpath (locate-library libname))) + `(progn + ,@(mapcar (lambda (f) + `(autoload (quote ,f) + ,libname + ,(concat "Autoloaded function defined in \"" + libpath + "\".") + t)) + (eval functions)) + (eval-after-load ,feature + '(progn + ,@form)) + ,libpath))) ;; (macroexpand '(f-autoload 'autosave '(a-f b-f) (message "1") (message "2"))) (when (lazyload-eval 'tetris