branch: externals/ergoemacs-mode commit 63f665b2e354142f0db9a17c5e53ba99d3195242 Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
Make calc-bindings work again. --- ergoemacs-functions.el | 12 ++++++++++++ ergoemacs-themes.el | 11 ++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el index 8bc645d..6543e0e 100644 --- a/ergoemacs-functions.el +++ b/ergoemacs-functions.el @@ -99,6 +99,16 @@ '(delete-backward-char delete-char kill-word backward-kill-word) "Defines deletion functions that ergoemacs is aware of.") +;;;###autoload +(defun ergoemacs-undo () + "Run `undo'. If in calc-mode, run `calc-undo'" + (interactive) + (if (eq major-mode 'calc-mode) + (calc-undo 1) + (undo) + ) + ) + (defvar ergoemacs-revert-buffer 0) (defun ergoemacs-revert-buffer () "Ergoemacs replacement of `revert-buffer'. @@ -2040,6 +2050,8 @@ If in `term-mode', run `term-paste'. (cond ((eq major-mode 'term-mode) (term-paste)) + ((eq major-mode 'calc-mode) + (calc-yank nil)) ((and isearch-mode ergoemacs-smart-paste (eq last-command 'isearch-yank-kill)) (isearch-yank-pop) (setq this-command 'isearch-yank-pop)) diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index bc9d958..3a94742 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -306,7 +306,7 @@ calling any other ergoemacs-set-* function" (global-set-key (kbd "C-f") 'isearch-forward) (define-key isearch-mode-map (kbd "C-f") 'isearch-repeat-forward) (global-set-key (kbd "C-a") 'mark-whole-buffer) - (global-set-key (kbd "C-z") 'undo) + (global-set-key (kbd "C-z") 'ergoemacs-undo) (global-set-key (kbd "<S-delete>") 'ergoemacs-cut-line-or-region) (global-set-key (kbd "<C-insert>") 'ergoemacs-copy-line-or-region) @@ -411,7 +411,7 @@ calling any other ergoemacs-set-* function" (ergoemacs-define-key keymap (kbd "M-X") 'ergoemacs-cut-all) ;; Undo - (ergoemacs-define-key keymap (kbd "M-z") 'undo) + (ergoemacs-define-key keymap (kbd "M-z") 'ergoemacs-undo) (ergoemacs-define-key keymap (kbd "C-S-x") 'execute-extended-command) (global-set-key (kbd "C-z") 'undo) @@ -1107,13 +1107,6 @@ calling any other ergoemacs-set-* function" ) (add-hook 'org-load-hook #'ergoemacs-install-org-bindings) -(defun ergoemacs-install-calc-bindings () - (ergoemacs-define-key calc-mode-map (kbd "M-v") 'calc-yank) - (ergoemacs-define-key calc-mode-map (kbd "M-z") 'calc-undo) - ) -(add-hook 'calc-load-hook #'ergoemacs-install-calc-bindings) - - (defun ergoemacs-install-log-edit-bindings () (ergoemacs-unset-keys-in-map log-edit-mode-map) (define-key log-edit-mode-map (kbd "C-s") 'log-edit-done)