[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 87b722e 251/325: Make calculate ergoemac
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 87b722e 251/325: Make calculate ergoemacs bindings an interactive function |
Date: |
Sat, 23 Oct 2021 18:49:04 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 87b722e4b2cf1c33e0a29d90d632f7249bbd69a4
Author: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Commit: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Make calculate ergoemacs bindings an interactive function
---
ergoemacs-calculate-bindings.el | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/ergoemacs-calculate-bindings.el b/ergoemacs-calculate-bindings.el
index b11f0a0..745bc94 100644
--- a/ergoemacs-calculate-bindings.el
+++ b/ergoemacs-calculate-bindings.el
@@ -116,8 +116,7 @@ SPACE represents the amount of sacing to add"
(let* ((command (nth 1 elt))
(key (nth 0 elt))
(key-code (read-kbd-macro key))
- (bind (lookup-key (symbol-value keymap) key-code))
- ergoemacs-command)
+ (bind (lookup-key (symbol-value keymap) key-code)))
(when bind
(dolist (ergoemacs-command (where-is-internal command
ergoemacs-override-keymap nil t t))
(insert (format "%s(ergoemacs-define-key %s (kbd \"%s\") '%s)" space
(symbol-name keymap)
@@ -127,6 +126,31 @@ SPACE represents the amount of sacing to add"
(defvar ergoemacs-calculate-bindings-for-both-theme--tmp nil)
(defun ergoemacs-calculate-bindings-for-both-themes (keymap)
+ "Calculates ergoemacs-style bindings for KEYMAP."
+ (interactive
+ (let ((v (variable-at-point))
+ (enable-recursive-minibuffers t)
+ (orig-buffer (current-buffer))
+ val)
+ (setq val (completing-read
+ (if (and (symbolp v) (keymapp (symbol-value v)))
+ (format
+ "Calculate egoemacs-mode keybindings for keymap (default
%s): " v)
+ "Calculate ergoemacs-mode keybindings: ")
+ #'help--symbol-completion-table
+ (lambda (vv)
+ ;; In case the variable only exists in the buffer
+ ;; the command we switch back to that buffer before
+ ;; we examine the variable.
+ (with-current-buffer orig-buffer
+ (and (boundp vv) (keymapp (symbol-value vv)))))
+ t nil nil
+ (if (and (symbolp v) (keymapp (symbol-value v)))
+ (symbol-name v))))
+ (list (if (equal val "")
+ v (intern val)))))
+ (when (stringp v)
+ (error "This funcion requires a keymap"))
(setq ergoemacs-calculate-bindings-for-both-theme--tmp
(copy-keymap ergoemacs-override-keymap)
ergoemacs-override-keymap (make-sparse-keymap))
- [elpa] externals/ergoemacs-mode 09bc371 278/325: Restore menu items after turning off ergoemacs, (continued)
- [elpa] externals/ergoemacs-mode 09bc371 278/325: Restore menu items after turning off ergoemacs, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f14b71e 281/325: Remove ergoemacs-mode support for term-mode, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f3ebfc1 298/325: Add input-pending-p to echoing of commands, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 349d05a 300/325: Remove describe theme, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 00e00a6 230/325: Remove ergoemacs-component-struct, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 37fc1c8 233/325: Remove ergoemacs-theme-component--parse, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 6f703fe 235/325: Remove ergoemacs-advice, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d0004ec 241/325: Remove more -map functions, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ea88aad 247/325: Add back the command loop, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d43bb0a 248/325: Fix command loop, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 87b722e 251/325: Make calculate ergoemacs bindings an interactive function,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode 4c1fe49 252/325: Fix some issues, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode b7f909a 254/325: Some fixes, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f28dc66 255/325: Add some active keymaps to ergoemacs-mode (like before), Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ecb9ac7 256/325: Align some more of the keys with what was there before. Add redo, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 9e58dd5 261/325: Simplify, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode b4b14f2 260/325: Remove ergoemacs-component, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode bde293e 263/325: Drop cache and hashkey, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 4250fae 267/325: Remove more outdated keys, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode b815b1d 273/325: Merge branch 'master' of https://github.com/mattfidler/ergoemacs-mode into mattfidler-master, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f46ac1c 276/325: Fix typo, Stefan Monnier, 2021/10/23