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

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

[elpa] 149/287: Backport `make-composed-keymap'.


From: Matthew Fidler
Subject: [elpa] 149/287: Backport `make-composed-keymap'.
Date: Wed, 02 Jul 2014 14:45:29 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 764b0505f0ff28d63fd985cb111381bfc5b1808e
Author: Matthew L. Fidler <address@hidden>
Date:   Wed Jun 18 13:46:26 2014 -0500

    Backport `make-composed-keymap'.
---
 ergoemacs-mode.el |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el
index cab9b0e..40b8cfa 100644
--- a/ergoemacs-mode.el
+++ b/ergoemacs-mode.el
@@ -258,6 +258,22 @@ Valid values are:
 (defvar ergoemacs-unbind-keys nil)
 (defvar ergoemacs-read-input-keys nil)
 
+(unless (fboundp 'make-composed-keymap)
+  ;; Backport `make-composed-keymap'
+  (defun make-composed-keymap (maps &optional parent)
+    "Construct a new keymap composed of MAPS and inheriting from PARENT.
+When looking up a key in the returned map, the key is looked in each
+keymap of MAPS in turn until a binding is found.
+If no binding is found in MAPS, the lookup continues in PARENT, if non-nil.
+As always with keymap inheritance, a nil binding in MAPS overrides
+any corresponding binding in PARENT, but it does not override corresponding
+bindings in other keymaps of MAPS.
+MAPS can be a list of keymaps or a single keymap.
+PARENT if non-nil should be a keymap."
+    `(keymap
+      ,@(if (keymapp maps) (list maps) maps)
+      ,@parent)))
+
 (unless (featurep 'ergoemacs-theme-engine)
   (load "ergoemacs-theme-engine"))
 



reply via email to

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