From dee6a8752a13778ab6de9afbddb95317a86ad920 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 15 Jul 2022 20:05:05 +0300 Subject: [PATCH] Use the kbd macro for all keybindings This makes more complex keybindings easier to read and write. --- src/top/utop.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/top/utop.el b/src/top/utop.el index 652d29f..4dfa65a 100644 --- a/src/top/utop.el +++ b/src/top/utop.el @@ -140,20 +140,20 @@ This hook is only run if exiting actually kills the buffer." (defvar utop-mode-map (let ((map (make-sparse-keymap))) - (define-key map [return] 'utop-eval-input-or-newline) - (define-key map [(control ?m)] 'utop-eval-input-or-newline) - (define-key map [(control ?j)] 'utop-eval-input-auto-end) - (define-key map [home] 'utop-bol) - (define-key map [(control ?a)] 'utop-bol) - (define-key map [(meta ?p)] 'utop-history-goto-prev) - (define-key map [(meta ?n)] 'utop-history-goto-next) + (define-key map (kbd "RET") 'utop-eval-input-or-newline) + (define-key map (kbd "C-m") 'utop-eval-input-or-newline) + (define-key map (kbd "C-j") 'utop-eval-input-auto-end) + (define-key map (kbd "") 'utop-bol) + (define-key map (kbd "C-a") 'utop-bol) + (define-key map (kbd "M-p") 'utop-history-goto-prev) + (define-key map (kbd "M-n") 'utop-history-goto-next) (define-key map (kbd "TAB") 'utop-complete) - (define-key map [(control ?c) (control ?c)] 'utop-interrupt) - (define-key map [(control ?c) (control ?i)] 'utop-interrupt) - (define-key map [(control ?c) (control ?k)] 'utop-kill) - (define-key map [(control ?c) (control ?g)] 'utop-exit) - (define-key map [(control ?c) (control ?s)] 'utop) - (define-key map [(control ?c) ?m] 'utop-copy-old-input) + (define-key map (kbd "C-c C-c") 'utop-interrupt) + (define-key map (kbd "C-c C-i") 'utop-interrupt) + (define-key map (kbd "C-c C-k") 'utop-kill) + (define-key map (kbd "C-c C-g") 'utop-exit) + (define-key map (kbd "C-c C-s") 'utop) + (define-key map (kbd "C-c m") 'utop-copy-old-input) map) "The utop local keymap.")