I only treat your special case where you want to exchange the bindings of two key sequences.
This is one of the use-cases for key-translation-map.
The following code in your init file exchanges the bindings for C-o and C-x o (also in dired-buffers):
(define-key key-translation-map (kbd "C-o") (kbd "C-x o"))
(define-key key-translation-map (kbd "C-x o") (...
In order to use define-key you should try using the snippet below:
(define-key mc/keymap (kbd "<ESC>") 'mc/keyboard-quit))
so that the mc/keymap is defined by the file multiple-cursors-core.el/elc before a new keyboard shortcut is added thereto.
If the solution above does not work you can assign ...
I have the command fill-paragraph mapped to key <escape> q, it is mapped by default in emacs.
In fact, it's mapped to ESC q by default, which is slightly different. ESC is the ascii escape character, while <escape> is the keyboard key at top left of your keyboard (but if you're using Emacs from a text terminal, the terminal probably sends ESC, ...
Local key bindings override global ones. Minor-mode key bindings override local (major mode) key bindings.
So do one of these things:
Define those keys in the maps of those modes so they invoke the commands you want, other-window and open-line.
Define your own minor mode, and define those keys in your minor mode map. And turn on your minor mode and always ...
You should/cannot use the interactive commands isearch-forward-symbol-at-point and query-replace-regexp in that way to define a new function.
For an instance isearch-forward-symbol-at-point does not return the symbol at point and query-replace-regexp requires a TO argument if called non-interactively.
I think the following Elisp function comes very close ...
This is the key binding that does what you want, out of the box: M-s . C-M-%.
The M-s . part starts searching with isearch-forward-symbol-at-point.
The C-M-% part starts query-replace-regexp, the current search string as the old text, to search for and replace.
(C-M-$ is undefined in isearch-mode-map (and the global map).)
I was able to force this binding by reading the comments on the wiki. Editing the multi-term.el file (if installed via M-x package-install) (located ~/emacs.d/elpa/multi-term-1.2/multi-term.el
Remove "C-c" from the term-unbind-key-list:
'("C-z" "C-x" "C-h" "C-y" "<ESC>")
"The key list that will need to be unbind."
I swap my option and command keys, so that i can use the key to the left of the space bar as Meta by doing:
Open System Preferences
Click "Modifier keys..." button in the bottom right of the window.
Swap the values for Option and Command in the popup menus.
In the Terminal application:
My local-set-key and local-unset-key, used interactively ("M-x ..."), are failing to do exactly what they supposed to, namely to bind or unbind a key for a specific buffer.
That's not what they're supposed to do. Can you please point to any documentation or article which caused you to think this? (If it's a documentation problem, it should be fixed.)
flyspell-mode only optionally binds flyspell-auto-correct-word to <M-tab> and to C-.. That has been so for a very long time (at least Emacs 23).
Switch the binding for <M-tab> off by the customizing the option flyspell-use-meta-tab to off. One way to do so is by clicking the menu item
Options->Customize Emacs->Specific Option and typing ...
You should complain to the flyspell maintainers: they are wasting a key sequence.
That said, the reason the above is not working is that emacs checks a sequence of keymaps: first the keymap specified by the keymap property (text or overlay), then the keymaps of the enabled minor-modes, then the local keymap that the major mode installs and then the global ...
C-x C-c is for Kill Emacs (save-buffers-kill-terminal).
Maybe on other systems you are using emacsclient, then
C-x C-c behaves specially if you are using Emacs as a server. If you type it from a client frame, it closes the client connection.
Or maybe you run multiple instances of Emacs?
To close only one frame use C-x 5 0 or s-w.
This command delete ...