summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/init.el b/init.el
index 3be2c51..85bd2f3 100644
--- a/init.el
+++ b/init.el
@@ -197,8 +197,12 @@
(global-set-key (kbd "M-@") 'er/expand-region)
;; Swap C-t and C-x, so it's easier to type on Dvorak layout
-(keyboard-translate ?\C-t ?\C-x)
-(keyboard-translate ?\C-x ?\C-t)
+;; `keyboard-translate` does not work when attaching an emacsclient to
+;; a running emacs in daemon mode, so instead we define the key in the
+;; key-translation-map.
+;; http://lists.gnu.org/archive/html/help-gnu-emacs/2009-10/msg00505.html
+(define-key key-translation-map [?\C-x] [?\C-t])
+(define-key key-translation-map [?\C-t] [?\C-x])
;; kill current buffer
(global-set-key (kbd "C-x C-k") (lambda ()