mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-07 20:59:37 +00:00
Merge pull request from jabranham/lexical-bindings
[WIP] Lexical bindings GitHub-reference: https://github.com/jwiegley/use-package/issues/617
This commit is contained in:
commit
d21787f1d6
10 changed files with 61 additions and 61 deletions
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords
|
;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ deferred until the prefix key sequence is pressed."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-handler/:bind
|
(defun use-package-handler/:bind
|
||||||
(name keyword args rest state &optional bind-macro)
|
(name _keyword args rest state &optional bind-macro)
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(use-package-process-keywords name rest state)
|
(use-package-process-keywords name rest state)
|
||||||
`(,@(mapcar
|
`(,@(mapcar
|
||||||
|
@ -146,7 +146,7 @@ deferred until the prefix key sequence is pressed."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-handler/:bind-keymap
|
(defun use-package-handler/:bind-keymap
|
||||||
(name keyword args rest state &optional override)
|
(name _keyword args rest state &optional override)
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(use-package-process-keywords name rest state)
|
(use-package-process-keywords name rest state)
|
||||||
(mapcar
|
(mapcar
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-chords.el --- key-chord keyword for use-package
|
;;; use-package-chords.el --- key-chord keyword for use-package -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2015-2017 Justin Talbott
|
;; Copyright (C) 2015-2017 Justin Talbott
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-core.el --- A configuration macro for simplifying your .emacs
|
;;; use-package-core.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
|
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(require 'cl)
|
|
||||||
(require 'regexp-opt))
|
(require 'regexp-opt))
|
||||||
|
|
||||||
(defgroup use-package nil
|
(defgroup use-package nil
|
||||||
|
@ -286,7 +285,7 @@ include support for finding `use-package' and `require' forms.
|
||||||
Must be set before loading use-package."
|
Must be set before loading use-package."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:set
|
:set
|
||||||
#'(lambda (sym value)
|
#'(lambda (_sym value)
|
||||||
(eval-after-load 'lisp-mode
|
(eval-after-load 'lisp-mode
|
||||||
(if value
|
(if value
|
||||||
`(add-to-list 'lisp-imenu-generic-expression
|
`(add-to-list 'lisp-imenu-generic-expression
|
||||||
|
@ -525,7 +524,7 @@ extending any keys already present."
|
||||||
arg)))
|
arg)))
|
||||||
(use-package-error (format "Unrecognized keyword: %s" keyword))))))
|
(use-package-error (format "Unrecognized keyword: %s" keyword))))))
|
||||||
|
|
||||||
(defun use-package-unalias-keywords (name args)
|
(defun use-package-unalias-keywords (_name args)
|
||||||
(setq args (cl-nsubstitute :if :when args))
|
(setq args (cl-nsubstitute :if :when args))
|
||||||
(let (temp)
|
(let (temp)
|
||||||
(while (setq temp (plist-get args :unless))
|
(while (setq temp (plist-get args :unless))
|
||||||
|
@ -758,7 +757,7 @@ no more than once."
|
||||||
(setq ,loaded t ,result ,arg))))
|
(setq ,loaded t ,result ,arg))))
|
||||||
,@(funcall f `((funcall ,next))))))
|
,@(funcall f `((funcall ,next))))))
|
||||||
|
|
||||||
(defsubst use-package-normalize-value (label arg)
|
(defsubst use-package-normalize-value (_label arg)
|
||||||
"Normalize the Lisp value given by ARG.
|
"Normalize the Lisp value given by ARG.
|
||||||
The argument LABEL is ignored."
|
The argument LABEL is ignored."
|
||||||
(cond ((null arg) nil)
|
(cond ((null arg) nil)
|
||||||
|
@ -780,7 +779,7 @@ The argument LABEL is ignored."
|
||||||
(use-package-error
|
(use-package-error
|
||||||
(concat label " wants a symbol, or list of symbols")))))
|
(concat label " wants a symbol, or list of symbols")))))
|
||||||
|
|
||||||
(defun use-package-normalize-symlist (name keyword args)
|
(defun use-package-normalize-symlist (_name keyword args)
|
||||||
(use-package-as-one (symbol-name keyword) args
|
(use-package-as-one (symbol-name keyword) args
|
||||||
#'use-package-normalize-symbols))
|
#'use-package-normalize-symbols))
|
||||||
|
|
||||||
|
@ -796,7 +795,7 @@ The argument LABEL is ignored."
|
||||||
(use-package-error
|
(use-package-error
|
||||||
(concat label " wants a symbol, or nested list of symbols")))))
|
(concat label " wants a symbol, or nested list of symbols")))))
|
||||||
|
|
||||||
(defun use-package-normalize-recursive-symlist (name keyword args)
|
(defun use-package-normalize-recursive-symlist (_name keyword args)
|
||||||
(use-package-as-one (symbol-name keyword) args
|
(use-package-as-one (symbol-name keyword) args
|
||||||
#'use-package-normalize-recursive-symbols))
|
#'use-package-normalize-recursive-symbols))
|
||||||
|
|
||||||
|
@ -818,7 +817,7 @@ The argument LABEL is ignored."
|
||||||
(use-package-error
|
(use-package-error
|
||||||
(concat label " wants a directory path, or list of paths")))))
|
(concat label " wants a directory path, or list of paths")))))
|
||||||
|
|
||||||
(defun use-package-normalize-predicate (name keyword args)
|
(defun use-package-normalize-predicate (_name keyword args)
|
||||||
(if (null args)
|
(if (null args)
|
||||||
t
|
t
|
||||||
(use-package-only-one (symbol-name keyword) args
|
(use-package-only-one (symbol-name keyword) args
|
||||||
|
@ -836,7 +835,7 @@ The argument LABEL is ignored."
|
||||||
(macroexpand form)
|
(macroexpand form)
|
||||||
form)) args))
|
form)) args))
|
||||||
|
|
||||||
(defun use-package-normalize-forms (name keyword args)
|
(defun use-package-normalize-forms (_name keyword args)
|
||||||
(use-package-normalize-form (symbol-name keyword) args))
|
(use-package-normalize-form (symbol-name keyword) args))
|
||||||
|
|
||||||
(defun use-package-normalize-pairs
|
(defun use-package-normalize-pairs
|
||||||
|
@ -921,7 +920,7 @@ If RECURSED is non-nil, recurse into sublists."
|
||||||
#'use-package-recognize-function
|
#'use-package-recognize-function
|
||||||
name)))
|
name)))
|
||||||
|
|
||||||
(defun use-package-autoloads-mode (name keyword args)
|
(defun use-package-autoloads-mode (_name _keyword args)
|
||||||
(mapcar
|
(mapcar
|
||||||
#'(lambda (x) (cons (cdr x) 'command))
|
#'(lambda (x) (cons (cdr x) 'command))
|
||||||
(cl-remove-if-not #'(lambda (x)
|
(cl-remove-if-not #'(lambda (x)
|
||||||
|
@ -1005,20 +1004,21 @@ meaning:
|
||||||
|
|
||||||
;; Don't alias this to `ignore', as that will cause the resulting
|
;; Don't alias this to `ignore', as that will cause the resulting
|
||||||
;; function to be interactive.
|
;; function to be interactive.
|
||||||
(defun use-package-normalize/:disabled (name keyword arg))
|
(defun use-package-normalize/:disabled (_name _keyword _arg)
|
||||||
|
"Do nothing, return nil.")
|
||||||
|
|
||||||
(defun use-package-handler/:disabled (name keyword arg rest state)
|
(defun use-package-handler/:disabled (name _keyword _arg rest state)
|
||||||
(use-package-process-keywords name rest state))
|
(use-package-process-keywords name rest state))
|
||||||
|
|
||||||
;;;; :if, :when and :unless
|
;;;; :if, :when and :unless
|
||||||
|
|
||||||
(defun use-package-normalize-test (name keyword args)
|
(defun use-package-normalize-test (_name keyword args)
|
||||||
(use-package-only-one (symbol-name keyword) args
|
(use-package-only-one (symbol-name keyword) args
|
||||||
#'use-package-normalize-value))
|
#'use-package-normalize-value))
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:if 'use-package-normalize-test)
|
(defalias 'use-package-normalize/:if 'use-package-normalize-test)
|
||||||
|
|
||||||
(defun use-package-handler/:if (name keyword pred rest state)
|
(defun use-package-handler/:if (name _keyword pred rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
`((when ,pred ,@body))))
|
`((when ,pred ,@body))))
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:unless 'use-package-normalize-test)
|
(defalias 'use-package-normalize/:unless 'use-package-normalize-test)
|
||||||
|
|
||||||
(defun use-package-handler/:unless (name keyword pred rest state)
|
(defun use-package-handler/:unless (name _keyword pred rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
`((unless ,pred ,@body))))
|
`((unless ,pred ,@body))))
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist)
|
(defalias 'use-package-normalize/:requires 'use-package-normalize-symlist)
|
||||||
|
|
||||||
(defun use-package-handler/:requires (name keyword requires rest state)
|
(defun use-package-handler/:requires (name _keyword requires rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(if (null requires)
|
(if (null requires)
|
||||||
body
|
body
|
||||||
|
@ -1047,11 +1047,11 @@ meaning:
|
||||||
|
|
||||||
;;;; :load-path
|
;;;; :load-path
|
||||||
|
|
||||||
(defun use-package-normalize/:load-path (name keyword args)
|
(defun use-package-normalize/:load-path (_name keyword args)
|
||||||
(use-package-as-one (symbol-name keyword) args
|
(use-package-as-one (symbol-name keyword) args
|
||||||
#'use-package-normalize-paths))
|
#'use-package-normalize-paths))
|
||||||
|
|
||||||
(defun use-package-handler/:load-path (name keyword arg rest state)
|
(defun use-package-handler/:load-path (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(mapcar #'(lambda (path)
|
(mapcar #'(lambda (path)
|
||||||
|
@ -1063,28 +1063,28 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate)
|
(defalias 'use-package-normalize/:no-require 'use-package-normalize-predicate)
|
||||||
|
|
||||||
(defun use-package-handler/:no-require (name keyword arg rest state)
|
(defun use-package-handler/:no-require (name _keyword _arg rest state)
|
||||||
(use-package-process-keywords name rest state))
|
(use-package-process-keywords name rest state))
|
||||||
|
|
||||||
;;;; :defines
|
;;;; :defines
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist)
|
(defalias 'use-package-normalize/:defines 'use-package-normalize-symlist)
|
||||||
|
|
||||||
(defun use-package-handler/:defines (name keyword arg rest state)
|
(defun use-package-handler/:defines (name _keyword _arg rest state)
|
||||||
(use-package-process-keywords name rest state))
|
(use-package-process-keywords name rest state))
|
||||||
|
|
||||||
;;;; :functions
|
;;;; :functions
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist)
|
(defalias 'use-package-normalize/:functions 'use-package-normalize-symlist)
|
||||||
|
|
||||||
(defun use-package-handler/:functions (name keyword arg rest state)
|
(defun use-package-handler/:functions (name _keyword _arg rest state)
|
||||||
(use-package-process-keywords name rest state))
|
(use-package-process-keywords name rest state))
|
||||||
|
|
||||||
;;;; :preface
|
;;;; :preface
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:preface 'use-package-normalize-forms)
|
(defalias 'use-package-normalize/:preface 'use-package-normalize-forms)
|
||||||
|
|
||||||
(defun use-package-handler/:preface (name keyword arg rest state)
|
(defun use-package-handler/:preface (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(when use-package-compute-statistics
|
(when use-package-compute-statistics
|
||||||
|
@ -1098,14 +1098,14 @@ meaning:
|
||||||
;;;; :catch
|
;;;; :catch
|
||||||
|
|
||||||
(defvar use-package--form)
|
(defvar use-package--form)
|
||||||
(defvar use-package--hush-function #'(lambda (keyword body) body))
|
(defvar use-package--hush-function #'(lambda (_keyword body) body))
|
||||||
|
|
||||||
(defsubst use-package-hush (context keyword body)
|
(defsubst use-package-hush (context keyword body)
|
||||||
`((condition-case-unless-debug err
|
`((condition-case-unless-debug err
|
||||||
,(macroexp-progn body)
|
,(macroexp-progn body)
|
||||||
(error (funcall ,context ,keyword err)))))
|
(error (funcall ,context ,keyword err)))))
|
||||||
|
|
||||||
(defun use-package-normalize/:catch (name keyword args)
|
(defun use-package-normalize/:catch (_name keyword args)
|
||||||
(if (null args)
|
(if (null args)
|
||||||
t
|
t
|
||||||
(use-package-only-one (symbol-name keyword) args
|
(use-package-only-one (symbol-name keyword) args
|
||||||
|
@ -1149,7 +1149,7 @@ meaning:
|
||||||
(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode)
|
(defalias 'use-package-normalize/:interpreter 'use-package-normalize-mode)
|
||||||
(defalias 'use-package-autoloads/:interpreter 'use-package-autoloads-mode)
|
(defalias 'use-package-autoloads/:interpreter 'use-package-autoloads-mode)
|
||||||
|
|
||||||
(defun use-package-handler/:interpreter (name keyword arg rest state)
|
(defun use-package-handler/:interpreter (name _keyword arg rest state)
|
||||||
(use-package-handle-mode name 'interpreter-mode-alist arg rest state))
|
(use-package-handle-mode name 'interpreter-mode-alist arg rest state))
|
||||||
|
|
||||||
;;;; :mode
|
;;;; :mode
|
||||||
|
@ -1157,7 +1157,7 @@ meaning:
|
||||||
(defalias 'use-package-normalize/:mode 'use-package-normalize-mode)
|
(defalias 'use-package-normalize/:mode 'use-package-normalize-mode)
|
||||||
(defalias 'use-package-autoloads/:mode 'use-package-autoloads-mode)
|
(defalias 'use-package-autoloads/:mode 'use-package-autoloads-mode)
|
||||||
|
|
||||||
(defun use-package-handler/:mode (name keyword arg rest state)
|
(defun use-package-handler/:mode (name _keyword arg rest state)
|
||||||
(use-package-handle-mode name 'auto-mode-alist arg rest state))
|
(use-package-handle-mode name 'auto-mode-alist arg rest state))
|
||||||
|
|
||||||
;;;; :magic
|
;;;; :magic
|
||||||
|
@ -1165,7 +1165,7 @@ meaning:
|
||||||
(defalias 'use-package-normalize/:magic 'use-package-normalize-mode)
|
(defalias 'use-package-normalize/:magic 'use-package-normalize-mode)
|
||||||
(defalias 'use-package-autoloads/:magic 'use-package-autoloads-mode)
|
(defalias 'use-package-autoloads/:magic 'use-package-autoloads-mode)
|
||||||
|
|
||||||
(defun use-package-handler/:magic (name keyword arg rest state)
|
(defun use-package-handler/:magic (name _keyword arg rest state)
|
||||||
(use-package-handle-mode name 'magic-mode-alist arg rest state))
|
(use-package-handle-mode name 'magic-mode-alist arg rest state))
|
||||||
|
|
||||||
;;;; :magic-fallback
|
;;;; :magic-fallback
|
||||||
|
@ -1173,7 +1173,7 @@ meaning:
|
||||||
(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode)
|
(defalias 'use-package-normalize/:magic-fallback 'use-package-normalize-mode)
|
||||||
(defalias 'use-package-autoloads/:magic-fallback 'use-package-autoloads-mode)
|
(defalias 'use-package-autoloads/:magic-fallback 'use-package-autoloads-mode)
|
||||||
|
|
||||||
(defun use-package-handler/:magic-fallback (name keyword arg rest state)
|
(defun use-package-handler/:magic-fallback (name _keyword arg rest state)
|
||||||
(use-package-handle-mode name 'magic-fallback-mode-alist arg rest state))
|
(use-package-handle-mode name 'magic-fallback-mode-alist arg rest state))
|
||||||
|
|
||||||
;;;; :hook
|
;;;; :hook
|
||||||
|
@ -1200,7 +1200,7 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-autoloads/:hook 'use-package-autoloads-mode)
|
(defalias 'use-package-autoloads/:hook 'use-package-autoloads-mode)
|
||||||
|
|
||||||
(defun use-package-handler/:hook (name keyword args rest state)
|
(defun use-package-handler/:hook (name _keyword args rest state)
|
||||||
"Generate use-package custom keyword code."
|
"Generate use-package custom keyword code."
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(use-package-process-keywords name rest state)
|
(use-package-process-keywords name rest state)
|
||||||
|
@ -1223,7 +1223,7 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist)
|
(defalias 'use-package-normalize/:commands 'use-package-normalize-symlist)
|
||||||
|
|
||||||
(defun use-package-handler/:commands (name keyword arg rest state)
|
(defun use-package-handler/:commands (name _keyword arg rest state)
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
;; Since we deferring load, establish any necessary autoloads, and also
|
;; Since we deferring load, establish any necessary autoloads, and also
|
||||||
;; keep the byte-compiler happy.
|
;; keep the byte-compiler happy.
|
||||||
|
@ -1245,7 +1245,7 @@ meaning:
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate)
|
(defalias 'use-package-normalize/:defer 'use-package-normalize-predicate)
|
||||||
|
|
||||||
(defun use-package-handler/:defer (name keyword arg rest state)
|
(defun use-package-handler/:defer (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
;; Load the package after a set amount of idle time, if the argument to
|
;; Load the package after a set amount of idle time, if the argument to
|
||||||
|
@ -1301,7 +1301,7 @@ no keyword implies `:all'."
|
||||||
((listp features)
|
((listp features)
|
||||||
(use-package-require-after-load (cons :all features) body))))
|
(use-package-require-after-load (cons :all features) body))))
|
||||||
|
|
||||||
(defun use-package-handler/:after (name keyword arg rest state)
|
(defun use-package-handler/:after (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state))
|
(let ((body (use-package-process-keywords name rest state))
|
||||||
(uses (use-package-after-count-uses arg)))
|
(uses (use-package-after-count-uses arg)))
|
||||||
(if (or (null uses) (null body))
|
(if (or (null uses) (null body))
|
||||||
|
@ -1316,12 +1316,12 @@ no keyword implies `:all'."
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate)
|
(defalias 'use-package-normalize/:demand 'use-package-normalize-predicate)
|
||||||
|
|
||||||
(defun use-package-handler/:demand (name keyword arg rest state)
|
(defun use-package-handler/:demand (name _keyword _arg rest state)
|
||||||
(use-package-process-keywords name rest state))
|
(use-package-process-keywords name rest state))
|
||||||
|
|
||||||
;;;; :custom
|
;;;; :custom
|
||||||
|
|
||||||
(defun use-package-normalize/:custom (name keyword args)
|
(defun use-package-normalize/:custom (_name keyword args)
|
||||||
"Normalize use-package custom keyword."
|
"Normalize use-package custom keyword."
|
||||||
(use-package-as-one (symbol-name keyword) args
|
(use-package-as-one (symbol-name keyword) args
|
||||||
#'(lambda (label arg)
|
#'(lambda (label arg)
|
||||||
|
@ -1333,7 +1333,7 @@ no keyword implies `:all'."
|
||||||
(list arg)
|
(list arg)
|
||||||
arg))))
|
arg))))
|
||||||
|
|
||||||
(defun use-package-handler/:custom (name keyword args rest state)
|
(defun use-package-handler/:custom (name _keyword args rest state)
|
||||||
"Generate use-package custom keyword code."
|
"Generate use-package custom keyword code."
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(mapcar
|
(mapcar
|
||||||
|
@ -1349,7 +1349,7 @@ no keyword implies `:all'."
|
||||||
|
|
||||||
;;;; :custom-face
|
;;;; :custom-face
|
||||||
|
|
||||||
(defun use-package-normalize/:custom-face (name-symbol keyword arg)
|
(defun use-package-normalize/:custom-face (name-symbol _keyword arg)
|
||||||
"Normalize use-package custom-face keyword."
|
"Normalize use-package custom-face keyword."
|
||||||
(let ((error-msg
|
(let ((error-msg
|
||||||
(format "%s wants a (<symbol> <face-spec>) or list of these"
|
(format "%s wants a (<symbol> <face-spec>) or list of these"
|
||||||
|
@ -1366,7 +1366,7 @@ no keyword implies `:all'."
|
||||||
(> (length def) 2))
|
(> (length def) 2))
|
||||||
(use-package-error error-msg))))))
|
(use-package-error error-msg))))))
|
||||||
|
|
||||||
(defun use-package-handler/:custom-face (name keyword args rest state)
|
(defun use-package-handler/:custom-face (name _keyword args rest state)
|
||||||
"Generate use-package custom-face keyword code."
|
"Generate use-package custom-face keyword code."
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(mapcar #'(lambda (def) `(custom-set-faces (quote ,def))) args)
|
(mapcar #'(lambda (def) `(custom-set-faces (quote ,def))) args)
|
||||||
|
@ -1376,7 +1376,7 @@ no keyword implies `:all'."
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:init 'use-package-normalize-forms)
|
(defalias 'use-package-normalize/:init 'use-package-normalize-forms)
|
||||||
|
|
||||||
(defun use-package-handler/:init (name keyword arg rest state)
|
(defun use-package-handler/:init (name _keyword arg rest state)
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(when use-package-compute-statistics
|
(when use-package-compute-statistics
|
||||||
`((use-package-statistics-gather :init ',name nil)))
|
`((use-package-statistics-gather :init ',name nil)))
|
||||||
|
@ -1401,7 +1401,7 @@ no keyword implies `:all'."
|
||||||
args
|
args
|
||||||
(list args)))
|
(list args)))
|
||||||
|
|
||||||
(defun use-package-handler/:load (name keyword arg rest state)
|
(defun use-package-handler/:load (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(cl-dolist (pkg arg)
|
(cl-dolist (pkg arg)
|
||||||
(setq body (use-package-require (if (eq t pkg) name pkg) nil body)))
|
(setq body (use-package-require (if (eq t pkg) name pkg) nil body)))
|
||||||
|
@ -1411,7 +1411,7 @@ no keyword implies `:all'."
|
||||||
|
|
||||||
(defalias 'use-package-normalize/:config 'use-package-normalize-forms)
|
(defalias 'use-package-normalize/:config 'use-package-normalize-forms)
|
||||||
|
|
||||||
(defun use-package-handler/:config (name keyword arg rest state)
|
(defun use-package-handler/:config (name _keyword arg rest state)
|
||||||
(let* ((body (use-package-process-keywords name rest state))
|
(let* ((body (use-package-process-keywords name rest state))
|
||||||
(name-symbol (use-package-as-symbol name)))
|
(name-symbol (use-package-as-symbol name)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-delight.el --- Support for the :delight keyword
|
;;; use-package-delight.el --- Support for the :delight keyword -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
":delight expects `delight' arguments or a list of them"))))
|
":delight expects `delight' arguments or a list of them"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-normalize/:delight (name keyword args)
|
(defun use-package-normalize/:delight (name _keyword args)
|
||||||
"Normalize arguments to delight."
|
"Normalize arguments to delight."
|
||||||
(cond ((null args)
|
(cond ((null args)
|
||||||
`((,(use-package-as-mode name) nil ,name)))
|
`((,(use-package-as-mode name) nil ,name)))
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
args)))))
|
args)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-handler/:delight (name keyword args rest state)
|
(defun use-package-handler/:delight (name _keyword args rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
body
|
body
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-diminish.el --- Support for the :diminish keyword
|
;;; use-package-diminish.el --- Support for the :diminish keyword -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
(apply-partially #'use-package-normalize-diminish name) t))
|
(apply-partially #'use-package-normalize-diminish name) t))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-handler/:diminish (name keyword arg rest state)
|
(defun use-package-handler/:diminish (name _keyword arg rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(let ((body (use-package-process-keywords name rest state)))
|
||||||
(use-package-concat
|
(use-package-concat
|
||||||
(mapcar #'(lambda (var)
|
(mapcar #'(lambda (var)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-ensure.el --- Support for the :ensure and :pin keywords
|
;;; use-package-ensure.el --- Support for the :ensure and :pin keywords -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
@ -76,9 +76,9 @@ The default value uses package.el to install the package."
|
||||||
|
|
||||||
;;;; :pin
|
;;;; :pin
|
||||||
|
|
||||||
(defun use-package-normalize/:pin (name keyword args)
|
(defun use-package-normalize/:pin (_name keyword args)
|
||||||
(use-package-only-one (symbol-name keyword) args
|
(use-package-only-one (symbol-name keyword) args
|
||||||
#'(lambda (label arg)
|
#'(lambda (_label arg)
|
||||||
(cond
|
(cond
|
||||||
((stringp arg) arg)
|
((stringp arg) arg)
|
||||||
((use-package-non-nil-symbolp arg) (symbol-name arg))
|
((use-package-non-nil-symbolp arg) (symbol-name arg))
|
||||||
|
@ -116,7 +116,7 @@ manually updated package."
|
||||||
(unless (bound-and-true-p package--initialized)
|
(unless (bound-and-true-p package--initialized)
|
||||||
(package-initialize t))))
|
(package-initialize t))))
|
||||||
|
|
||||||
(defun use-package-handler/:pin (name keyword archive-name rest state)
|
(defun use-package-handler/:pin (name _keyword archive-name rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state))
|
(let ((body (use-package-process-keywords name rest state))
|
||||||
(pin-form (if archive-name
|
(pin-form (if archive-name
|
||||||
`(use-package-pin-package ',(use-package-as-symbol name)
|
`(use-package-pin-package ',(use-package-as-symbol name)
|
||||||
|
@ -133,11 +133,11 @@ manually updated package."
|
||||||
(defvar package-archive-contents)
|
(defvar package-archive-contents)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-normalize/:ensure (name keyword args)
|
(defun use-package-normalize/:ensure (_name keyword args)
|
||||||
(if (null args)
|
(if (null args)
|
||||||
(list t)
|
(list t)
|
||||||
(use-package-only-one (symbol-name keyword) args
|
(use-package-only-one (symbol-name keyword) args
|
||||||
#'(lambda (label arg)
|
#'(lambda (_label arg)
|
||||||
(cond
|
(cond
|
||||||
((symbolp arg)
|
((symbolp arg)
|
||||||
(list arg))
|
(list arg))
|
||||||
|
@ -152,7 +152,7 @@ manually updated package."
|
||||||
(concat ":ensure wants an optional package name "
|
(concat ":ensure wants an optional package name "
|
||||||
"(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
|
"(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
|
||||||
|
|
||||||
(defun use-package-ensure-elpa (name args state &optional no-refresh)
|
(defun use-package-ensure-elpa (name args _state &optional _no-refresh)
|
||||||
(dolist (ensure args)
|
(dolist (ensure args)
|
||||||
(let ((package
|
(let ((package
|
||||||
(or (and (eq ensure t) (use-package-as-symbol name))
|
(or (and (eq ensure t) (use-package-as-symbol name))
|
||||||
|
@ -183,7 +183,7 @@ manually updated package."
|
||||||
:error))))))))
|
:error))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun use-package-handler/:ensure (name keyword ensure rest state)
|
(defun use-package-handler/:ensure (name _keyword ensure rest state)
|
||||||
(let* ((body (use-package-process-keywords name rest state)))
|
(let* ((body (use-package-process-keywords name rest state)))
|
||||||
;; We want to avoid installing packages when the `use-package' macro is
|
;; We want to avoid installing packages when the `use-package' macro is
|
||||||
;; being macro-expanded by elisp completion (see `lisp--local-variables'),
|
;; being macro-expanded by elisp completion (see `lisp--local-variables'),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-jump.el --- Attempt to jump to a use-package declaration
|
;;; use-package-jump.el --- Attempt to jump to a use-package declaration -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-lint.el --- Attempt to find errors in use-package declarations
|
;;; use-package-lint.el --- Attempt to find errors in use-package declarations -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package.el --- A configuration macro for simplifying your .emacs
|
;;; use-package.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2017 John Wiegley
|
;; Copyright (C) 2012-2017 John Wiegley
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; use-package-tests.el --- Tests for use-package.el
|
;;; use-package-tests.el --- Tests for use-package.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or
|
;; This program is free software; you can redistribute it and/or
|
||||||
;; modify it under the terms of the GNU General Public License as
|
;; modify it under the terms of the GNU General Public License as
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue