(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
(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)