(use-package-with-elapsed-timer
(format "Loading package %s" name)
`((if (not ,(use-package-load-name name t))
- (ignore
- (display-warning 'use-package
- (format "Cannot load %s" ',name)
- :error))
+ (display-warning 'use-package
+ (format "Cannot load %s" ',name)
+ :error)
,@body))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"Handle keywords which add regexp/mode pairs to an alist."
(use-package-concat
(use-package-process-keywords name rest state)
- `((ignore
- ,@(mapcar
- #'(lambda (thing)
- `(add-to-list
- ',alist
- ',(cons (use-package-normalize-regex (car thing))
- (cdr thing))))
- (use-package-normalize-commands args))))))
+ (mapcar
+ #'(lambda (thing)
+ `(add-to-list
+ ',alist
+ ',(cons (use-package-normalize-regex (car thing))
+ (cdr thing))))
+ (use-package-normalize-commands args))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
(setq msg
(concat msg
" (see the *use-package* buffer)"))))
- (ignore (display-warning 'use-package msg :error)))))
+ (display-warning 'use-package msg :error))))
,@(let ((use-package--hush-function
(apply-partially #'use-package-hush context)))
(funcall use-package--hush-function keyword
"Generate use-package custom keyword code."
(use-package-concat
(use-package-process-keywords name rest state)
- `((ignore
- ,@(cl-mapcan
- #'(lambda (def)
- (let ((syms (car def))
- (fun (cdr def)))
- (when fun
- (mapcar
- #'(lambda (sym)
- `(add-hook
- (quote ,(intern
- (concat (symbol-name sym)
- use-package-hook-name-suffix)))
- (function ,fun)))
- (if (use-package-non-nil-symbolp syms) (list syms) syms)))))
- (use-package-normalize-commands args))))))
+ (cl-mapcan
+ #'(lambda (def)
+ (let ((syms (car def))
+ (fun (cdr def)))
+ (when fun
+ (mapcar
+ #'(lambda (sym)
+ `(add-hook
+ (quote ,(intern
+ (concat (symbol-name sym)
+ use-package-hook-name-suffix)))
+ (function ,fun)))
+ (if (use-package-non-nil-symbolp syms) (list syms) syms)))))
+ (use-package-normalize-commands args))))
;;;; :commands
(condition-case-unless-debug err
(use-package-core name args)
(error
- (ignore
- (display-warning
- 'use-package
- (format "Failed to parse package %s: %s"
- name (error-message-string err)) :error)))))
+ (display-warning
+ 'use-package
+ (format "Failed to parse package %s: %s"
+ name (error-message-string err)) :error))))
(when use-package-compute-statistics
`((use-package-statistics-gather :use-package ',name t)))))))
(unless
(fboundp 'key2)
(autoload #'key2 "foo" nil t))
- (ignore
- (bind-keys :package foo
- ("C-k" . key1)
- ("C-u" . key2))))))
+ (bind-keys :package foo
+ ("C-k" . key1)
+ ("C-u" . key2)))))
(ert-deftest use-package-test/:bind-2 ()
(match-expansion
(autoload #'key1 "foo" nil t))
(unless (fboundp 'key2)
(autoload #'key2 "foo" nil t))
- (ignore
- (bind-keys :package foo
- ("C-k" . key1)
- ("C-u" . key2))))))
+ (bind-keys :package foo
+ ("C-k" . key1)
+ ("C-u" . key2)))))
(ert-deftest use-package-test/:bind-3 ()
(match-expansion
(unless
(fboundp 'key2)
(autoload #'key2 "foo" nil t))
- (ignore
- (bind-keys :package foo :map my-map
- ("C-k" . key1)
- ("C-u" . key2))))))
+ (bind-keys :package foo :map my-map
+ ("C-k" . key1)
+ ("C-u" . key2)))))
(ert-deftest use-package-test/:bind-4 ()
(should-error
(match-expansion
(use-package foo :bind :map my-map ("C-k" . key1) ("C-u" . key2))
- `(ignore
- (bind-keys :package foo)))))
+ `(bind-keys :package foo))))
(ert-deftest use-package-test/:bind-5 ()
(match-expansion
(autoload #'key1 "foo" nil t))
(unless (fboundp 'key2)
(autoload #'key2 "foo" nil t))
- (ignore
- (bind-keys :package foo
- ("C-k" . key1)
- :map my-map
- ("C-u" . key2))))))
+ (bind-keys :package foo
+ ("C-k" . key1)
+ :map my-map
+ ("C-u" . key2)))))
(ert-deftest use-package-test/:bind-6 ()
(match-expansion
(autoload #'key2 "foo" nil t))
(unless (fboundp 'key3)
(autoload #'key3 "foo" nil t))
- (ignore
- (bind-keys :package foo
- ("C-k" . key1)
- :map my-map ("C-u" . key2)
- :map my-map2 ("C-u" . key3))))))
+ (bind-keys :package foo
+ ("C-k" . key1)
+ :map my-map ("C-u" . key2)
+ :map my-map2 ("C-u" . key3)))))
(ert-deftest use-package-test/:bind-7 ()
(match-expansion
(use-package-ensure-elpa 'foo '(t) 'nil)
(unless (fboundp 'browse-at-remote)
(autoload #'browse-at-remote "foo" nil t))
- (ignore
- (bind-keys :package foo ("C-c r" . browse-at-remote))))))
+ (bind-keys :package foo ("C-c r" . browse-at-remote)))))
(ert-deftest use-package-test/:bind-8 ()
(match-expansion
(autoload #'foo "foo" nil t))
(unless (fboundp 'bar)
(autoload #'bar "foo" nil t))
- (ignore
- (bind-keys :package foo :map foo-map
- ("C-c r" . foo)
- ("C-c r" . bar))))))
+ (bind-keys :package foo :map foo-map
+ ("C-c r" . foo)
+ ("C-c r" . bar)))))
(ert-deftest use-package-test/:bind*-1 ()
(match-expansion
`(progn
(unless (fboundp 'key)
(autoload #'key "foo" nil t))
- (ignore
- (bind-keys* :package foo ("C-k" . key))))))
+ (bind-keys* :package foo ("C-k" . key)))))
(ert-deftest use-package-test/:bind-keymap-1 ()
(match-expansion
(use-package foo :bind-keymap ("C-k" . key))
- `(ignore
- (bind-key "C-k"
- #'(lambda nil
- (interactive)
- (use-package-autoload-keymap 'key 'foo nil))))))
+ `(bind-key "C-k"
+ #'(lambda nil
+ (interactive)
+ (use-package-autoload-keymap 'key 'foo nil)))))
(ert-deftest use-package-test/:bind-keymap*-1 ()
(match-expansion
(use-package foo :bind-keymap* ("C-k" . key))
- `(ignore
- (bind-key* "C-k"
- #'(lambda ()
- (interactive)
- (use-package-autoload-keymap 'key 'foo t))))))
+ `(bind-key* "C-k"
+ #'(lambda ()
+ (interactive)
+ (use-package-autoload-keymap 'key 'foo t)))))
(ert-deftest use-package-test/:interpreter-1 ()
(match-expansion
`(progn
(unless (fboundp 'foo)
(autoload #'foo "foo" nil t))
- (ignore
- (add-to-list 'interpreter-mode-alist '("interp" . foo))))))
+ (add-to-list 'interpreter-mode-alist '("interp" . foo)))))
(ert-deftest use-package-test/:interpreter-2 ()
(match-expansion
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-to-list 'interpreter-mode-alist '("interp" . fun))))))
+ (add-to-list 'interpreter-mode-alist '("interp" . fun)))))
(ert-deftest use-package-test-normalize/:mode ()
(flet ((norm (&rest args)
`(progn
(unless (fboundp 'foo)
(autoload #'foo "foo" nil t))
- (ignore
- (add-to-list 'auto-mode-alist '("interp" . foo))))))
+ (add-to-list 'auto-mode-alist '("interp" . foo)))))
(ert-deftest use-package-test/:mode-2 ()
(match-expansion
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-to-list 'auto-mode-alist '("interp" . fun))))))
+ (add-to-list 'auto-mode-alist '("interp" . fun)))))
(ert-deftest use-package-test/:magic-1 ()
(match-expansion
`(progn
(unless (fboundp 'foo)
(autoload #'foo "foo" nil t))
- (ignore
- (add-to-list 'magic-mode-alist '("interp" . foo))))))
+ (add-to-list 'magic-mode-alist '("interp" . foo)))))
(ert-deftest use-package-test/:magic-2 ()
(match-expansion
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-to-list 'magic-mode-alist '("interp" . fun))))))
+ (add-to-list 'magic-mode-alist '("interp" . fun)))))
(ert-deftest use-package-test/:magic-fallback-1 ()
(match-expansion
`(progn
(unless (fboundp 'foo)
(autoload #'foo "foo" nil t))
- (ignore
- (add-to-list 'magic-fallback-mode-alist '("interp" . foo))))))
+ (add-to-list 'magic-fallback-mode-alist '("interp" . foo)))))
(ert-deftest use-package-test/:magic-fallback-2 ()
(match-expansion
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-to-list 'magic-fallback-mode-alist '("interp" . fun))))))
+ (add-to-list 'magic-fallback-mode-alist '("interp" . fun)))))
(ert-deftest use-package-test/:commands-1 ()
(match-expansion
(autoload #'fun "foo" nil t))
(eval-when-compile
(declare-function fun "foo"))
- (ignore
- (add-hook 'hook-hook #'fun))
- (ignore
- (bind-keys :package foo ("C-a" . key)))))))
+ (add-hook 'hook-hook #'fun)
+ (bind-keys :package foo ("C-a" . key))))))
(ert-deftest use-package-test/:hook-2 ()
(match-expansion
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-hook 'hook-hook #'fun)))))
+ (add-hook 'hook-hook #'fun))))
(ert-deftest use-package-test/:hook-3 ()
(let ((use-package-hook-name-suffix nil))
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-hook 'hook #'fun))))))
+ (add-hook 'hook #'fun)))))
(ert-deftest use-package-test/:hook-4 ()
(let ((use-package-hook-name-suffix "-special"))
`(progn
(unless (fboundp 'fun)
(autoload #'fun "foo" nil t))
- (ignore
- (add-hook 'hook-special #'fun))))))
+ (add-hook 'hook-special #'fun)))))
(ert-deftest use-package-test/:hook-5 ()
(match-expansion
(eval-after-load 'elisp-mode
'(progn
(require 'erefactor nil nil)
- (ignore
- (add-hook
- 'emacs-lisp-mode-hook
- #'(lambda nil
- (bind-key "\ 3\16" erefactor-map emacs-lisp-mode-map)))))))))
+ (add-hook
+ 'emacs-lisp-mode-hook
+ #'(lambda nil
+ (bind-key "\ 3\16" erefactor-map emacs-lisp-mode-map))))))))
(ert-deftest use-package-test/:hook-6 ()
(match-expansion
'(progn
(unless (fboundp 'function)
(autoload #'function "erefactor" nil t))
- (ignore
- (add-hook 'emacs-lisp-mode-hook #'function)))))))
+ (add-hook 'emacs-lisp-mode-hook #'function))))))
(ert-deftest use-package-test/:hook-7 ()
(match-expansion
(eval-after-load 'elisp-mode
'(progn
(require 'erefactor nil nil)
- (ignore
- (add-hook 'emacs-lisp-mode-hook #'(lambda nil (function)))))))))
+ (add-hook 'emacs-lisp-mode-hook #'(lambda nil (function))))))))
(ert-deftest use-package-test-normalize/:custom ()
(flet ((norm (&rest args)
#'(lambda (keyword err)
(let ((msg (format "%s/%s: %s" 'foo keyword
(error-message-string err))))
- (ignore
- (display-warning 'use-package msg :error)))))
+ (display-warning 'use-package msg :error))))
(condition-case-unless-debug err
(require 'foo nil nil)
(error
(require 'counsel nil nil)
(if (fboundp 'diminish)
(diminish 'counsel-mode))
- (ignore
- (bind-keys :package counsel
- ("C-*" . counsel-org-agenda-headlines)
- ("M-x" . counsel-M-x))))))))
+ (bind-keys :package counsel
+ ("C-*" . counsel-org-agenda-headlines)
+ ("M-x" . counsel-M-x)))))))
(ert-deftest use-package-test/:config-1 ()
(match-expansion
(autoload #'mu4e "mu4e" nil t))
(eval-after-load 'mu4e
'(progn (config) t))
- (ignore
- (bind-keys :package mu4e ("<f9>" . mu4e))))))
+ (bind-keys :package mu4e ("<f9>" . mu4e)))))
(ert-deftest use-package-test/543 ()
(match-expansion
(unless
(fboundp 'company-try-hard)
(autoload #'company-try-hard "company-try-hard" nil t))
- (ignore
- (bind-keys :package company-try-hard
- ("C-c M-/" . company-try-hard)
- :map company-active-map
- ("C-c M-/" . company-try-hard))))))
+ (bind-keys :package company-try-hard
+ ("C-c M-/" . company-try-hard)
+ :map company-active-map
+ ("C-c M-/" . company-try-hard)))))
(ert-deftest use-package-test/558 ()
(match-expansion
'(progn
(message "test. helm start")
t))
- (ignore
- (bind-keys :package helm ("C-c d" . helm-mini))))))
+ (bind-keys :package helm ("C-c d" . helm-mini)))))
(ert-deftest bind-key/:prefix-map ()
(match-expansion