mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Generate :defines and :functions correctly
So they actually inhibit byte-compilation warnings as they were meant to.
This commit is contained in:
parent
b5b432d0fe
commit
88f8c1bb8f
1 changed files with 18 additions and 27 deletions
|
|
@ -1252,8 +1252,7 @@ representing symbols (that may need to be autloaded)."
|
||||||
(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)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(use-package-process-keywords name rest state))
|
||||||
body))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;
|
;;
|
||||||
|
|
@ -1263,16 +1262,7 @@ representing symbols (that may need to be autloaded)."
|
||||||
(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)
|
||||||
(let ((body (use-package-process-keywords name rest state)))
|
(use-package-process-keywords name rest state))
|
||||||
(if (not (bound-and-true-p byte-compile-current-file))
|
|
||||||
body
|
|
||||||
(use-package-concat
|
|
||||||
(unless (null arg)
|
|
||||||
`((eval-when-compile
|
|
||||||
,@(mapcar
|
|
||||||
#'(lambda (fn)
|
|
||||||
`(declare-function ,fn ,(use-package-as-string name))) arg))))
|
|
||||||
body))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;
|
;;
|
||||||
|
|
@ -1750,22 +1740,23 @@ this file. Usage:
|
||||||
;; scope.
|
;; scope.
|
||||||
(if (bound-and-true-p byte-compile-current-file)
|
(if (bound-and-true-p byte-compile-current-file)
|
||||||
(setq args
|
(setq args
|
||||||
(use-package-plist-cons
|
(use-package-plist-append
|
||||||
args :preface
|
args :preface
|
||||||
`(eval-when-compile
|
(use-package-concat
|
||||||
,@(mapcar #'(lambda (var) `(defvar ,var))
|
(mapcar #'(lambda (var) `(defvar ,var))
|
||||||
(plist-get args :defines))
|
(plist-get args :defines))
|
||||||
,@(mapcar #'(lambda (fn) `(declare-function
|
(mapcar #'(lambda (fn) `(declare-function
|
||||||
,fn ,(use-package-as-string name)))
|
,fn ,(use-package-as-string name)))
|
||||||
(plist-get args :functions))
|
(plist-get args :functions))
|
||||||
(with-demoted-errors
|
`((eval-when-compile
|
||||||
,(format "Cannot load %s: %%S" name)
|
(with-demoted-errors
|
||||||
,(if (eq use-package-verbose 'debug)
|
,(format "Cannot load %s: %%S" name)
|
||||||
`(message "Compiling package %s" ',name-symbol))
|
,(if (eq use-package-verbose 'debug)
|
||||||
,(unless (plist-get args :no-require)
|
`(message "Compiling package %s" ',name-symbol))
|
||||||
`(load ,(if (stringp name)
|
,(unless (plist-get args :no-require)
|
||||||
name
|
`(load ,(if (stringp name)
|
||||||
(symbol-name name)) nil t)))))))
|
name
|
||||||
|
(symbol-name name)) nil t)))))))))
|
||||||
|
|
||||||
(let ((body
|
(let ((body
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue