[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/taxy f00bcd4b4e 3/3: Change: (deffy-define-key type) Im
From: |
ELPA Syncer |
Subject: |
[elpa] externals/taxy f00bcd4b4e 3/3: Change: (deffy-define-key type) Improve categorization |
Date: |
Mon, 27 Jun 2022 01:58:05 -0400 (EDT) |
branch: externals/taxy
commit f00bcd4b4ee2358678ec994192c286cdd477ec1c
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change: (deffy-define-key type) Improve categorization
---
examples/deffy.el | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/examples/deffy.el b/examples/deffy.el
index 4e2dc9ceca..2576cf7bf4 100644
--- a/examples/deffy.el
+++ b/examples/deffy.el
@@ -73,7 +73,7 @@
(deffy-define-key type ()
(pcase-let* (((cl-struct deffy-def form) item)
(type (pcase form
- (`(,(or 'defun 'cl-defun) . ,_)
+ (`(,(or 'defun 'cl-defun 'defalias) . ,_)
(if (cl-find-if (lambda (form)
(pcase form
(`(interactive . ,_) t)))
@@ -82,7 +82,24 @@
'function))
(`(,(or 'defmacro 'cl-defmacro) . ,_)
'macro)
- (`(,car . ,_) car))))
+ (`(,(or 'cl-defstruct) . ,_)
+ 'struct)
+ (`(,(or 'defclass) . ,_)
+ 'class)
+ (`(,(or 'defcustom 'defgroup 'defvar 'defvar-local) .
,_)
+ 'variable)
+ (`(,(or 'provide 'require) . ,_)
+ 'feature)
+ ;; Top-level forms that don't usually correspond to
definitions,
+ ;; so we ignore them.
+ (`(,(or 'cl-eval-when 'eval-when-compile
'with-eval-after-load) . ,_)
+ nil)
+ (`(,(or 'unless 'when) . ,_)
+ nil)
+ ;; Top-level forms that are macro calls (e.g. custom
defining macros).
+ ((and `(,car . ,_) (guard (macrop car))) car)
+ ;; Anything else: ignored.
+ (`(,car . ,_) nil))))
(when type
(format "%s" type)))))