mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
Correction to a macro expansion
This commit is contained in:
parent
62f866caf7
commit
8bf5de28c3
1 changed files with 33 additions and 31 deletions
32
up-core.el
32
up-core.el
|
|
@ -1328,25 +1328,22 @@ no keyword implies `:all'."
|
||||||
(defsubst use-package-hush (context body)
|
(defsubst use-package-hush (context body)
|
||||||
`((condition-case-unless-debug err
|
`((condition-case-unless-debug err
|
||||||
,(macroexp-progn body)
|
,(macroexp-progn body)
|
||||||
(error (,context err)))))
|
(error (funcall ,context err)))))
|
||||||
|
|
||||||
(defun use-package-core (name args)
|
(defun use-package-core (name args)
|
||||||
(let* ((context (gensym "use-package--warning"))
|
(let* ((context (gensym "use-package--warning"))
|
||||||
(args* (use-package-normalize-keywords name args))
|
(args* (use-package-normalize-keywords name args))
|
||||||
(use-package--hush-function #'identity)
|
(use-package--hush-function #'identity))
|
||||||
(process `(use-package-process-keywords ',name ',args*
|
|
||||||
',(and (plist-get args* :demand)
|
|
||||||
(list :demand t)))))
|
|
||||||
(if use-package-expand-minimally
|
(if use-package-expand-minimally
|
||||||
(eval process)
|
(use-package-process-keywords name args*
|
||||||
`((cl-flet
|
(and (plist-get args* :demand)
|
||||||
|
(list :demand t)))
|
||||||
|
`((let
|
||||||
((,context
|
((,context
|
||||||
(err)
|
#'(lambda (err)
|
||||||
(let ((msg (format "%s: %s" ',name
|
(let ((msg (format "%s: %s" ',name (error-message-string err))))
|
||||||
(error-message-string err))))
|
|
||||||
,(when (eq use-package-verbose 'debug)
|
,(when (eq use-package-verbose 'debug)
|
||||||
`(progn
|
`(progn
|
||||||
(setq msg (concat msg " (see the *use-package* buffer)"))
|
|
||||||
(with-current-buffer (get-buffer-create "*use-package*")
|
(with-current-buffer (get-buffer-create "*use-package*")
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(insert
|
(insert
|
||||||
|
|
@ -1361,14 +1358,19 @@ no keyword implies `:all'."
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(let ((use-package-verbose 'errors)
|
(let ((use-package-verbose 'errors)
|
||||||
(use-package-expand-minimally t))
|
(use-package-expand-minimally t))
|
||||||
(eval process))))))
|
(use-package-process-keywords name args*
|
||||||
(emacs-lisp-mode))))
|
(and (plist-get args* :demand)
|
||||||
(ignore (display-warning 'use-package msg :error)))))
|
(list :demand t))))))))
|
||||||
|
(emacs-lisp-mode))
|
||||||
|
(setq msg (concat msg " (see the *use-package* buffer)"))))
|
||||||
|
(ignore (display-warning 'use-package msg :error))))))
|
||||||
,(let ((use-package--hush-function
|
,(let ((use-package--hush-function
|
||||||
(apply-partially #'use-package-hush context)))
|
(apply-partially #'use-package-hush context)))
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(funcall use-package--hush-function
|
(funcall use-package--hush-function
|
||||||
(eval process)))))))))
|
(use-package-process-keywords name args*
|
||||||
|
(and (plist-get args* :demand)
|
||||||
|
(list :demand t)))))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro use-package (name &rest args)
|
(defmacro use-package (name &rest args)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue