The cleanest way is to not reuse Evil-specific commands or keystrokes unless absolutely necessary. Looking at the definition of :w, which happens to be the evil-write command, one can see that it parses the file name argument and calls shell-command-on-region if it starts with a bang. Here's the equivalent specialized command:
The comments clarified that the question was about the behaviour of holding down the Shift modifier key while Caps Lock was on.
It's common for the shift key to invert the state of caps lock, rather than to unconditionally enable caps. Hence:
t => t
SHIFT + t => T
CAPS + t => T
CAPS + SHIFT + t => t
In that latter case, Emacs sees only a lower-...
I experienced the same problem, this is what helped me make it work (although I could not find out why):
Generate zh_TW.UTF-8 locale (uncomment in /etc/locale.gen and run locale-gen)
Run emacs with LC_CTYPE set to this locale (env LC_CTYPE=zh_TW.UTF-8 emacs)
I don't believe there is a way to access the menu search feature from Emacs directly, but there is a workaround if you are using the Mitsuharu version of Mac Emacs: use M-x menu-bar-open, then type the standard key Cmd-? to open the menu search. You might try binding s-? to menu-bar-open so that you can get to the search by pressing it twice.
You can do this:
;; Dynamic bindings. A filter function returns the command to
;; call. If the function returns nil, Emacs treats it as if
;; no binding exists in that keymap, and continues looking for
;; a binding elsewhere.
(define-key <map> <key>
`(menu-item "" <my-cmd> :filter ,(lambda (cmd)
I had this problem before and came up with this solution. Make a minor mode
where you define your conditional commands:
(defvar conditional-overriding-mode-map (make-sparse-keymap))
"a minor mode for commands that only work if a certain condition holds."
t nil conditional-overriding-mode-map)
I've taken @Drew's answer and blended it with https://stackoverflow.com/a/36994486/324105 to produce this command:
(defun my-describe-all-keymaps ()
"Describe all keymaps in currently-defined variables."
(let (symbs seen)
(mapatoms (lambda (s)
A partial answer, just to say how you can get a list of all variables currently bound to keymaps:
(let ((symbs ()))
(mapatoms (lambda (s)
(when (and (boundp s) (keymapp (symbol-value s)))
(push (indirect-variable s) symbs))))
The easiest way is to just call whatever function would have been called when the original key binding was used. Suppose it was function foo:
(global-set-key <existing-binding> 'foo-wrapper)
(defun foo-wrapper (arg1 arg2)
(my-foo arg1 arg2)
(foo arg1 arg2)))
Note that you have to pass along any ...
phils is correct; if you use C-cletter for your personal customizations then you're not supposed to have to worry about conflicts with the key bindings from a mode.
As for actually enumerating all possible keymaps to check if they would define the same shortcut… that's a bit difficult. As far as I know, there's no global list of all keymaps. There's no ...