]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor changes
authorJohn Wiegley <johnw@newartisans.com>
Fri, 13 Mar 2015 08:02:47 +0000 (03:02 -0500)
committerJohn Wiegley <johnw@newartisans.com>
Fri, 13 Mar 2015 08:02:47 +0000 (03:02 -0500)
1  2 
lisp/use-package/use-package.el

index 41127b0174be6c70af0ccd95580c79a34d6c2ba4,28d8587de00cecfca91b09182d937c2ab5f5b55b..450d5cf9d80a5699be16f0b914027965940712db
@@@ -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
           (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)