[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 187b07d 315/325: Describe keys for the c
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 187b07d 315/325: Describe keys for the current buffer |
Date: |
Sat, 23 Oct 2021 18:49:19 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 187b07d247519ff4316d88511072b55f91ea014b
Author: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Commit: Matthew Fidler <514778+mattfidler@users.noreply.github.com>
Describe keys for the current buffer
---
ergoemacs-functions.el | 2 +-
ergoemacs-theme-engine.el | 71 +++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 3bd1d6a..5c6b815 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -149,7 +149,7 @@ KEY3 is the optional third key in the sequence."
(ergoemacs--send-emacs-key ?\C-x ?\C-w))
(defun ergoemacs-goto-line ()
- "Ergoemacs replacement for `write-file' using `ergoemacs--send-emacs-key'."
+ "Ergoemacs replacement for `goto-line' using `ergoemacs--send-emacs-key'."
(interactive)
(ergoemacs--send-emacs-key ?\M-g ?\M-g))
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 673b976..336c653 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -292,11 +292,53 @@
(defvar ergoemacs-theme--svg-prefixes nil)
(defvar ergoemacs-theme--svg-prefix nil)
+(defvar ergoemacs--emacs-command-emulation-list
+ '((kill-line ?\C-k)
+ (mark-whole-buffer ?\C-x ?h)
+ (find-file ?\C-x ?\C-f)
+ (save-buffer ?\C-x ?\C-s)
+ (write-file ?\C-x ?\C-w)
+ (goto-line ?\M-g ?\M-g)
+ (delete-char ?\C-d)
+ (move-beginning-of-line ?\C-a)
+ (move-end-of-line ?\C-e)
+ (set-mark-command ?\C-\ )
+ (delete-backward-char 127)
+ (delete-char ?\C-d)
+ (kill-word ?\M-d)
+ (backward-word ?\M-b)
+ (backward-kill-word C-backspace)
+ (forward-word ?\M-f)
+ (backward-paragraph ?\M-\{)
+ (forward-paragraph ?\M-\})
+ (scroll-down-command ?\M-v)
+ (scroll-up-command ?\C-v)
+ (beginning-of-buffer ?\M-\<)
+ (end-of-buffer ?\M-\>)
+ (query-replace ?\M-\%)
+ (query-replace-regexp ?\C-\M-\%)
+ (other-window ?\C-x ?o)
+ (delete-other-windows ?\C-x ?1)
+ (delete-window ?\C-x ?0)
+ (split-window-below ?\C-x ?2)
+ (split-window-right ?\C-x ?3)
+ (switch-to-buffer ?\C-x ?b)
+ (shell-command ?\M-\!)
+ (recenter-top-bottom ?\C-l)
+ (comment-dwim ?\M-\;)
+ (delete-horizontal-space ?\M-\\)
+ (mark-paragraph ?\M-\S-\ ))
+ "List of commands/keys that `ergoemacs-mode' replaces and send general emacs
keys.")
+
+(defvar ergoemacs--emacs-command-emulation-map nil
+ "Keymap to describe the emacs-command-emulations")
+
(defun ergoemacs-theme-describe ()
"Display the full documentation for Ergoemacs."
(interactive)
(let* (required-p
- svg png tmp)
+ svg png tmp map
+ (cb (current-buffer)))
(setq svg (ergoemacs-theme--svg)
png (ergoemacs-theme--png))
(help-setup-xref (list #'ergoemacs-theme-describe)
@@ -352,7 +394,32 @@
(insert "\n\n"))))
(insert "\n\n")
(setq required-p t)
- (insert "\n\n")
+ (when ergoemacs-mode-send-emacs-keys
+ (setq ergoemacs--emacs-command-emulation-map (make-sparse-keymap))
+ (dolist (elt ergoemacs--emacs-command-emulation-list)
+ (let* (; Turn of ergoemacs-mode keys for tranlsation
+ (ergoemacs-mode-regular nil)
+ (ergeoemacs-mode-term-raw-mode nil)
+ (ergoemacs--ena-prefix-override-keymap nil)
+ (ergoemacs--ena-prefix-repeat-keymap nil)
+ (ergoemacs--ena-region-keymap nil)
+ (ergoemacs-mode-send-emacs-keys nil)
+ ;; Get the emacs key
+ (emacs-key (vconcat (cdr elt)))
+ ;; Get Currently bound command
+ (emacs-command (with-current-buffer cb (key-binding
emacs-key t t)))
+ ;; Get the ergoemacs-mode keys
+ (command (car elt))
+ (keys (where-is-internal command ergoemacs-override-keymap
nil t t))
+ first-elt)
+ (when keys
+ (dolist (k keys)
+ (setq first-elt (aref k 0))
+ (unless (and (numberp first-elt) (= first-elt 27))
+ (message "do")
+ (define-key ergoemacs--emacs-command-emulation-map k
command))))))
+ (insert "Commands that ergoemacs keys run in current buffer\n\n")
+ (insert (substitute-command-keys
"\\{ergoemacs--emacs-command-emulation-map}")))
(buffer-string)))))
(defun ergoemacs-theme--svg-elt-nonabbrev (what)
- [elpa] externals/ergoemacs-mode 6b1b60e 039/325: Cleanup, (continued)
- [elpa] externals/ergoemacs-mode 6b1b60e 039/325: Cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode fdafbdf 049/325: Cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 2c3dbbf 098/325: Remove f1 binding and unused swiper(), Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 12a1552 259/325: Remove ergoemacs-timing, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 97ac03f 081/325: Resolve all of the :emacs keybindings in ergoemacs-themes, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 74ad06f 228/325: Remove deftheme, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ba79935 258/325: Remove lookup and information about global map, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode a5febc9 291/325: Remove shift selection and try to fix C-S-x C-S-c, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode a9cea74 303/325: Make ergoemacs-describe-current-theme and "C-h '" work., Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode e778e82 307/325: Take out debug echo AND fix backward delete, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 187b07d 315/325: Describe keys for the current buffer,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode de3c5e7 262/325: Restore isearch-mode-map, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 42833ac 264/325: Code cleanup, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode ac33443 265/325: Add back the M-n commands for the reduction keymap, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 29ebf6e 271/325: Add compilation mode map to catch some of greps keys, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 81466b3 284/325: Unwind protect the timer #505, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode a38e4f3 275/325: Add option for keeping emacs keys that are not overwritten by ergoemacs, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 48c6d90 274/325: Merge branch 'mattfidler-master', Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 6c4b457 280/325: Add emacs type of command loop support., Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 4a8da69 288/325: Bug fix for mark-active keymap, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode aba186d 290/325: Add back cua keys without cua mode, back to ergoemacs-timeout, Stefan Monnier, 2021/10/23