diff options
| author | John Wiegley | 2022-11-15 09:21:07 -0800 |
|---|---|---|
| committer | John Wiegley | 2022-11-15 09:21:07 -0800 |
| commit | 49fffe7cf4beb7b35d90758f4e6c24ebfe3615e1 (patch) | |
| tree | 3b7699e4ffab2312c14f697da11059409ba4b86c /lisp/use-package | |
| parent | ec96b4766418fdfce2d7827fa6ddeb7257ad6cf7 (diff) | |
| parent | cf8ab8b52eae65a108d899e896e1171355122bb7 (diff) | |
| download | emacs-49fffe7cf4beb7b35d90758f4e6c24ebfe3615e1.tar.gz emacs-49fffe7cf4beb7b35d90758f4e6c24ebfe3615e1.zip | |
Merge remote-tracking branch 'origin/master' into pr-830
Diffstat (limited to 'lisp/use-package')
| -rw-r--r-- | lisp/use-package/bind-chord.el | 2 | ||||
| -rw-r--r-- | lisp/use-package/bind-key.el | 24 | ||||
| -rw-r--r-- | lisp/use-package/use-package-bind-key.el | 4 | ||||
| -rw-r--r-- | lisp/use-package/use-package-chords.el | 2 | ||||
| -rw-r--r-- | lisp/use-package/use-package-core.el | 112 | ||||
| -rw-r--r-- | lisp/use-package/use-package-delight.el | 2 | ||||
| -rw-r--r-- | lisp/use-package/use-package-diminish.el | 2 | ||||
| -rw-r--r-- | lisp/use-package/use-package-ensure-system-package.el | 6 | ||||
| -rw-r--r-- | lisp/use-package/use-package-ensure.el | 8 | ||||
| -rw-r--r-- | lisp/use-package/use-package-jump.el | 15 | ||||
| -rw-r--r-- | lisp/use-package/use-package-lint.el | 4 | ||||
| -rw-r--r-- | lisp/use-package/use-package.el | 4 |
12 files changed, 109 insertions, 76 deletions
diff --git a/lisp/use-package/bind-chord.el b/lisp/use-package/bind-chord.el index d69a724df66..d592736e227 100644 --- a/lisp/use-package/bind-chord.el +++ b/lisp/use-package/bind-chord.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; bind-chord.el --- key-chord binding helper for use-package-chords -*- lexical-binding: t; -*- | 1 | ;;; bind-chord.el --- key-chord binding helper for use-package-chords -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2015-2019 Justin Talbott | 3 | ;; Copyright (C) 2015-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Justin Talbott <justin@waymondo.com> | 5 | ;; Author: Justin Talbott <justin@waymondo.com> |
| 6 | ;; Keywords: convenience, tools, extensions | 6 | ;; Keywords: convenience, tools, extensions |
diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index 5060e16ddf9..b02b7a4ad9f 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; bind-key.el --- A simple way to manage personal keybindings -*- lexical-binding: t; -*- | 1 | ;;; bind-key.el --- A simple way to manage personal keybindings -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (c) 2012-2017 John Wiegley | 3 | ;; Copyright (c) 2012-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| 7 | ;; Created: 16 Jun 2012 | 7 | ;; Created: 16 Jun 2012 |
| 8 | ;; Modified: 29 Nov 2017 | 8 | ;; Modified: 29 Nov 2017 |
| 9 | ;; Version: 2.4 | 9 | ;; Version: 2.4.1 |
| 10 | ;; Keywords: keys keybinding config dotemacs | 10 | ;; Keywords: keys keybinding config dotemacs |
| 11 | ;; URL: https://github.com/jwiegley/use-package | 11 | ;; URL: https://github.com/jwiegley/use-package |
| 12 | 12 | ||
| @@ -29,7 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | ;; If you have lots of keybindings set in your .emacs file, it can be hard to | 30 | ;; If you have lots of keybindings set in your .emacs file, it can be hard to |
| 31 | ;; know which ones you haven't set yet, and which may now be overriding some | 31 | ;; know which ones you haven't set yet, and which may now be overriding some |
| 32 | ;; new default in a new emacs version. This module aims to solve that | 32 | ;; new default in a new Emacs version. This module aims to solve that |
| 33 | ;; problem. | 33 | ;; problem. |
| 34 | ;; | 34 | ;; |
| 35 | ;; Bind keys as follows in your .emacs: | 35 | ;; Bind keys as follows in your .emacs: |
| @@ -104,7 +104,7 @@ | |||
| 104 | (require 'easy-mmode) | 104 | (require 'easy-mmode) |
| 105 | 105 | ||
| 106 | (defgroup bind-key nil | 106 | (defgroup bind-key nil |
| 107 | "A simple way to manage personal keybindings" | 107 | "A simple way to manage personal keybindings." |
| 108 | :group 'emacs) | 108 | :group 'emacs) |
| 109 | 109 | ||
| 110 | (defcustom bind-key-column-widths '(18 . 40) | 110 | (defcustom bind-key-column-widths '(18 . 40) |
| @@ -127,7 +127,7 @@ | |||
| 127 | ;; Create override-global-mode to force key remappings | 127 | ;; Create override-global-mode to force key remappings |
| 128 | 128 | ||
| 129 | (defvar override-global-map (make-keymap) | 129 | (defvar override-global-map (make-keymap) |
| 130 | "override-global-mode keymap") | 130 | "Keymap for `override-global-mode'.") |
| 131 | 131 | ||
| 132 | (define-minor-mode override-global-mode | 132 | (define-minor-mode override-global-mode |
| 133 | "A minor mode so that keymap settings override other modes." | 133 | "A minor mode so that keymap settings override other modes." |
| @@ -150,7 +150,7 @@ Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)") | |||
| 150 | 150 | ||
| 151 | KEY-NAME may be a vector, in which case it is passed straight to | 151 | KEY-NAME may be a vector, in which case it is passed straight to |
| 152 | `define-key'. Or it may be a string to be interpreted as | 152 | `define-key'. Or it may be a string to be interpreted as |
| 153 | spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of | 153 | spelled-out keystrokes, e.g., `C-c C-z'. See documentation of |
| 154 | `edmacro-mode' for details. | 154 | `edmacro-mode' for details. |
| 155 | 155 | ||
| 156 | COMMAND must be an interactive function or lambda form. | 156 | COMMAND must be an interactive function or lambda form. |
| @@ -223,11 +223,11 @@ See `bind-key' for more details." | |||
| 223 | In contrast to `define-key', this function removes the binding from the keymap." | 223 | In contrast to `define-key', this function removes the binding from the keymap." |
| 224 | (define-key keymap key nil) | 224 | (define-key keymap key nil) |
| 225 | ;; Split M-key in ESC key | 225 | ;; Split M-key in ESC key |
| 226 | (setq key (mapcan (lambda (k) | 226 | (setq key (cl-mapcan (lambda (k) |
| 227 | (if (and (integerp k) (/= (logand k ?\M-\0) 0)) | 227 | (if (and (integerp k) (/= (logand k ?\M-\0) 0)) |
| 228 | (list ?\e (logxor k ?\M-\0)) | 228 | (list ?\e (logxor k ?\M-\0)) |
| 229 | (list k))) | 229 | (list k))) |
| 230 | key)) | 230 | key)) |
| 231 | ;; Delete single keys directly | 231 | ;; Delete single keys directly |
| 232 | (if (= (length key) 1) | 232 | (if (= (length key) 1) |
| 233 | (delete key keymap) | 233 | (delete key keymap) |
| @@ -241,7 +241,7 @@ In contrast to `define-key', this function removes the binding from the keymap." | |||
| 241 | (delete (last key) submap) | 241 | (delete (last key) submap) |
| 242 | ;; Delete submap if it is empty | 242 | ;; Delete submap if it is empty |
| 243 | (when (= 1 (length submap)) | 243 | (when (= 1 (length submap)) |
| 244 | (bind-key--remove prefix keymap))))) | 244 | (bind-key--remove prefix keymap))))) |
| 245 | 245 | ||
| 246 | ;;;###autoload | 246 | ;;;###autoload |
| 247 | (defmacro bind-key* (key-name command &optional predicate) | 247 | (defmacro bind-key* (key-name command &optional predicate) |
diff --git a/lisp/use-package/use-package-bind-key.el b/lisp/use-package/use-package-bind-key.el index 7c79f450831..460d6255e93 100644 --- a/lisp/use-package/use-package-bind-key.el +++ b/lisp/use-package/use-package-bind-key.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| @@ -29,7 +29,7 @@ | |||
| 29 | ;;; Commentary: | 29 | ;;; Commentary: |
| 30 | 30 | ||
| 31 | ;; Provides support for the :bind, :bind*, :bind-keymap and :bind-keymap* | 31 | ;; Provides support for the :bind, :bind*, :bind-keymap and :bind-keymap* |
| 32 | ;; keywords. Note that these are currently still baked into | 32 | ;; keywords. Note that these are currently still baked into |
| 33 | ;; `use-package-keywords' and `use-package-deferring-keywords', although this | 33 | ;; `use-package-keywords' and `use-package-deferring-keywords', although this |
| 34 | ;; is harmless if they are never used. | 34 | ;; is harmless if they are never used. |
| 35 | 35 | ||
diff --git a/lisp/use-package/use-package-chords.el b/lisp/use-package/use-package-chords.el index cf390dbe593..4a4d9e7fea7 100644 --- a/lisp/use-package/use-package-chords.el +++ b/lisp/use-package/use-package-chords.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-chords.el --- key-chord keyword for use-package -*- lexical-binding: t; -*- | 1 | ;;; use-package-chords.el --- key-chord keyword for use-package -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2015-2019 Justin Talbott | 3 | ;; Copyright (C) 2015-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Justin Talbott <justin@waymondo.com> | 5 | ;; Author: Justin Talbott <justin@waymondo.com> |
| 6 | ;; Keywords: convenience, tools, extensions | 6 | ;; Keywords: convenience, tools, extensions |
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index dc9b77bc5bf..429b108ac71 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; use-package-core.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| 7 | ;; Created: 17 Jun 2012 | 7 | ;; Created: 17 Jun 2012 |
| 8 | ;; Modified: 29 Nov 2017 | 8 | ;; Modified: 29 Nov 2017 |
| 9 | ;; Version: 2.4.1 | 9 | ;; Version: 2.4.4 |
| 10 | ;; Package-Requires: ((emacs "24.3")) | 10 | ;; Package-Requires: ((emacs "24.3")) |
| 11 | ;; Keywords: dotemacs startup speed config package | 11 | ;; Keywords: dotemacs startup speed config package |
| 12 | ;; URL: https://github.com/jwiegley/use-package | 12 | ;; URL: https://github.com/jwiegley/use-package |
| @@ -53,21 +53,28 @@ | |||
| 53 | ;; iterating over them to "disable all themes" won't disable it. | 53 | ;; iterating over them to "disable all themes" won't disable it. |
| 54 | (setq custom-enabled-themes (remq 'use-package custom-enabled-themes)) | 54 | (setq custom-enabled-themes (remq 'use-package custom-enabled-themes)) |
| 55 | 55 | ||
| 56 | (if (and (eq emacs-major-version 24) (eq emacs-minor-version 3)) | 56 | (eval-when-compile |
| 57 | (defsubst hash-table-keys (hash-table) | 57 | (if (and (eq emacs-major-version 24) (eq emacs-minor-version 3)) |
| 58 | "Return a list of keys in HASH-TABLE." | 58 | (progn |
| 59 | (cl-loop for k being the hash-keys of hash-table collect k)) | 59 | (defsubst hash-table-keys (hash-table) |
| 60 | (eval-when-compile (require 'subr-x))) | 60 | "Return a list of keys in HASH-TABLE." |
| 61 | (cl-loop for k being the hash-keys of hash-table collect k)) | ||
| 62 | (defsubst string-suffix-p (suffix string &optional ignore-case) | ||
| 63 | (let ((start-pos (- (length string) (length suffix)))) | ||
| 64 | (and (>= start-pos 0) | ||
| 65 | (eq t (compare-strings suffix nil nil | ||
| 66 | string start-pos nil ignore-case)))))) | ||
| 67 | (require 'subr-x))) | ||
| 61 | 68 | ||
| 62 | (eval-when-compile | 69 | (eval-when-compile |
| 63 | (require 'regexp-opt)) | 70 | (require 'regexp-opt)) |
| 64 | 71 | ||
| 65 | (defgroup use-package nil | 72 | (defgroup use-package nil |
| 66 | "A use-package declaration for simplifying your `.emacs'." | 73 | "A `use-package' declaration for simplifying your `.emacs'." |
| 67 | :group 'startup) | 74 | :group 'startup) |
| 68 | 75 | ||
| 69 | (defconst use-package-version "2.4.1" | 76 | (defconst use-package-version "2.4.4" |
| 70 | "This version of use-package.") | 77 | "This version of `use-package'.") |
| 71 | 78 | ||
| 72 | (defcustom use-package-keywords | 79 | (defcustom use-package-keywords |
| 73 | '(:disabled | 80 | '(:disabled |
| @@ -94,6 +101,7 @@ | |||
| 94 | ;; Any other keyword that also declares commands to be autoloaded (such as | 101 | ;; Any other keyword that also declares commands to be autoloaded (such as |
| 95 | ;; :bind) must appear before this keyword. | 102 | ;; :bind) must appear before this keyword. |
| 96 | :commands | 103 | :commands |
| 104 | :autoload | ||
| 97 | :init | 105 | :init |
| 98 | :defer | 106 | :defer |
| 99 | :demand | 107 | :demand |
| @@ -105,13 +113,13 @@ | |||
| 105 | "The set of valid keywords, in the order they are processed in. | 113 | "The set of valid keywords, in the order they are processed in. |
| 106 | The order of this list is *very important*, so it is only | 114 | The order of this list is *very important*, so it is only |
| 107 | advisable to insert new keywords, never to delete or reorder | 115 | advisable to insert new keywords, never to delete or reorder |
| 108 | them. Further, attention should be paid to the NEWS.md if the | 116 | them. Further, attention should be paid to the NEWS.md if the |
| 109 | default order ever changes, as they may have subtle effects on | 117 | default order ever changes, as they may have subtle effects on |
| 110 | the semantics of use-package declarations and may necessitate | 118 | the semantics of `use-package' declarations and may necessitate |
| 111 | changing where you had inserted a new keyword earlier. | 119 | changing where you had inserted a new keyword earlier. |
| 112 | 120 | ||
| 113 | Note that `:disabled' is special in this list, as it causes | 121 | Note that `:disabled' is special in this list, as it causes |
| 114 | nothing at all to happen, even if the rest of the use-package | 122 | nothing at all to happen, even if the rest of the `use-package' |
| 115 | declaration is incorrect." | 123 | declaration is incorrect." |
| 116 | :type '(repeat symbol) | 124 | :type '(repeat symbol) |
| 117 | :group 'use-package) | 125 | :group 'use-package) |
| @@ -119,7 +127,8 @@ declaration is incorrect." | |||
| 119 | (defcustom use-package-deferring-keywords | 127 | (defcustom use-package-deferring-keywords |
| 120 | '(:bind-keymap | 128 | '(:bind-keymap |
| 121 | :bind-keymap* | 129 | :bind-keymap* |
| 122 | :commands) | 130 | :commands |
| 131 | :autoload) | ||
| 123 | "Unless `:demand' is used, keywords in this list imply deferred loading. | 132 | "Unless `:demand' is used, keywords in this list imply deferred loading. |
| 124 | The reason keywords like `:hook' are not in this list is that | 133 | The reason keywords like `:hook' are not in this list is that |
| 125 | they only imply deferred loading if they reference actual | 134 | they only imply deferred loading if they reference actual |
| @@ -130,9 +139,9 @@ otherwise requested." | |||
| 130 | :group 'use-package) | 139 | :group 'use-package) |
| 131 | 140 | ||
| 132 | (defcustom use-package-ignore-unknown-keywords nil | 141 | (defcustom use-package-ignore-unknown-keywords nil |
| 133 | "If non-nil, issue warning instead of error when unknown | 142 | "If non-nil, warn instead of signaling error for unknown keywords. |
| 134 | keyword is encountered. The unknown keyword and its associated | 143 | The unknown keyword and its associated arguments will be ignored |
| 135 | arguments will be ignored in the `use-package' expansion." | 144 | in the `use-package' expansion." |
| 136 | :type 'boolean | 145 | :type 'boolean |
| 137 | :group 'use-package) | 146 | :group 'use-package) |
| 138 | 147 | ||
| @@ -147,7 +156,7 @@ call)." | |||
| 147 | "Whether to report about loading and configuration details. | 156 | "Whether to report about loading and configuration details. |
| 148 | If you customize this, then you should require the `use-package' | 157 | If you customize this, then you should require the `use-package' |
| 149 | feature in files that use `use-package', even if these files only | 158 | feature in files that use `use-package', even if these files only |
| 150 | contain compiled expansions of the macros. If you don't do so, | 159 | contain compiled expansions of the macros. If you don't do so, |
| 151 | then the expanded macros do their job silently." | 160 | then the expanded macros do their job silently." |
| 152 | :type '(choice (const :tag "Quiet, without catching errors" errors) | 161 | :type '(choice (const :tag "Quiet, without catching errors" errors) |
| 153 | (const :tag "Quiet" nil) | 162 | (const :tag "Quiet" nil) |
| @@ -194,9 +203,9 @@ Each entry in the alist is a list of three elements: | |||
| 194 | The first element is the `use-package' keyword. | 203 | The first element is the `use-package' keyword. |
| 195 | 204 | ||
| 196 | The second is a form that can be evaluated to get the default | 205 | The second is a form that can be evaluated to get the default |
| 197 | value. It can also be a function that will receive the name of | 206 | value. It can also be a function that will receive the name of |
| 198 | the use-package declaration and the keyword plist given to | 207 | the `use-package' declaration and the keyword plist given to |
| 199 | `use-package', in normalized form. The value it returns should | 208 | `use-package', in normalized form. The value it returns should |
| 200 | also be in normalized form (which is sometimes *not* what one | 209 | also be in normalized form (which is sometimes *not* what one |
| 201 | would normally write in a `use-package' declaration, so use | 210 | would normally write in a `use-package' declaration, so use |
| 202 | caution). | 211 | caution). |
| @@ -204,9 +213,9 @@ caution). | |||
| 204 | The third element is a form that can be evaluated to determine | 213 | The third element is a form that can be evaluated to determine |
| 205 | whether or not to assign a default value; if it evaluates to nil, | 214 | whether or not to assign a default value; if it evaluates to nil, |
| 206 | then the default value is not assigned even if the keyword is not | 215 | then the default value is not assigned even if the keyword is not |
| 207 | present in the `use-package' form. This third element may also be | 216 | present in the `use-package' form. This third element may also be |
| 208 | a function, in which case it receives the name of the package (as | 217 | a function, in which case it receives the name of the package (as |
| 209 | a symbol) and a list of keywords (in normalized form). It should | 218 | a symbol) and a list of keywords (in normalized form). It should |
| 210 | return nil or non-nil depending on whether defaulting should be | 219 | return nil or non-nil depending on whether defaulting should be |
| 211 | attempted." | 220 | attempted." |
| 212 | :type `(repeat | 221 | :type `(repeat |
| @@ -291,7 +300,7 @@ This disables: | |||
| 291 | 300 | ||
| 292 | The main advantage to this variable is that, if you know your | 301 | The main advantage to this variable is that, if you know your |
| 293 | configuration works, it will make the byte-compiled file as | 302 | configuration works, it will make the byte-compiled file as |
| 294 | minimal as possible. It can also help with reading macro-expanded | 303 | minimal as possible. It can also help with reading macro-expanded |
| 295 | definitions, to understand the main intent of what's happening." | 304 | definitions, to understand the main intent of what's happening." |
| 296 | :type 'boolean | 305 | :type 'boolean |
| 297 | :group 'use-package) | 306 | :group 'use-package) |
| @@ -303,7 +312,7 @@ definitions, to understand the main intent of what's happening." | |||
| 303 | "\\s-+\\(")) | 312 | "\\s-+\\(")) |
| 304 | (or (bound-and-true-p lisp-mode-symbol-regexp) | 313 | (or (bound-and-true-p lisp-mode-symbol-regexp) |
| 305 | "\\(?:\\sw\\|\\s_\\|\\\\.\\)+") "\\)") | 314 | "\\(?:\\sw\\|\\s_\\|\\\\.\\)+") "\\)") |
| 306 | "Sexp providing regexp for finding use-package forms in user files. | 315 | "Sexp providing regexp for finding `use-package' forms in user files. |
| 307 | This is used by `use-package-jump-to-package-form' and | 316 | This is used by `use-package-jump-to-package-form' and |
| 308 | `use-package-enable-imenu-support'." | 317 | `use-package-enable-imenu-support'." |
| 309 | :type 'sexp | 318 | :type 'sexp |
| @@ -314,7 +323,7 @@ This is used by `use-package-jump-to-package-form' and | |||
| 314 | This is done by adjusting `lisp-imenu-generic-expression' to | 323 | This is done by adjusting `lisp-imenu-generic-expression' to |
| 315 | include support for finding `use-package' and `require' forms. | 324 | include support for finding `use-package' and `require' forms. |
| 316 | 325 | ||
| 317 | Must be set before loading use-package." | 326 | Must be set before loading `use-package'." |
| 318 | :type 'boolean | 327 | :type 'boolean |
| 319 | :set | 328 | :set |
| 320 | #'(lambda (sym value) | 329 | #'(lambda (sym value) |
| @@ -336,8 +345,8 @@ Must be set before loading use-package." | |||
| 336 | (font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords) | 345 | (font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords) |
| 337 | 346 | ||
| 338 | (defcustom use-package-compute-statistics nil | 347 | (defcustom use-package-compute-statistics nil |
| 339 | "If non-nil, compute statistics concerned use-package declarations. | 348 | "If non-nil, compute statistics concerned `use-package' declarations. |
| 340 | View the statistical report using `use-package-report'. Note that | 349 | View the statistical report using `use-package-report'. Note that |
| 341 | if this option is enabled, you must require `use-package' in your | 350 | if this option is enabled, you must require `use-package' in your |
| 342 | user init file at loadup time, or you will see errors concerning | 351 | user init file at loadup time, or you will see errors concerning |
| 343 | undefined variables." | 352 | undefined variables." |
| @@ -363,14 +372,14 @@ undefined variables." | |||
| 363 | (and sym (symbolp sym))) | 372 | (and sym (symbolp sym))) |
| 364 | 373 | ||
| 365 | (defsubst use-package-as-symbol (string-or-symbol) | 374 | (defsubst use-package-as-symbol (string-or-symbol) |
| 366 | "If STRING-OR-SYMBOL is already a symbol, return it. Otherwise | 375 | "If STRING-OR-SYMBOL is already a symbol, return it. |
| 367 | convert it to a symbol and return that." | 376 | Otherwise convert it to a symbol and return that." |
| 368 | (if (symbolp string-or-symbol) string-or-symbol | 377 | (if (symbolp string-or-symbol) string-or-symbol |
| 369 | (intern string-or-symbol))) | 378 | (intern string-or-symbol))) |
| 370 | 379 | ||
| 371 | (defsubst use-package-as-string (string-or-symbol) | 380 | (defsubst use-package-as-string (string-or-symbol) |
| 372 | "If STRING-OR-SYMBOL is already a string, return it. Otherwise | 381 | "If STRING-OR-SYMBOL is already a string, return it. |
| 373 | convert it to a string and return that." | 382 | Otherwise convert it to a string and return that." |
| 374 | (if (stringp string-or-symbol) string-or-symbol | 383 | (if (stringp string-or-symbol) string-or-symbol |
| 375 | (symbol-name string-or-symbol))) | 384 | (symbol-name string-or-symbol))) |
| 376 | 385 | ||
| @@ -736,8 +745,8 @@ one. | |||
| 736 | If AFTER is non-nil, insert KEYWORD either at the end of the | 745 | If AFTER is non-nil, insert KEYWORD either at the end of the |
| 737 | keywords list, or after the ANCHOR if one has been provided. | 746 | keywords list, or after the ANCHOR if one has been provided. |
| 738 | If TEST is non-nil, it is the test used to compare ELEM to list | 747 | If TEST is non-nil, it is the test used to compare ELEM to list |
| 739 | elements. The default is `eq'. | 748 | elements. The default is `eq'. |
| 740 | The modified list is returned. The original list is not modified." | 749 | The modified list is returned. The original list is not modified." |
| 741 | (let (result) | 750 | (let (result) |
| 742 | (dolist (k xs) | 751 | (dolist (k xs) |
| 743 | (if (funcall (or test #'eq) k anchor) | 752 | (if (funcall (or test #'eq) k anchor) |
| @@ -987,6 +996,8 @@ If RECURSED is non-nil, recurse into sublists." | |||
| 987 | ;; | 996 | ;; |
| 988 | 997 | ||
| 989 | (defun use-package-reset-statistics () | 998 | (defun use-package-reset-statistics () |
| 999 | "Reset statistics for `use-package'. | ||
| 1000 | See also `use-package-statistics'." | ||
| 990 | (interactive) | 1001 | (interactive) |
| 991 | (setq use-package-statistics (make-hash-table))) | 1002 | (setq use-package-statistics (make-hash-table))) |
| 992 | 1003 | ||
| @@ -1029,7 +1040,7 @@ The information is formatted in a way suitable for | |||
| 1029 | (format "%.2f" (use-package-statistics-time statistics)))))) | 1040 | (format "%.2f" (use-package-statistics-time statistics)))))) |
| 1030 | 1041 | ||
| 1031 | (defun use-package-report () | 1042 | (defun use-package-report () |
| 1032 | "Show current statistics gathered about use-package declarations. | 1043 | "Show current statistics gathered about `use-package' declarations. |
| 1033 | In the table that's generated, the status field has the following | 1044 | In the table that's generated, the status field has the following |
| 1034 | meaning: | 1045 | meaning: |
| 1035 | Configured :config has been processed (the package is loaded!) | 1046 | Configured :config has been processed (the package is loaded!) |
| @@ -1053,7 +1064,7 @@ meaning: | |||
| 1053 | 1064 | ||
| 1054 | (define-derived-mode use-package-statistics-mode tabulated-list-mode | 1065 | (define-derived-mode use-package-statistics-mode tabulated-list-mode |
| 1055 | "use-package statistics" | 1066 | "use-package statistics" |
| 1056 | "Show current statistics gathered about use-package declarations." | 1067 | "Show current statistics gathered about `use-package' declarations." |
| 1057 | (setq tabulated-list-format | 1068 | (setq tabulated-list-format |
| 1058 | ;; The sum of column width is 80 characters: | 1069 | ;; The sum of column width is 80 characters: |
| 1059 | [("Package" 25 t) | 1070 | [("Package" 25 t) |
| @@ -1347,6 +1358,28 @@ meaning: | |||
| 1347 | (delete-dups arg))) | 1358 | (delete-dups arg))) |
| 1348 | (use-package-process-keywords name rest state))) | 1359 | (use-package-process-keywords name rest state))) |
| 1349 | 1360 | ||
| 1361 | ;;;; :autoload | ||
| 1362 | |||
| 1363 | (defalias 'use-package-normalize/:autoload 'use-package-normalize/:commands) | ||
| 1364 | |||
| 1365 | (defun use-package-handler/:autoload (name _keyword arg rest state) | ||
| 1366 | (use-package-concat | ||
| 1367 | ;; Since we deferring load, establish any necessary autoloads, and also | ||
| 1368 | ;; keep the byte-compiler happy. | ||
| 1369 | (let ((name-string (use-package-as-string name))) | ||
| 1370 | (cl-mapcan | ||
| 1371 | #'(lambda (command) | ||
| 1372 | (when (symbolp command) | ||
| 1373 | (append | ||
| 1374 | (unless (plist-get state :demand) | ||
| 1375 | `((unless (fboundp ',command) | ||
| 1376 | (autoload #',command ,name-string)))) | ||
| 1377 | (when (bound-and-true-p byte-compile-current-file) | ||
| 1378 | `((eval-when-compile | ||
| 1379 | (declare-function ,command ,name-string))))))) | ||
| 1380 | (delete-dups arg))) | ||
| 1381 | (use-package-process-keywords name rest state))) | ||
| 1382 | |||
| 1350 | ;;;; :defer | 1383 | ;;;; :defer |
| 1351 | 1384 | ||
| 1352 | (defalias 'use-package-normalize/:defer 'use-package-normalize-predicate) | 1385 | (defalias 'use-package-normalize/:defer 'use-package-normalize-predicate) |
| @@ -1477,7 +1510,7 @@ no keyword implies `:all'." | |||
| 1477 | (defun use-package-normalize/:custom-face (name-symbol _keyword arg) | 1510 | (defun use-package-normalize/:custom-face (name-symbol _keyword arg) |
| 1478 | "Normalize use-package custom-face keyword." | 1511 | "Normalize use-package custom-face keyword." |
| 1479 | (let ((error-msg | 1512 | (let ((error-msg |
| 1480 | (format "%s wants a (<symbol> <face-spec>) or list of these" | 1513 | (format "%s wants a (<symbol> <face-spec> [spec-type]) or list of these" |
| 1481 | name-symbol))) | 1514 | name-symbol))) |
| 1482 | (unless (listp arg) | 1515 | (unless (listp arg) |
| 1483 | (use-package-error error-msg)) | 1516 | (use-package-error error-msg)) |
| @@ -1488,13 +1521,13 @@ no keyword implies `:all'." | |||
| 1488 | (spec (nth 1 def))) | 1521 | (spec (nth 1 def))) |
| 1489 | (when (or (not face) | 1522 | (when (or (not face) |
| 1490 | (not spec) | 1523 | (not spec) |
| 1491 | (> (length def) 2)) | 1524 | (> (length def) 3)) |
| 1492 | (use-package-error error-msg)))))) | 1525 | (use-package-error error-msg)))))) |
| 1493 | 1526 | ||
| 1494 | (defun use-package-handler/:custom-face (name _keyword args rest state) | 1527 | (defun use-package-handler/:custom-face (name _keyword args rest state) |
| 1495 | "Generate use-package custom-face keyword code." | 1528 | "Generate use-package custom-face keyword code." |
| 1496 | (use-package-concat | 1529 | (use-package-concat |
| 1497 | (mapcar #'(lambda (def) `(custom-set-faces (backquote ,def))) args) | 1530 | (mapcar #'(lambda (def) `(apply #'face-spec-set (backquote ,def))) args) |
| 1498 | (use-package-process-keywords name rest state))) | 1531 | (use-package-process-keywords name rest state))) |
| 1499 | 1532 | ||
| 1500 | ;;;; :init | 1533 | ;;;; :init |
| @@ -1633,6 +1666,7 @@ this file. Usage: | |||
| 1633 | package. This is useful if the package is being lazily | 1666 | package. This is useful if the package is being lazily |
| 1634 | loaded, and you wish to conditionally call functions in your | 1667 | loaded, and you wish to conditionally call functions in your |
| 1635 | `:init' block that are defined in the package. | 1668 | `:init' block that are defined in the package. |
| 1669 | :autoload Similar to :commands, but it for no-interactive one. | ||
| 1636 | :hook Specify hook(s) to attach this package to. | 1670 | :hook Specify hook(s) to attach this package to. |
| 1637 | 1671 | ||
| 1638 | :bind Bind keys, and define autoloads for the bound commands. | 1672 | :bind Bind keys, and define autoloads for the bound commands. |
diff --git a/lisp/use-package/use-package-delight.el b/lisp/use-package/use-package-delight.el index 85d5c7cb4d6..558be5e4706 100644 --- a/lisp/use-package/use-package-delight.el +++ b/lisp/use-package/use-package-delight.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-delight.el --- Support for the :delight keyword -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
diff --git a/lisp/use-package/use-package-diminish.el b/lisp/use-package/use-package-diminish.el index 1f3895f42cd..5b20830ee6a 100644 --- a/lisp/use-package/use-package-diminish.el +++ b/lisp/use-package/use-package-diminish.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-diminish.el --- Support for the :diminish keyword -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
diff --git a/lisp/use-package/use-package-ensure-system-package.el b/lisp/use-package/use-package-ensure-system-package.el index 7c591af7d9b..c42996f9d2a 100644 --- a/lisp/use-package/use-package-ensure-system-package.el +++ b/lisp/use-package/use-package-ensure-system-package.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-ensure-system-package.el --- auto install system packages -*- lexical-binding: 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) 2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Justin Talbott <justin@waymondo.com> | 5 | ;; Author: Justin Talbott <justin@waymondo.com> |
| 6 | ;; Keywords: convenience, tools, extensions | 6 | ;; Keywords: convenience, tools, extensions |
| @@ -29,7 +29,7 @@ | |||
| 29 | "List of custom packages installed.") | 29 | "List of custom packages installed.") |
| 30 | 30 | ||
| 31 | (defun use-package-ensure-system-package-consify (arg) | 31 | (defun use-package-ensure-system-package-consify (arg) |
| 32 | "Turn `arg' into a cons of (`package-name' . `install-command')." | 32 | "Turn ARG into a cons of (`package-name' . `install-command')." |
| 33 | (cond | 33 | (cond |
| 34 | ((stringp arg) | 34 | ((stringp arg) |
| 35 | (cons arg `(system-packages-install ,arg))) | 35 | (cons arg `(system-packages-install ,arg))) |
| @@ -54,7 +54,7 @@ | |||
| 54 | 54 | ||
| 55 | ;;;###autoload | 55 | ;;;###autoload |
| 56 | (defun use-package-normalize/:ensure-system-package (_name-symbol keyword args) | 56 | (defun use-package-normalize/:ensure-system-package (_name-symbol keyword args) |
| 57 | "Turn `arg' into a list of cons-es of (`package-name' . `install-command')." | 57 | "Turn ARGS into a list of conses of (`package-name' . `install-command')." |
| 58 | (use-package-as-one (symbol-name keyword) args | 58 | (use-package-as-one (symbol-name keyword) args |
| 59 | (lambda (_label arg) | 59 | (lambda (_label arg) |
| 60 | (cond | 60 | (cond |
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el index cb31b4b7dd4..a879c294dc3 100644 --- a/lisp/use-package/use-package-ensure.el +++ b/lisp/use-package/use-package-ensure.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-ensure.el --- Support for the :ensure and :pin keywords -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| @@ -37,7 +37,7 @@ | |||
| 37 | (require 'use-package-core) | 37 | (require 'use-package-core) |
| 38 | 38 | ||
| 39 | (defgroup use-package-ensure nil | 39 | (defgroup use-package-ensure nil |
| 40 | "Support for :ensure and :pin keywords in use-package declarations." | 40 | "Support for :ensure and :pin keywords in `use-package' declarations." |
| 41 | :group 'use-package) | 41 | :group 'use-package) |
| 42 | 42 | ||
| 43 | (eval-when-compile | 43 | (eval-when-compile |
| @@ -64,7 +64,7 @@ to all `:ensure' keywords (always a list, even if only one); and | |||
| 64 | the current `state' plist created by previous handlers. | 64 | the current `state' plist created by previous handlers. |
| 65 | 65 | ||
| 66 | Note that this function is called whenever `:ensure' is provided, | 66 | Note that this function is called whenever `:ensure' is provided, |
| 67 | even if it is nil. It is up to the function to decide on the | 67 | even if it is nil. It is up to the function to decide on the |
| 68 | semantics of the various values for `:ensure'. | 68 | semantics of the various values for `:ensure'. |
| 69 | 69 | ||
| 70 | This function should return non-nil if the package is installed. | 70 | This function should return non-nil if the package is installed. |
| @@ -111,7 +111,7 @@ manually updated package." | |||
| 111 | (archive-name (if (stringp archive) archive (symbol-name archive)))) | 111 | (archive-name (if (stringp archive) archive (symbol-name archive)))) |
| 112 | (if (use-package-archive-exists-p archive-symbol) | 112 | (if (use-package-archive-exists-p archive-symbol) |
| 113 | (add-to-list 'package-pinned-packages (cons package archive-name)) | 113 | (add-to-list 'package-pinned-packages (cons package archive-name)) |
| 114 | (error "Archive '%s' requested for package '%s' is not available." | 114 | (error "Archive '%s' requested for package '%s' is not available" |
| 115 | archive-name package)) | 115 | archive-name 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)))) |
diff --git a/lisp/use-package/use-package-jump.el b/lisp/use-package/use-package-jump.el index 4044ad16564..6b9c02808e1 100644 --- a/lisp/use-package/use-package-jump.el +++ b/lisp/use-package/use-package-jump.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-jump.el --- Attempt to jump to a use-package declaration -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| @@ -30,8 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | ;; Provides the command `M-x use-package-jump-to-package-form', however it | 31 | ;; Provides the command `M-x use-package-jump-to-package-form', however it |
| 32 | ;; only works if the package being jumped to was required during | 32 | ;; only works if the package being jumped to was required during |
| 33 | ;; initialization. If it was delay-loaded, it will not work. Improvements are | 33 | ;; initialization. If it was delay-loaded, it will not work. |
| 34 | ;; needed. | 34 | ;; Improvements are needed. |
| 35 | 35 | ||
| 36 | ;;; Code: | 36 | ;;; Code: |
| 37 | 37 | ||
| @@ -48,11 +48,10 @@ Returns an absolute file path or nil if none is found." | |||
| 48 | 48 | ||
| 49 | ;;;###autoload | 49 | ;;;###autoload |
| 50 | (defun use-package-jump-to-package-form (package) | 50 | (defun use-package-jump-to-package-form (package) |
| 51 | "Attempt to find and jump to the `use-package' form that loaded | 51 | "Attempt to find and jump to the `use-package' form that loaded PACKAGE. |
| 52 | PACKAGE. This will only find the form if that form actually | 52 | This will only find the form if that form actually required |
| 53 | required PACKAGE. If PACKAGE was previously required then this | 53 | PACKAGE. If PACKAGE was previously required then this function |
| 54 | function will jump to the file that originally required PACKAGE | 54 | will jump to the file that originally required PACKAGE instead." |
| 55 | instead." | ||
| 56 | (interactive (list (completing-read "Package: " features))) | 55 | (interactive (list (completing-read "Package: " features))) |
| 57 | (let* ((package (if (stringp package) (intern package) package)) | 56 | (let* ((package (if (stringp package) (intern package) package)) |
| 58 | (requiring-file (use-package-find-require package)) | 57 | (requiring-file (use-package-find-require package)) |
diff --git a/lisp/use-package/use-package-lint.el b/lisp/use-package/use-package-lint.el index c6e7c3c0ce2..12974ab15e4 100644 --- a/lisp/use-package/use-package-lint.el +++ b/lisp/use-package/use-package-lint.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; use-package-lint.el --- Attempt to find errors in use-package declarations -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| @@ -63,7 +63,7 @@ | |||
| 63 | 63 | ||
| 64 | ;;;###autoload | 64 | ;;;###autoload |
| 65 | (defun use-package-lint () | 65 | (defun use-package-lint () |
| 66 | "Check for errors in use-package declarations. | 66 | "Check for errors in `use-package' declarations. |
| 67 | For example, if the module's `:if' condition is met, but even | 67 | For example, if the module's `:if' condition is met, but even |
| 68 | with the specified `:load-path' the module cannot be found." | 68 | with the specified `:load-path' the module cannot be found." |
| 69 | (interactive) | 69 | (interactive) |
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 0e194d5f182..9d046e0b149 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; use-package.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*- | 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-2022 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> | 6 | ;; Maintainer: John Wiegley <johnw@newartisans.com> |
| 7 | ;; Created: 17 Jun 2012 | 7 | ;; Created: 17 Jun 2012 |
| 8 | ;; Modified: 29 Nov 2017 | 8 | ;; Modified: 29 Nov 2017 |
| 9 | ;; Version: 2.4.1 | 9 | ;; Version: 2.4.4 |
| 10 | ;; Package-Requires: ((emacs "24.3") (bind-key "2.4")) | 10 | ;; Package-Requires: ((emacs "24.3") (bind-key "2.4")) |
| 11 | ;; Keywords: dotemacs startup speed config package | 11 | ;; Keywords: dotemacs startup speed config package |
| 12 | ;; URL: https://github.com/jwiegley/use-package | 12 | ;; URL: https://github.com/jwiegley/use-package |