summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Moreau <nathan.moreau@m4x.org>2019-11-08 04:17:44 +0100
committerNathan Moreau <nathan.moreau@m4x.org>2019-11-08 04:59:54 +0100
commit6a5725328a155e12fee567de03a4625e3eddac26 (patch)
treee802473b52e93fd346d1e5b5453ecdfa98a68f86
parenta36bc7096ac203d4f10a4ce3ce3ef39aa2df8a66 (diff)
downloadrust-mode-6a5725328a155e12fee567de03a4625e3eddac26.tar.gz
rust-dbg-wrap-or-unwrap: bind to C-c C-d rather than C-c d.
see `Key Binding Conventions' in the Emacs manual.
-rw-r--r--rust-mode-tests.el21
-rw-r--r--rust-mode.el2
2 files changed, 22 insertions, 1 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 343b6c1..b234771 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3283,3 +3283,24 @@ impl Two<'a> {
(equal "tmp<T>" (buffer-substring-no-properties (point-min)
(point-max)))))
(electric-pair-mode (or old-electric-pair-mode 1))))))
+
+(ert-deftest rust-mode-map ()
+ (with-temp-buffer
+ (let (from to match (match-count 0))
+ (rust-mode)
+ (describe-buffer-bindings (current-buffer))
+ (goto-char (point-min))
+ (re-search-forward "Major Mode Bindings")
+ (setq from (point))
+ (re-search-forward " ")
+ (setq to (point))
+ (goto-char from)
+ (while (re-search-forward "^C-c.*$" to t)
+ (setq match-count (1+ match-count))
+ (setq match (match-string 0))
+ (eval
+ `(should
+ (or
+ (string-match "Prefix Command" ,match)
+ (string-match "^C-c C" ,match)))))
+ (should (< 0 match-count)))))
diff --git a/rust-mode.el b/rust-mode.el
index b381893..b839558 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1583,7 +1583,7 @@ Return the created process."
(defvar rust-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-f") 'rust-format-buffer)
- (define-key map (kbd "C-c d") 'rust-dbg-wrap-or-unwrap)
+ (define-key map (kbd "C-c C-d") 'rust-dbg-wrap-or-unwrap)
map)
"Keymap for Rust major mode.")