From e1fcc4454ef905b99250a8e2f71f8f2c4a1d6b44 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 5 Oct 2012 10:31:31 +0300 Subject: [PATCH] added a very helpful command prelude-swap-meta-and-super bound to C-c w --- prelude/prelude-osx.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/prelude/prelude-osx.el b/prelude/prelude-osx.el index f6a8484..9e1a6b9 100644 --- a/prelude/prelude-osx.el +++ b/prelude/prelude-osx.el @@ -11,4 +11,21 @@ ;; but they do need Meta and Super (setq mac-command-modifier 'super) (setq mac-option-modifier 'meta) + +(defun prelude-swap-meta-and-super () + "Swap the mapping of meta and super. Very useful for people using their Mac +with a Windows external keyboard from time to time." + (interactive) + (if (eq mac-command-modifier 'super) + (progn + (setq mac-command-modifier 'meta) + (setq mac-option-modifier 'super) + (message "Command is now bound to META and Option is bound to SUPER.")) + (progn + (setq mac-command-modifier 'super) + (setq mac-option-modifier 'meta) + (message "Command is now bound to SUPER and Option is bound to META.")))) + +(define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super) + (provide 'prelude-osx)