branch: externals/ergoemacs-mode commit aafc9d9ad8d008ec046f1c4f5114a229ce085b06 Author: Walter Landry <wlan...@caltech.edu> Commit: Walter Landry <wlan...@caltech.edu>
Implement many standard-fixed bindings in a regular function Also remove bindings for <next> and <prior> since they are not readily available. Remove a stray binding for <f5>. --- ergoemacs-test.el | 37 +------------------------------------ ergoemacs-themes.el | 44 ++++++++++++++------------------------------ 2 files changed, 15 insertions(+), 66 deletions(-) diff --git a/ergoemacs-test.el b/ergoemacs-test.el index fc56462..462d1cb 100644 --- a/ergoemacs-test.el +++ b/ergoemacs-test.el @@ -259,23 +259,6 @@ sunt in culpa qui officia deserunt mollit anim id est laborum.") (should (string= "3" (match-string 0)))) (kill-buffer (current-buffer))))) -(ert-deftest ergoemacs-test-isearch-exit-C-s () - "Make sure C-s works outside of `ergoemacs-mode'. Issue #361." - :tags '(:search) - (ergoemacs-mode -1) - (should (eq (lookup-key isearch-mode-map (kbd "C-s")) 'isearch-repeat-forward)) - (should (eq (lookup-key isearch-mode-map (kbd "C-r")) 'isearch-repeat-backward)) - (save-excursion - (switch-to-buffer (get-buffer-create "*ergoemacs-test*")) - (delete-region (point-min) (point-max)) - (insert "aars1\nars2\nars3\nars4") - (goto-char (point-min)) - (execute-kbd-macro (read-kbd-macro "C-s ars C-s C-s")) - (when (looking-at ".*") - (should (string= "3" (match-string 0)))) - (kill-buffer (current-buffer))) - (ergoemacs-mode 1)) - (ert-deftest ergoemacs-test-isearch-in-eshell () "Test Issue #322." :tags '(:search) @@ -462,7 +445,7 @@ not using cua or cutting line. I think kill-region is what is meant." (ert-deftest ergoemacs-test-function-unbind-commands-active () "Make sure the unbound keys work" - (should (eq 'ergoemacs-map-undefined (key-binding (read-kbd-macro "C-x C-s"))))) + (should (eq nil (key-binding (read-kbd-macro "C-x C-s"))))) (ert-deftest ergoemacs-test-function-M-f-only-one-char-issue-306 () "Tests Issue #306." @@ -1119,24 +1102,6 @@ Part of addressing Issue #147." ;; The user-defined C-w should not affect kill-region remaps. (should (not (eq (key-binding [ergoemacs-remap kill-region]) 'ergoemacs-close-current-buffer)))))) -(ert-deftest ergoemacs-test-keep-ctl-s () - "Keep ergoemacs defined C-s in major-mode `ergoemacs-test-major-mode'. -Part of addressing Issue #147." - :tags '(:interactive) - (ergoemacs-test-layout - (let (ret - (ergoemacs-use-function-remapping t)) - (with-temp-buffer - (ergoemacs-test-major-mode) - (when (not (current-local-map)) - (use-local-map ergoemacs-test-major-mode-map)) - (ergoemacs-map--modify-active) - (should (eq (key-binding (kbd "C-s")) 'save-buffer)) - ) - ) - ) - ) - (ert-deftest ergoemacs-test-keep-alt-s () "Keep ergoemacs defined M-s in major-mode `ergoemacs-test-major-mode'. Tests Issue #372." diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index 00f54df..d2c2cff 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -151,9 +151,7 @@ ) ;;; Fixed components -(ergoemacs-component standard-fixed () - "Standard Fixed Shortcuts" - :variable-reg nil ;; No variable keys +(defun ergoemacs-set-standard-fixed () (global-set-key [tool-bar kill-buffer] 'ergoemacs-close-current-buffer) (global-set-key (kbd "C-x C-f") nil) ;; Remove Emacs Method @@ -163,8 +161,8 @@ (global-set-key (kbd "C-S-t") 'ergoemacs-open-last-closed) (global-set-key (kbd "C-w") 'ergoemacs-close-current-buffer) - (global-set-key (kbd "C-s") nil) ;; Search Forward (global-set-key (kbd "C-f") 'isearch-forward) + (define-key isearch-mode-map (kbd "C-f") 'isearch-repeat-forward) (global-set-key (kbd "C-x C-s") nil) ;; Save File (global-set-key (kbd "C-s") 'save-buffer) @@ -179,12 +177,6 @@ (global-set-key (kbd "C-z") 'undo) - ;; Take out undo-tree's redo bindings - (define-key undo-tree-map (kbd "C-?") nil) - (define-key undo-tree-map (kbd "M-_") nil) - - (global-set-key (kbd "C-S-z") '(redo undo-tree-redo)) - (global-set-key (kbd "M-S-z") '(redo undo-tree-redo)) (global-set-key (kbd "<S-delete>") 'ergoemacs-cut-line-or-region) (global-set-key (kbd "<C-insert>") 'ergoemacs-copy-line-or-region) (global-set-key (kbd "C-S-v") 'ergoemacs-paste-cycle) @@ -215,25 +207,9 @@ (global-set-key (kbd "<M-up>") 'ergoemacs-backward-block) (global-set-key (kbd "<M-down>") 'ergoemacs-forward-block) - ;; C-H is search and replace. - - ;; C-1 to C-9 should be switch tab... Same as in Google chrome. - ;; C-T should be new tab. - - ;; Refresh should be <f5>; erogemacs uses <f5>. ;; C-r also should be refresh - (global-set-key (kbd "<f5>") 'revert-buffer) (global-set-key (kbd "C-r") 'revert-buffer) - - ;; Text Formatting - ;; Upper/Lower case toggle. - ;; Ergoemacs fixed keys... - - (global-set-key (kbd "<M-f4>") 'ergoemacs-delete-frame) ;; Alt+f4 should work. - - ; Alt+→ - ;; Allow shift selection (global-set-key (kbd "C-+") 'text-scale-increase) (global-set-key (kbd "C-=") 'text-scale-increase) (global-set-key (kbd "C--") 'text-scale-decrease) @@ -262,11 +238,18 @@ (global-set-key (kbd "C-x k") nil) (global-set-key (kbd "C-w") 'ergoemacs-close-current-buffer) - (global-set-key (kbd "C-x C-b") 'ibuffer) - (global-set-key (kbd "C-y") '(redo undo-tree-redo) "↷ redo") + (global-set-key (kbd "M-B") 'ibuffer) + ) + +(ergoemacs-component standard-fixed () + "Standard Fixed Shortcuts" + :variable-reg nil ;; No variable keys + ;; Take out undo-tree's redo bindings + (define-key undo-tree-map (kbd "C-?") nil) + (define-key undo-tree-map (kbd "M-_") nil) - (global-set-key (kbd "M-S-<next>") 'forward-page) - (global-set-key (kbd "M-S-<prior>") 'backward-page) + (global-set-key (kbd "C-S-z") '(redo undo-tree-redo)) + (global-set-key (kbd "M-S-z") '(redo undo-tree-redo)) ;; Mode specific changes @@ -1301,6 +1284,7 @@ (defun ergoemacs-install-standard-theme () (ergoemacs-set-standard-vars) + (ergoemacs-set-standard-fixed) ) (add-hook 'ergoemacs-mode-startup-hook #'ergoemacs-install-standard-theme)