When building the vanilla version of Emacs --with-ns
, the default key bindings in ns-win.el
are put into place. To disable specific bindings, just set them to nil
. If a binding is set outside of Emacs (e.g., System Preferences of OSX), then Emacs would never even get the opportunity to see the keys because they would get intercepted before reaching Emacs.
For example, to disable copy and paste, you would add the following to your emacs configuration file (traditionally, ~/.emacs):
;; Disable Mac keyboard commands.
;; (s is for super)
(define-key global-map [?\s-c] nil) ;; Disable command c (copy)
(define-key global-map [?\s-v] nil) ;; Disable command v (paste)
Another one you might want to disable is command m (minimize). Very distracting if it's something that you accidentally hit (instead of meta-m).
For a self-contained version of Emacs, e.g., downloaded from https://emacsformacosx.com/ or manually built from source using --with-ns
, the ns-win.el
library is located in the package archive:
/Applications/Emacs.app/Contents/Resources/lisp/term/ns-win.el
If anyone is interested in seeing the default key bindings, please feel free to inspect the source code of ns-win.el
.