emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/bind-map b47b98455f 87/97: Simplify macro exp. for bind-ma


From: ELPA Syncer
Subject: [nongnu] elpa/bind-map b47b98455f 87/97: Simplify macro exp. for bind-mapfor-mode-inherit
Date: Thu, 20 Jan 2022 07:59:29 -0500 (EST)

branch: elpa/bind-map
commit b47b98455ff015cc408c1ce55fb3b6c259067f17
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>

    Simplify macro exp. for bind-mapfor-mode-inherit
---
 bind-map.el | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/bind-map.el b/bind-map.el
index 2a620eb690..b92f5a9799 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -389,21 +389,20 @@ and :evil-states. All others must be declared explicitly."
          (minor-modes (plist-get args :minor-modes))
          (major-modes (plist-get args :major-modes))
          (bindings (plist-get args :bindings)))
-    `(progn
-       (if (and (null ',minor-modes)
-                (null ',major-modes))
-           (user-error "bind-map-for-modes-derived called without \
-reference to :major-modes or :minor-modes")
-         (bind-map ,map
-           :prefix-cmd ,(plist-get args :prefix-cmd)
-           :override-mode-name ,(plist-get args :override-mode-name)
-           :minor-modes ,minor-modes
-           :major-modes ,major-modes
-           :bindings ,bindings
-           ,@(bind-map--get-prop :override-minor-modes args parent-args)
-           ,@(bind-map--get-prop :keys args parent-args)
-           ,@(bind-map--get-prop :evil-keys args parent-args)
-           ,@(bind-map--get-prop :evil-states args parent-args))))))
+    (when (and (null minor-modes)
+               (null major-modes))
+      (user-error "bind-map-for-modes-derived called without \
+reference to :major-modes or :minor-modes"))
+    `(bind-map ,map
+       :prefix-cmd ,(plist-get args :prefix-cmd)
+       :override-mode-name ,(plist-get args :override-mode-name)
+       :minor-modes ,minor-modes
+       :major-modes ,major-modes
+       :bindings ,bindings
+       ,@(bind-map--get-prop :override-minor-modes args parent-args)
+       ,@(bind-map--get-prop :keys args parent-args)
+       ,@(bind-map--get-prop :evil-keys args parent-args)
+       ,@(bind-map--get-prop :evil-states args parent-args))))
 
 ;;;###autoload
 (defmacro bind-map-for-major-mode (major-mode-sym &rest args)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]