summaryrefslogtreecommitdiff
path: root/lisp/use-package/use-package-chords.el
blob: 4a4d9e7fea73a00b148992b88e66ac6cc0354a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; use-package-chords.el --- key-chord keyword for use-package  -*- lexical-binding: t; -*-

;; Copyright (C) 2015-2022 Free Software Foundation, Inc.

;; Author: Justin Talbott <justin@waymondo.com>
;; Keywords: convenience, tools, extensions
;; URL: https://github.com/jwiegley/use-package
;; Version: 0.2.1
;; Package-Requires: ((use-package "2.1") (bind-key "1.0") (bind-chord "0.2") (key-chord "0.6"))
;; Filename: use-package-chords.el
;; License: GNU General Public License version 3, or (at your option) any later version
;;

;;; Commentary:
;;
;; The `:chords' keyword allows you to define `key-chord' bindings for
;; `use-package' declarations in the same manner as the `:bind'
;; keyword.
;;

;;; Code:

(require 'use-package)
(require 'bind-chord)

;;;###autoload
(defalias 'use-package-autoloads/:chords 'use-package-autoloads-mode)

;;;###autoload
(defalias 'use-package-normalize/:chords 'use-package-normalize-binder)

;;;###autoload
(defun use-package-handler/:chords (name _keyword arg rest state)
  "Handler for `:chords' keyword in `use-package'."
  (use-package-concat
   (use-package-process-keywords name rest state)
   `(,(macroexpand
       `(bind-chords :package ,name ,@arg)))))

(add-to-list 'use-package-keywords :chords)

(provide 'use-package-chords)

;;; use-package-chords.el ends here