aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2018-06-25 12:09:44 -0700
committerGitHub2018-06-25 12:09:44 -0700
commit5fb369c96847191c3ded14fc3c1cdc462eac416c (patch)
treedf27b81e248e8dd37cdf605c962578a367e79a44
parentdc83e2f035033fa038888115a8a92f5df69b1732 (diff)
parent87e26db44f4abd2e3a076a9b6fda684921883525 (diff)
downloademacs-5fb369c96847191c3ded14fc3c1cdc462eac416c.tar.gz
emacs-5fb369c96847191c3ded14fc3c1cdc462eac416c.zip
Merge branch 'master' into patch-1
-rw-r--r--doc/misc/use-package.texi6
-rw-r--r--lisp/use-package/bind-key.el6
-rw-r--r--lisp/use-package/use-package-bind-key.el6
-rw-r--r--lisp/use-package/use-package-chords.el2
-rw-r--r--lisp/use-package/use-package-core.el84
-rw-r--r--lisp/use-package/use-package-delight.el6
-rw-r--r--lisp/use-package/use-package-diminish.el4
-rw-r--r--lisp/use-package/use-package-ensure-system-package.el26
-rw-r--r--lisp/use-package/use-package-ensure.el16
-rw-r--r--lisp/use-package/use-package-jump.el2
-rw-r--r--lisp/use-package/use-package-lint.el2
-rw-r--r--lisp/use-package/use-package.el2
-rw-r--r--test/lisp/use-package/use-package-tests.el8
13 files changed, 84 insertions, 86 deletions
diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi
index 3af91dac9fd..dfd046f1b4b 100644
--- a/doc/misc/use-package.texi
+++ b/doc/misc/use-package.texi
@@ -129,7 +129,11 @@ FAQ - Issues and Errors
129@node Introduction 129@node Introduction
130@chapter Introduction 130@chapter Introduction
131 131
132TODO 132The @code{use-package} macro allows you to isolate package configuration
133in your @file{.emacs} file in a way that is both performance-oriented and,
134well, tidy. I created it because I have over 400 packages that I use in
135Emacs, and things were getting difficult to manage. Yet with this utility
136my total load time is around 2 seconds, with no loss of functionality!
133 137
134@node Installation 138@node Installation
135@chapter Installation 139@chapter Installation
diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el
index e5cd73e9ea3..5b375a54597 100644
--- a/lisp/use-package/bind-key.el
+++ b/lisp/use-package/bind-key.el
@@ -38,6 +38,12 @@
38;; 38;;
39;; (bind-key "C-c x" 'my-ctrl-c-x-command) 39;; (bind-key "C-c x" 'my-ctrl-c-x-command)
40;; 40;;
41;; If the keybinding argument is a vector, it is passed straight to
42;; `define-key', so remapping a key with `[remap COMMAND]' works as
43;; expected:
44;;
45;; (bind-key [remap original-ctrl-c-x-command] 'my-ctrl-c-x-command)
46;;
41;; If you want the keybinding to override all minor modes that may also bind 47;; If you want the keybinding to override all minor modes that may also bind
42;; the same key, use the `bind-key*' form: 48;; the same key, use the `bind-key*' form:
43;; 49;;
diff --git a/lisp/use-package/use-package-bind-key.el b/lisp/use-package/use-package-bind-key.el
index d17ecb2cf75..10b5b483d05 100644
--- a/lisp/use-package/use-package-bind-key.el
+++ b/lisp/use-package/use-package-bind-key.el
@@ -1,4 +1,4 @@
1;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords 1;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
@@ -127,7 +127,7 @@ deferred until the prefix key sequence is pressed."
127 127
128;;;###autoload 128;;;###autoload
129(defun use-package-handler/:bind 129(defun use-package-handler/:bind
130 (name keyword args rest state &optional bind-macro) 130 (name _keyword args rest state &optional bind-macro)
131 (use-package-concat 131 (use-package-concat
132 (use-package-process-keywords name rest state) 132 (use-package-process-keywords name rest state)
133 `(,@(mapcar 133 `(,@(mapcar
@@ -148,7 +148,7 @@ deferred until the prefix key sequence is pressed."
148 148
149;;;###autoload 149;;;###autoload
150(defun use-package-handler/:bind-keymap 150(defun use-package-handler/:bind-keymap
151 (name keyword args rest state &optional override) 151 (name _keyword args rest state &optional override)
152 (use-package-concat 152 (use-package-concat
153 (use-package-process-keywords name rest state) 153 (use-package-process-keywords name rest state)
154 (mapcar 154 (mapcar
diff --git a/lisp/use-package/use-package-chords.el b/lisp/use-package/use-package-chords.el
index fbac4b59df6..478759d10c3 100644
--- a/lisp/use-package/use-package-chords.el
+++ b/lisp/use-package/use-package-chords.el
@@ -1,4 +1,4 @@
1;;; use-package-chords.el --- key-chord keyword for use-package 1;;; use-package-chords.el --- key-chord keyword for use-package -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2015-2017 Justin Talbott 3;; Copyright (C) 2015-2017 Justin Talbott
4 4
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index bd18c972303..525b478313b 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -1,4 +1,4 @@
1;;; use-package-core.el --- A configuration macro for simplifying your .emacs 1;;; use-package-core.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
@@ -47,10 +47,9 @@
47 (defsubst hash-table-keys (hash-table) 47 (defsubst hash-table-keys (hash-table)
48 "Return a list of keys in HASH-TABLE." 48 "Return a list of keys in HASH-TABLE."
49 (cl-loop for k being the hash-keys of hash-table collect k)) 49 (cl-loop for k being the hash-keys of hash-table collect k))
50 (require 'subr-x)) 50 (eval-when-compile (require 'subr-x)))
51 51
52(eval-when-compile 52(eval-when-compile
53 (require 'cl)
54 (require 'regexp-opt)) 53 (require 'regexp-opt))
55 54
56(defgroup use-package nil 55(defgroup use-package nil
@@ -300,7 +299,7 @@ include support for finding `use-package' and `require' forms.
300Must be set before loading use-package." 299Must be set before loading use-package."
301 :type 'boolean 300 :type 'boolean
302 :set 301 :set
303 #'(lambda (sym value) 302 #'(lambda (_sym value)
304 (eval-after-load 'lisp-mode 303 (eval-after-load 'lisp-mode
305 (if value 304 (if value
306 `(add-to-list 'lisp-imenu-generic-expression 305 `(add-to-list 'lisp-imenu-generic-expression
@@ -546,7 +545,7 @@ extending any keys already present."
546 name tail plist merge-function)) 545 name tail plist merge-function))
547 (use-package-error error-string)))))) 546 (use-package-error error-string))))))
548 547
549(defun use-package-unalias-keywords (name args) 548(defun use-package-unalias-keywords (_name args)
550 (setq args (cl-nsubstitute :if :when args)) 549 (setq args (cl-nsubstitute :if :when args))
551 (let (temp) 550 (let (temp)
552 (while (setq temp (plist-get args :unless)) 551 (while (setq temp (plist-get args :unless))
@@ -779,7 +778,7 @@ no more than once."
779 (setq ,loaded t ,result ,arg)))) 778 (setq ,loaded t ,result ,arg))))
780 ,@(funcall f `((funcall ,next)))))) 779 ,@(funcall f `((funcall ,next))))))
781 780
782(defsubst use-package-normalize-value (label arg) 781(defsubst use-package-normalize-value (_label arg)
783 "Normalize the Lisp value given by ARG. 782 "Normalize the Lisp value given by ARG.
784The argument LABEL is ignored." 783The argument LABEL is ignored."
785 (cond ((null arg) nil) 784 (cond ((null arg) nil)
@@ -801,7 +800,7 @@ The argument LABEL is ignored."
801 (use-package-error 800 (use-package-error
802 (concat label " wants a symbol, or list of symbols"))))) 801 (concat label " wants a symbol, or list of symbols")))))
803 802
804(defun use-package-normalize-symlist (name keyword args) 803(defun use-package-normalize-symlist (_name keyword args)
805 (use-package-as-one (symbol-name keyword) args 804 (use-package-as-one (symbol-name keyword) args
806 #'use-package-normalize-symbols)) 805 #'use-package-normalize-symbols))
807 806
@@ -817,7 +816,7 @@ The argument LABEL is ignored."
817 (use-package-error 816 (use-package-error
818 (concat label " wants a symbol, or nested list of symbols"))))) 817 (concat label " wants a symbol, or nested list of symbols")))))
819 818
820(defun use-package-normalize-recursive-symlist (name keyword args) 819(defun use-package-normalize-recursive-symlist (_name keyword args)
821 (use-package-as-one (symbol-name keyword) args 820 (use-package-as-one (symbol-name keyword) args
822 #'use-package-normalize-recursive-symbols)) 821 #'use-package-normalize-recursive-symbols))
823 822
@@ -839,7 +838,7 @@ The argument LABEL is ignored."
839 (use-package-error 838 (use-package-error
840 (concat label " wants a directory path, or list of paths"))))) 839 (concat label " wants a directory path, or list of paths")))))
841 840
842(defun use-package-normalize-predicate (name keyword args) 841(defun use-package-normalize-predicate (_name keyword args)
843 (if (null args) 842 (if (null args)
844 t 843 t
845 (use-package-only-one (symbol-name keyword) args 844 (use-package-only-one (symbol-name keyword) args
@@ -857,7 +856,7 @@ The argument LABEL is ignored."
857 (macroexpand form) 856 (macroexpand form)
858 form)) args)) 857 form)) args))
859 858
860(defun use-package-normalize-forms (name keyword args) 859(defun use-package-normalize-forms (_name keyword args)
861 (use-package-normalize-form (symbol-name keyword) args)) 860 (use-package-normalize-form (symbol-name keyword) args))
862 861
863(defun use-package-normalize-pairs 862(defun use-package-normalize-pairs
@@ -921,7 +920,7 @@ If RECURSED is non-nil, recurse into sublists."
921 (eq 'lambda (car v))) 920 (eq 'lambda (car v)))
922 v) 921 v)
923 ((and (listp v) 922 ((and (listp v)
924 (memq '(quote function) (car v)) 923 (memq (car v) '(quote function))
925 (eq 'lambda (car (cadr v)))) 924 (eq 'lambda (car (cadr v))))
926 (cadr v)) 925 (cadr v))
927 (t v))) 926 (t v)))
@@ -942,7 +941,7 @@ If RECURSED is non-nil, recurse into sublists."
942 #'use-package-recognize-function 941 #'use-package-recognize-function
943 name))) 942 name)))
944 943
945(defun use-package-autoloads-mode (name keyword args) 944(defun use-package-autoloads-mode (_name _keyword args)
946 (mapcar 945 (mapcar
947 #'(lambda (x) (cons (cdr x) 'command)) 946 #'(lambda (x) (cons (cdr x) 'command))
948 (cl-remove-if-not #'(lambda (x) 947 (cl-remove-if-not #'(lambda (x)
@@ -1055,20 +1054,21 @@ meaning:
1055 1054
1056;; Don't alias this to `ignore', as that will cause the resulting 1055;; Don't alias this to `ignore', as that will cause the resulting
1057;; function to be interactive. 1056;; function to be interactive.
1058(defun use-package-normalize/:disabled (name keyword arg)) 1057(defun use-package-normalize/:disabled (_name _keyword _arg)
1058 "Do nothing, return nil.")
1059 1059
1060(defun use-package-handler/:disabled (name keyword arg rest state) 1060(defun use-package-handler/:disabled (name _keyword _arg rest state)
1061 (use-package-process-keywords name rest state)) 1061 (use-package-process-keywords name rest state))
1062 1062
1063;;;; :if, :when and :unless 1063;;;; :if, :when and :unless
1064 1064
1065(defun use-package-normalize-test (name keyword args) 1065(defun use-package-normalize-test (_name keyword args)
1066 (use-package-only-one (symbol-name keyword) args 1066 (use-package-only-one (symbol-name keyword) args
1067 #'use-package-normalize-value)) 1067 #'use-package-normalize-value))
1068 1068
1069(defalias 'use-package-normalize/:if 'use-package-normalize-test) 1069(defalias 'use-package-normalize/:if 'use-package-normalize-test)
1070 1070
1071(defun use-package-handler/:if (name keyword pred rest state) 1071(defun use-package-handler/:if (name _keyword pred rest state)
1072 (let ((body (use-package-process-keywords name rest state))) 1072 (let ((body (use-package-process-keywords name rest state)))
1073 `((when ,pred ,@body)))) 1073 `((when ,pred ,@body))))
1074 1074
@@ -1078,7 +1078,7 @@ meaning:
1078 1078
1079(defalias 'use-package-normalize/:unless 'use-package-normalize-test) 1079(defalias 'use-package-normalize/:unless 'use-package-normalize-test)
1080 1080
1081(defun use-package-handler/:unless (name keyword pred rest state) 1081(defun use-package-handler/:unless (name _keyword pred rest state)
1082 (let ((body (use-package-process-keywords name rest state))) 1082 (let ((body (use-package-process-keywords name rest state)))
1083 `((unless ,pred ,@body)))) 1083 `((unless ,pred ,@body))))
1084 1084
@@ -1086,7 +1086,7 @@ meaning:
1086 1086
1087(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist) 1087(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist)
1088 1088
1089(defun use-package-handler/:requires (name keyword requires rest state) 1089(defun use-package-handler/:requires (name _keyword requires rest state)
1090 (let ((body (use-package-process-keywords name rest state))) 1090 (let ((body (use-package-process-keywords name rest state)))
1091 (if (null requires) 1091 (if (null requires)
1092 body 1092 body
@@ -1097,11 +1097,11 @@ meaning:
1097 1097
1098;;;; :load-path 1098;;;; :load-path
1099 1099
1100(defun use-package-normalize/:load-path (name keyword args) 1100(defun use-package-normalize/:load-path (_name keyword args)
1101 (use-package-as-one (symbol-name keyword) args 1101 (use-package-as-one (symbol-name keyword) args
1102 #'use-package-normalize-paths)) 1102 #'use-package-normalize-paths))
1103 1103
1104(defun use-package-handler/:load-path (name keyword arg rest state) 1104(defun use-package-handler/:load-path (name _keyword arg rest state)
1105 (let ((body (use-package-process-keywords name rest state))) 1105 (let ((body (use-package-process-keywords name rest state)))
1106 (use-package-concat 1106 (use-package-concat
1107 (mapcar #'(lambda (path) 1107 (mapcar #'(lambda (path)
@@ -1113,28 +1113,28 @@ meaning:
1113 1113
1114(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate) 1114(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate)
1115 1115
1116(defun use-package-handler/:no-require (name keyword arg rest state) 1116(defun use-package-handler/:no-require (name _keyword _arg rest state)
1117 (use-package-process-keywords name rest state)) 1117 (use-package-process-keywords name rest state))
1118 1118
1119;;;; :defines 1119;;;; :defines
1120 1120
1121(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist) 1121(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist)
1122 1122
1123(defun use-package-handler/:defines (name keyword arg rest state) 1123(defun use-package-handler/:defines (name _keyword _arg rest state)
1124 (use-package-process-keywords name rest state)) 1124 (use-package-process-keywords name rest state))
1125 1125
1126;;;; :functions 1126;;;; :functions
1127 1127
1128(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist) 1128(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist)
1129 1129
1130(defun use-package-handler/:functions (name keyword arg rest state) 1130(defun use-package-handler/:functions (name _keyword _arg rest state)
1131 (use-package-process-keywords name rest state)) 1131 (use-package-process-keywords name rest state))
1132 1132
1133;;;; :preface 1133;;;; :preface
1134 1134
1135(defalias 'use-package-normalize/:preface 'use-package-normalize-forms) 1135(defalias 'use-package-normalize/:preface 'use-package-normalize-forms)
1136 1136
1137(defun use-package-handler/:preface (name keyword arg rest state) 1137(defun use-package-handler/:preface (name _keyword arg rest state)
1138 (let ((body (use-package-process-keywords name rest state))) 1138 (let ((body (use-package-process-keywords name rest state)))
1139 (use-package-concat 1139 (use-package-concat
1140 (when use-package-compute-statistics 1140 (when use-package-compute-statistics
@@ -1148,14 +1148,14 @@ meaning:
1148;;;; :catch 1148;;;; :catch
1149 1149
1150(defvar use-package--form) 1150(defvar use-package--form)
1151(defvar use-package--hush-function #'(lambda (keyword body) body)) 1151(defvar use-package--hush-function #'(lambda (_keyword body) body))
1152 1152
1153(defsubst use-package-hush (context keyword body) 1153(defsubst use-package-hush (context keyword body)
1154 `((condition-case-unless-debug err 1154 `((condition-case-unless-debug err
1155 ,(macroexp-progn body) 1155 ,(macroexp-progn body)
1156 (error (funcall ,context ,keyword err))))) 1156 (error (funcall ,context ,keyword err)))))
1157 1157
1158(defun use-package-normalize/:catch (name keyword args) 1158(defun use-package-normalize/:catch (_name keyword args)
1159 (if (null args) 1159 (if (null args)
1160 t 1160 t
1161 (use-package-only-one (symbol-name keyword) args 1161 (use-package-only-one (symbol-name keyword) args
@@ -1199,7 +1199,7 @@ meaning:
1199(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode) 1199(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode)
1200(defalias 'use-package-autoloads/:interpreter 'use-package-autoloads-mode) 1200(defalias 'use-package-autoloads/:interpreter 'use-package-autoloads-mode)
1201 1201
1202(defun use-package-handler/:interpreter (name keyword arg rest state) 1202(defun use-package-handler/:interpreter (name _keyword arg rest state)
1203 (use-package-handle-mode name 'interpreter-mode-alist arg rest state)) 1203 (use-package-handle-mode name 'interpreter-mode-alist arg rest state))
1204 1204
1205;;;; :mode 1205;;;; :mode
@@ -1207,7 +1207,7 @@ meaning:
1207(defalias 'use-package-normalize/:mode 'use-package-normalize-mode) 1207(defalias 'use-package-normalize/:mode 'use-package-normalize-mode)
1208(defalias 'use-package-autoloads/:mode 'use-package-autoloads-mode) 1208(defalias 'use-package-autoloads/:mode 'use-package-autoloads-mode)
1209 1209
1210(defun use-package-handler/:mode (name keyword arg rest state) 1210(defun use-package-handler/:mode (name _keyword arg rest state)
1211 (use-package-handle-mode name 'auto-mode-alist arg rest state)) 1211 (use-package-handle-mode name 'auto-mode-alist arg rest state))
1212 1212
1213;;;; :magic 1213;;;; :magic
@@ -1215,7 +1215,7 @@ meaning:
1215(defalias 'use-package-normalize/:magic 'use-package-normalize-mode) 1215(defalias 'use-package-normalize/:magic 'use-package-normalize-mode)
1216(defalias 'use-package-autoloads/:magic 'use-package-autoloads-mode) 1216(defalias 'use-package-autoloads/:magic 'use-package-autoloads-mode)
1217 1217
1218(defun use-package-handler/:magic (name keyword arg rest state) 1218(defun use-package-handler/:magic (name _keyword arg rest state)
1219 (use-package-handle-mode name 'magic-mode-alist arg rest state)) 1219 (use-package-handle-mode name 'magic-mode-alist arg rest state))
1220 1220
1221;;;; :magic-fallback 1221;;;; :magic-fallback
@@ -1223,7 +1223,7 @@ meaning:
1223(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode) 1223(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode)
1224(defalias 'use-package-autoloads/:magic-fallback 'use-package-autoloads-mode) 1224(defalias 'use-package-autoloads/:magic-fallback 'use-package-autoloads-mode)
1225 1225
1226(defun use-package-handler/:magic-fallback (name keyword arg rest state) 1226(defun use-package-handler/:magic-fallback (name _keyword arg rest state)
1227 (use-package-handle-mode name 'magic-fallback-mode-alist arg rest state)) 1227 (use-package-handle-mode name 'magic-fallback-mode-alist arg rest state))
1228 1228
1229;;;; :hook 1229;;;; :hook
@@ -1250,7 +1250,7 @@ meaning:
1250 1250
1251(defalias 'use-package-autoloads/:hook 'use-package-autoloads-mode) 1251(defalias 'use-package-autoloads/:hook 'use-package-autoloads-mode)
1252 1252
1253(defun use-package-handler/:hook (name keyword args rest state) 1253(defun use-package-handler/:hook (name _keyword args rest state)
1254 "Generate use-package custom keyword code." 1254 "Generate use-package custom keyword code."
1255 (use-package-concat 1255 (use-package-concat
1256 (use-package-process-keywords name rest state) 1256 (use-package-process-keywords name rest state)
@@ -1273,7 +1273,7 @@ meaning:
1273 1273
1274(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist) 1274(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist)
1275 1275
1276(defun use-package-handler/:commands (name keyword arg rest state) 1276(defun use-package-handler/:commands (name _keyword arg rest state)
1277 (use-package-concat 1277 (use-package-concat
1278 ;; Since we deferring load, establish any necessary autoloads, and also 1278 ;; Since we deferring load, establish any necessary autoloads, and also
1279 ;; keep the byte-compiler happy. 1279 ;; keep the byte-compiler happy.
@@ -1295,7 +1295,7 @@ meaning:
1295 1295
1296(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate) 1296(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate)
1297 1297
1298(defun use-package-handler/:defer (name keyword arg rest state) 1298(defun use-package-handler/:defer (name _keyword arg rest state)
1299 (let ((body (use-package-process-keywords name rest state))) 1299 (let ((body (use-package-process-keywords name rest state)))
1300 (use-package-concat 1300 (use-package-concat
1301 ;; Load the package after a set amount of idle time, if the argument to 1301 ;; Load the package after a set amount of idle time, if the argument to
@@ -1351,7 +1351,7 @@ no keyword implies `:all'."
1351 ((listp features) 1351 ((listp features)
1352 (use-package-require-after-load (cons :all features) body)))) 1352 (use-package-require-after-load (cons :all features) body))))
1353 1353
1354(defun use-package-handler/:after (name keyword arg rest state) 1354(defun use-package-handler/:after (name _keyword arg rest state)
1355 (let ((body (use-package-process-keywords name rest state)) 1355 (let ((body (use-package-process-keywords name rest state))
1356 (uses (use-package-after-count-uses arg))) 1356 (uses (use-package-after-count-uses arg)))
1357 (if (or (null uses) (null body)) 1357 (if (or (null uses) (null body))
@@ -1366,12 +1366,12 @@ no keyword implies `:all'."
1366 1366
1367(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate) 1367(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate)
1368 1368
1369(defun use-package-handler/:demand (name keyword arg rest state) 1369(defun use-package-handler/:demand (name _keyword _arg rest state)
1370 (use-package-process-keywords name rest state)) 1370 (use-package-process-keywords name rest state))
1371 1371
1372;;;; :custom 1372;;;; :custom
1373 1373
1374(defun use-package-normalize/:custom (name keyword args) 1374(defun use-package-normalize/:custom (_name keyword args)
1375 "Normalize use-package custom keyword." 1375 "Normalize use-package custom keyword."
1376 (use-package-as-one (symbol-name keyword) args 1376 (use-package-as-one (symbol-name keyword) args
1377 #'(lambda (label arg) 1377 #'(lambda (label arg)
@@ -1383,7 +1383,7 @@ no keyword implies `:all'."
1383 (list arg) 1383 (list arg)
1384 arg)))) 1384 arg))))
1385 1385
1386(defun use-package-handler/:custom (name keyword args rest state) 1386(defun use-package-handler/:custom (name _keyword args rest state)
1387 "Generate use-package custom keyword code." 1387 "Generate use-package custom keyword code."
1388 (use-package-concat 1388 (use-package-concat
1389 (mapcar 1389 (mapcar
@@ -1399,7 +1399,7 @@ no keyword implies `:all'."
1399 1399
1400;;;; :custom-face 1400;;;; :custom-face
1401 1401
1402(defun use-package-normalize/:custom-face (name-symbol keyword arg) 1402(defun use-package-normalize/:custom-face (name-symbol _keyword arg)
1403 "Normalize use-package custom-face keyword." 1403 "Normalize use-package custom-face keyword."
1404 (let ((error-msg 1404 (let ((error-msg
1405 (format "%s wants a (<symbol> <face-spec>) or list of these" 1405 (format "%s wants a (<symbol> <face-spec>) or list of these"
@@ -1416,7 +1416,7 @@ no keyword implies `:all'."
1416 (> (length def) 2)) 1416 (> (length def) 2))
1417 (use-package-error error-msg)))))) 1417 (use-package-error error-msg))))))
1418 1418
1419(defun use-package-handler/:custom-face (name keyword args rest state) 1419(defun use-package-handler/:custom-face (name _keyword args rest state)
1420 "Generate use-package custom-face keyword code." 1420 "Generate use-package custom-face keyword code."
1421 (use-package-concat 1421 (use-package-concat
1422 (mapcar #'(lambda (def) `(custom-set-faces (quote ,def))) args) 1422 (mapcar #'(lambda (def) `(custom-set-faces (quote ,def))) args)
@@ -1426,7 +1426,7 @@ no keyword implies `:all'."
1426 1426
1427(defalias 'use-package-normalize/:init 'use-package-normalize-forms) 1427(defalias 'use-package-normalize/:init 'use-package-normalize-forms)
1428 1428
1429(defun use-package-handler/:init (name keyword arg rest state) 1429(defun use-package-handler/:init (name _keyword arg rest state)
1430 (use-package-concat 1430 (use-package-concat
1431 (when use-package-compute-statistics 1431 (when use-package-compute-statistics
1432 `((use-package-statistics-gather :init ',name nil))) 1432 `((use-package-statistics-gather :init ',name nil)))
@@ -1451,7 +1451,7 @@ no keyword implies `:all'."
1451 args 1451 args
1452 (list args))) 1452 (list args)))
1453 1453
1454(defun use-package-handler/:load (name keyword arg rest state) 1454(defun use-package-handler/:load (name _keyword arg rest state)
1455 (let ((body (use-package-process-keywords name rest state))) 1455 (let ((body (use-package-process-keywords name rest state)))
1456 (cl-dolist (pkg arg) 1456 (cl-dolist (pkg arg)
1457 (setq body (use-package-require (if (eq t pkg) name pkg) nil body))) 1457 (setq body (use-package-require (if (eq t pkg) name pkg) nil body)))
@@ -1461,7 +1461,7 @@ no keyword implies `:all'."
1461 1461
1462(defalias 'use-package-normalize/:config 'use-package-normalize-forms) 1462(defalias 'use-package-normalize/:config 'use-package-normalize-forms)
1463 1463
1464(defun use-package-handler/:config (name keyword arg rest state) 1464(defun use-package-handler/:config (name _keyword arg rest state)
1465 (let* ((body (use-package-process-keywords name rest state)) 1465 (let* ((body (use-package-process-keywords name rest state))
1466 (name-symbol (use-package-as-symbol name))) 1466 (name-symbol (use-package-as-symbol name)))
1467 (use-package-concat 1467 (use-package-concat
diff --git a/lisp/use-package/use-package-delight.el b/lisp/use-package/use-package-delight.el
index 9d4f6acf2de..85d5c7cb4d6 100644
--- a/lisp/use-package/use-package-delight.el
+++ b/lisp/use-package/use-package-delight.el
@@ -1,4 +1,4 @@
1;;; use-package-delight.el --- Support for the :delight keyword 1;;; use-package-delight.el --- Support for the :delight keyword -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
@@ -52,7 +52,7 @@
52 ":delight expects `delight' arguments or a list of them")))) 52 ":delight expects `delight' arguments or a list of them"))))
53 53
54;;;###autoload 54;;;###autoload
55(defun use-package-normalize/:delight (name keyword args) 55(defun use-package-normalize/:delight (name _keyword args)
56 "Normalize arguments to delight." 56 "Normalize arguments to delight."
57 (cond ((null args) 57 (cond ((null args)
58 `((,(use-package-as-mode name) nil ,name))) 58 `((,(use-package-as-mode name) nil ,name)))
@@ -77,7 +77,7 @@
77 args))))) 77 args)))))
78 78
79;;;###autoload 79;;;###autoload
80(defun use-package-handler/:delight (name keyword args rest state) 80(defun use-package-handler/:delight (name _keyword args rest state)
81 (let ((body (use-package-process-keywords name rest state))) 81 (let ((body (use-package-process-keywords name rest state)))
82 (use-package-concat 82 (use-package-concat
83 body 83 body
diff --git a/lisp/use-package/use-package-diminish.el b/lisp/use-package/use-package-diminish.el
index c2da62257e6..1f3895f42cd 100644
--- a/lisp/use-package/use-package-diminish.el
+++ b/lisp/use-package/use-package-diminish.el
@@ -1,4 +1,4 @@
1;;; use-package-diminish.el --- Support for the :diminish keyword 1;;; use-package-diminish.el --- Support for the :diminish keyword -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
@@ -62,7 +62,7 @@
62 (apply-partially #'use-package-normalize-diminish name) t)) 62 (apply-partially #'use-package-normalize-diminish name) t))
63 63
64;;;###autoload 64;;;###autoload
65(defun use-package-handler/:diminish (name keyword arg rest state) 65(defun use-package-handler/:diminish (name _keyword arg rest state)
66 (let ((body (use-package-process-keywords name rest state))) 66 (let ((body (use-package-process-keywords name rest state)))
67 (use-package-concat 67 (use-package-concat
68 (mapcar #'(lambda (var) 68 (mapcar #'(lambda (var)
diff --git a/lisp/use-package/use-package-ensure-system-package.el b/lisp/use-package/use-package-ensure-system-package.el
index 81beaec104f..476a4f2b930 100644
--- a/lisp/use-package/use-package-ensure-system-package.el
+++ b/lisp/use-package/use-package-ensure-system-package.el
@@ -1,4 +1,4 @@
1;;; use-package-ensure-system-package.el --- auto install system packages -*- lexical: t; -*- 1;;; use-package-ensure-system-package.el --- auto install system packages -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2017 Justin Talbott 3;; Copyright (C) 2017 Justin Talbott
4 4
@@ -6,7 +6,7 @@
6;; Keywords: convenience, tools, extensions 6;; Keywords: convenience, tools, extensions
7;; URL: https://github.com/waymondo/use-package-ensure-system-package 7;; URL: https://github.com/waymondo/use-package-ensure-system-package
8;; Version: 0.1 8;; Version: 0.1
9;; Package-Requires: ((use-package "2.1") (system-packages "0.1")) 9;; Package-Requires: ((use-package "2.1") (system-packages "1.0.4"))
10;; Filename: use-package-ensure-system-package.el 10;; Filename: use-package-ensure-system-package.el
11;; License: GNU General Public License version 3, or (at your option) any later version 11;; License: GNU General Public License version 3, or (at your option) any later version
12;; 12;;
@@ -23,23 +23,11 @@
23(require 'system-packages nil t) 23(require 'system-packages nil t)
24 24
25(eval-when-compile 25(eval-when-compile
26 (defvar system-packages-package-manager) 26 (declare-function system-packages-get-command "system-packages"))
27 (defvar system-packages-supported-package-managers)
28 (defvar system-packages-use-sudo))
29 27
30(defun use-package-ensure-system-package-install-command (pack) 28(defun use-package-ensure-system-package-install-command (pack)
31 "Return the default install command for PACK." 29 "Return the default install command for PACK."
32 (let ((command 30 (system-packages-get-command 'install pack))
33 (cdr (assoc 'install (cdr (assoc system-packages-package-manager
34 system-packages-supported-package-managers))))))
35 (unless command
36 (error (format "%S not supported in %S" 'install system-packages-package-manager)))
37 (unless (listp command)
38 (setq command (list command)))
39 (when system-packages-use-sudo
40 (setq command (mapcar (lambda (part) (concat "sudo " part)) command)))
41 (setq command (mapconcat 'identity command " && "))
42 (mapconcat 'identity (list command pack) " ")))
43 31
44(defun use-package-ensure-system-package-consify (arg) 32(defun use-package-ensure-system-package-consify (arg)
45 "Turn `arg' into a cons of (`package-name' . `install-command')." 33 "Turn `arg' into a cons of (`package-name' . `install-command')."
@@ -55,10 +43,10 @@
55 (use-package-ensure-system-package-install-command (symbol-name (cdr arg)))))))) 43 (use-package-ensure-system-package-install-command (symbol-name (cdr arg))))))))
56 44
57;;;###autoload 45;;;###autoload
58(defun use-package-normalize/:ensure-system-package (name-symbol keyword args) 46(defun use-package-normalize/:ensure-system-package (_name-symbol keyword args)
59 "Turn `arg' into a list of cons-es of (`package-name' . `install-command')." 47 "Turn `arg' into a list of cons-es of (`package-name' . `install-command')."
60 (use-package-only-one (symbol-name keyword) args 48 (use-package-only-one (symbol-name keyword) args
61 (lambda (label arg) 49 (lambda (_label arg)
62 (cond 50 (cond
63 ((and (listp arg) (listp (cdr arg))) 51 ((and (listp arg) (listp (cdr arg)))
64 (mapcar #'use-package-ensure-system-package-consify arg)) 52 (mapcar #'use-package-ensure-system-package-consify arg))
@@ -66,7 +54,7 @@
66 (list (use-package-ensure-system-package-consify arg))))))) 54 (list (use-package-ensure-system-package-consify arg)))))))
67 55
68;;;###autoload 56;;;###autoload
69(defun use-package-handler/:ensure-system-package (name keyword arg rest state) 57(defun use-package-handler/:ensure-system-package (name _keyword arg rest state)
70 "Execute the handler for `:ensure-system-package' keyword in `use-package'." 58 "Execute the handler for `:ensure-system-package' keyword in `use-package'."
71 (let ((body (use-package-process-keywords name rest state))) 59 (let ((body (use-package-process-keywords name rest state)))
72 (use-package-concat 60 (use-package-concat
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 1a76b883e1c..50005a9e990 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -1,4 +1,4 @@
1;;; use-package-ensure.el --- Support for the :ensure and :pin keywords 1;;; use-package-ensure.el --- Support for the :ensure and :pin keywords -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
@@ -76,9 +76,9 @@ The default value uses package.el to install the package."
76 76
77;;;; :pin 77;;;; :pin
78 78
79(defun use-package-normalize/:pin (name keyword args) 79(defun use-package-normalize/:pin (_name keyword args)
80 (use-package-only-one (symbol-name keyword) args 80 (use-package-only-one (symbol-name keyword) args
81 #'(lambda (label arg) 81 #'(lambda (_label arg)
82 (cond 82 (cond
83 ((stringp arg) arg) 83 ((stringp arg) arg)
84 ((use-package-non-nil-symbolp arg) (symbol-name arg)) 84 ((use-package-non-nil-symbolp arg) (symbol-name arg))
@@ -116,7 +116,7 @@ manually updated package."
116 (unless (bound-and-true-p package--initialized) 116 (unless (bound-and-true-p package--initialized)
117 (package-initialize t)))) 117 (package-initialize t))))
118 118
119(defun use-package-handler/:pin (name keyword archive-name rest state) 119(defun use-package-handler/:pin (name _keyword archive-name rest state)
120 (let ((body (use-package-process-keywords name rest state)) 120 (let ((body (use-package-process-keywords name rest state))
121 (pin-form (if archive-name 121 (pin-form (if archive-name
122 `(use-package-pin-package ',(use-package-as-symbol name) 122 `(use-package-pin-package ',(use-package-as-symbol name)
@@ -133,11 +133,11 @@ manually updated package."
133(defvar package-archive-contents) 133(defvar package-archive-contents)
134 134
135;;;###autoload 135;;;###autoload
136(defun use-package-normalize/:ensure (name keyword args) 136(defun use-package-normalize/:ensure (_name keyword args)
137 (if (null args) 137 (if (null args)
138 (list t) 138 (list t)
139 (use-package-only-one (symbol-name keyword) args 139 (use-package-only-one (symbol-name keyword) args
140 #'(lambda (label arg) 140 #'(lambda (_label arg)
141 (cond 141 (cond
142 ((symbolp arg) 142 ((symbolp arg)
143 (list arg)) 143 (list arg))
@@ -152,7 +152,7 @@ manually updated package."
152 (concat ":ensure wants an optional package name " 152 (concat ":ensure wants an optional package name "
153 "(an unquoted symbol name), or (<symbol> :pin <string>)")))))))) 153 "(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
154 154
155(defun use-package-ensure-elpa (name args state &optional no-refresh) 155(defun use-package-ensure-elpa (name args _state &optional _no-refresh)
156 (dolist (ensure args) 156 (dolist (ensure args)
157 (let ((package 157 (let ((package
158 (or (and (eq ensure t) (use-package-as-symbol name)) 158 (or (and (eq ensure t) (use-package-as-symbol name))
@@ -183,7 +183,7 @@ manually updated package."
183 :error)))))))) 183 :error))))))))
184 184
185;;;###autoload 185;;;###autoload
186(defun use-package-handler/:ensure (name keyword ensure rest state) 186(defun use-package-handler/:ensure (name _keyword ensure rest state)
187 (let* ((body (use-package-process-keywords name rest state))) 187 (let* ((body (use-package-process-keywords name rest state)))
188 ;; We want to avoid installing packages when the `use-package' macro is 188 ;; We want to avoid installing packages when the `use-package' macro is
189 ;; being macro-expanded by elisp completion (see `lisp--local-variables'), 189 ;; being macro-expanded by elisp completion (see `lisp--local-variables'),
diff --git a/lisp/use-package/use-package-jump.el b/lisp/use-package/use-package-jump.el
index 31d1b054060..4044ad16564 100644
--- a/lisp/use-package/use-package-jump.el
+++ b/lisp/use-package/use-package-jump.el
@@ -1,4 +1,4 @@
1;;; use-package-jump.el --- Attempt to jump to a use-package declaration 1;;; use-package-jump.el --- Attempt to jump to a use-package declaration -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
diff --git a/lisp/use-package/use-package-lint.el b/lisp/use-package/use-package-lint.el
index 53c682842f9..c6e7c3c0ce2 100644
--- a/lisp/use-package/use-package-lint.el
+++ b/lisp/use-package/use-package-lint.el
@@ -1,4 +1,4 @@
1;;; use-package-lint.el --- Attempt to find errors in use-package declarations 1;;; use-package-lint.el --- Attempt to find errors in use-package declarations -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index 5f98db1bed7..1a8fff895f6 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -1,4 +1,4 @@
1;;; use-package.el --- A configuration macro for simplifying your .emacs 1;;; use-package.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2012-2017 John Wiegley 3;; Copyright (C) 2012-2017 John Wiegley
4 4
diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el
index fc86fa63f81..c4030b04608 100644
--- a/test/lisp/use-package/use-package-tests.el
+++ b/test/lisp/use-package/use-package-tests.el
@@ -1,4 +1,4 @@
1;;; use-package-tests.el --- Tests for use-package.el 1;;; use-package-tests.el --- Tests for use-package.el -*- lexical-binding: t; -*-
2 2
3;; This program is free software; you can redistribute it and/or 3;; This program is free software; you can redistribute it and/or
4;; modify it under the terms of the GNU General Public License as 4;; modify it under the terms of the GNU General Public License as
@@ -132,9 +132,9 @@
132 (should (equal (use-package-normalize-function t) t)) 132 (should (equal (use-package-normalize-function t) t))
133 (should (equal (use-package-normalize-function 'sym) 'sym)) 133 (should (equal (use-package-normalize-function 'sym) 'sym))
134 (should (equal (use-package-normalize-function #'sym) 'sym)) 134 (should (equal (use-package-normalize-function #'sym) 'sym))
135 (should (equal (use-package-normalize-function (lambda () ...)) (lambda () ...))) 135 (should (equal (use-package-normalize-function '(lambda () ...)) '(lambda () ...)))
136 (should (equal (use-package-normalize-function '(lambda () ...)) (lambda () ...))) 136 (should (equal (use-package-normalize-function ''(lambda () ...)) '(lambda () ...)))
137 (should (equal (use-package-normalize-function #'(lambda () ...)) (lambda () ...))) 137 (should (equal (use-package-normalize-function '#'(lambda () ...)) '(lambda () ...)))
138 138
139 (should (equal (use-package-normalize-function 1) 1)) 139 (should (equal (use-package-normalize-function 1) 1))
140 (should (equal (use-package-normalize-function "Hello") "Hello")) 140 (should (equal (use-package-normalize-function "Hello") "Hello"))