From: John Wiegley Date: Fri, 13 Mar 2015 08:02:47 +0000 (-0500) Subject: Minor changes X-Git-Tag: emacs-29.0.90~1306^2~15^2~404 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f334f230eb;p=emacs.git Minor changes --- f334f230eb90011d0e774511e90948dae1d82ea1 diff --cc lisp/use-package/use-package.el index 41127b0174b,28d8587de00..450d5cf9d80 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@@ -361,27 -417,56 +417,56 @@@ For full documentation. please see comm (setq init-body `(progn ,init-body - ,@(mapcar #'(lambda (elem) - (push (cdr elem) commands) - (funcall func elem)) + ,@(mapcar (lambda (elem) + (when (not keymap) - (push (cdr elem) commands)) ++ (push (cdr elem) commands)) + (funcall func elem)) cons-list)))))))) - (funcall init-for-commands - #'(lambda (binding) - `(bind-key ,(car binding) - (quote ,(cdr binding)))) + (funcall init-for-commands-or-keymaps + (lambda (binding) + `(bind-key ,(car binding) + (lambda () (interactive) + (use-package-autoload-keymap + (quote ,(cdr binding)) + ,(if (stringp name) name `',name) + nil)))) + keymap-alist + t) + + (funcall init-for-commands-or-keymaps + (lambda (binding) + `(bind-key ,(car binding) + (lambda () (interactive) + (use-package-autoload-keymap + (quote ,(cdr binding)) + ,(if (stringp name) name `',name) + t)))) + overriding-keymap-alist + t) + + (funcall init-for-commands-or-keymaps + (lambda (binding) + `(bind-key ,(car binding) + (quote ,(cdr binding)))) keybindings-alist) - (funcall init-for-commands - #'(lambda (mode) - `(add-to-list 'auto-mode-alist - (quote ,mode))) + (funcall init-for-commands-or-keymaps + (lambda (binding) + `(bind-key* ,(car binding) + (quote ,(cdr binding)))) + overriding-keybindings-alist) + + (funcall init-for-commands-or-keymaps + (lambda (mode) + `(add-to-list 'auto-mode-alist + (quote ,mode))) mode-alist) - (funcall init-for-commands - #'(lambda (interpreter) - `(add-to-list 'interpreter-mode-alist - (quote ,interpreter))) + (funcall init-for-commands-or-keymaps + (lambda (interpreter) + `(add-to-list 'interpreter-mode-alist + (quote ,interpreter))) interpreter-alist)) `(progn @@@ -402,18 -487,22 +487,20 @@@ (eval-when-compile (when (bound-and-true-p byte-compile-current-file) ,@defines-eval - (condition-case err - ,(if (stringp name) - `(load ,name t) - `(require ',name nil t)) - (error (message "Error requiring %s: %s" ',name err) nil)))) - - ,(if (and (or commands (use-package-plist-get args :defer) - (use-package-plist-get args :bind-keymap) - (use-package-plist-get args :bind-keymap*)) + (with-demoted-errors + ,(format "Error in %s: %%S" name) + ,(if (stringp name) + `(load ,name t) + `(require ',name nil t))))) + + ,(if (and (or commands (use-package-plist-get args :defer)) (not (use-package-plist-get args :demand))) (let (form) - (mapc #'(lambda (command) - (push `(autoload (function ,command) - ,name-string nil t) form)) + (mapc (lambda (command) - (push `(unless (fboundp (quote ,command)) - (autoload (function ,command) - ,name-string nil t)) - form)) ++ (push `(unless (fboundp (quote ,command)) ++ (autoload (function ,command) ++ ,name-string nil t)) ++ form)) commands) `(when ,(or predicate t)