Questions tagged [keymap]
A keymap is a Lisp data structure that specifies key bindings for various key sequences. A single keymap directly specifies definitions for individual events. When a key sequence consists of a single event, its binding in a keymap is the keymap's definition for that event.
0
votes
0answers
22 views
How can I press a key combination including CTRL and ALT_GR on a Swedish keyboard?
I am running Emacs (26.1 - build 1, x86_64-w64-mingw32) on Windows 10 and I cannot type any key combination including CTRL and ALT_GR on my swedish keyboard.
I stumbled on this when I tried to use ...
0
votes
1answer
13 views
local-map in header line
I'm trying to have a clickable button in the header-line. The code below works for the mode-line but not for the header line. Is there something specific to add?
(setq-default header-line-format
(...
4
votes
2answers
207 views
How does `C-x z` work?
Specifically, the keyboard event C-x, following by N z characters, will repeat the previous command N times.
I do not understand how this can work. As far as I understand, after the input event C-x z,...
1
vote
1answer
50 views
What function does C-x invoke?
I learned that M-x invokes command execute-extended-command.
Extended commands - GNU Emacs FAQ
What command does C-x invoke?
I looked through the reference but failed to find the answer.
0
votes
1answer
43 views
Unbind all keys from mode
I would like to prevent modes to add any custom keys to emacs.
For example this works for default key map:
(global-set-key (kbd "C-c") nil)
And this works for ensime:
(eval-after-load "ensime-mode"...
0
votes
1answer
46 views
How can I get RET to follow org-mode links when using evil-mode?
In org-mode, the link-following behaviour of RET, that should be present when org-return-follows-link is set, doesn't work in evil-mode.
MWE from emacs -q:
Load an org buffer containing a link. Note ...
1
vote
1answer
115 views
What is the difference between `C-i` and `<C-i>`?
I've just set
(define-key input-decode-map "\C-i" [\C-i])
(define-key input-decode-map "\C-m" [\C-m])
(define-key input-decode-map "\C-[" [\C-\[])
in my config, but I noticed that C-i is now ...
0
votes
0answers
24 views
How can i change the bindings of an x-popup menu?
I use flyspell-correct-word-before-point(C-c $) which presents the candidates using x-popup-menu. To navigate through the options I have to use the up down arrow keys. I can't find any keymap that ...
1
vote
0answers
47 views
emacs (exwm) freezing when inputing accented letters
I'm currently running a new install of exwm on a french laptop. Writing in french means I need to input accents. Those letters I can input using dead keys without any problem but I cannot use the ...
2
votes
0answers
31 views
Get keymap that called function
I am trying to write a function that can be used to make a keybinding "remember" the key sequence that led up to the function being called.
(defun modal-function (func)
(funcall func)
(set-...
1
vote
1answer
26 views
Issues adding super keybindings to term-mode-map on Mac OSX
I'm trying to bind Command-{ and Command-} to multi-term-prev and multi-term-next. I only want them in term-mode, since if I use it in a file buffer it will switch to show a terminal (which is rather ...
1
vote
0answers
26 views
Change major-mode keymap char-table
I'm trying to write my own major mode, which I want to use under MS Windows. Unfortunately, Windows doesn't have my favourite keyboard layout, so I'm planning to implement this keyboard layout in my ...
1
vote
1answer
262 views
How is the key <backtab> defined; how to obliterate it; and how to create a new one from scratch?
Logos
Basically what I've been doing the past couple of weeks is trying to customize my keybinds one mode at a time; thus I've been going through each mode one-by-one and completely clearing its ...
1
vote
1answer
62 views
How do I get rid of RET being translated from <return>?
I'm overhauling all of my keybinds and I'm trying to keep it logically consistent.
When I issue the command describe-key -> RET
This pops up in the *Help* buffer:
RET (translated from <return>...
2
votes
1answer
24 views
Emacs term in character mode still catching my keymap
I have the following code in my init.el
(defun my-foo (arg)
(interactive "^p")
(message "We got hit")
)
(defvar my-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-r") '...
2
votes
1answer
31 views
Emacs execute keymap entry
Emacs defines a fair variety of objects that can be bound to keys, with e.g. global-set-key. (The canonical list can be found here).
I would like to simulate the invocation of a keymap entry. For ...
2
votes
1answer
89 views
Yasnippet: How to create multiple snippet key bindings
I have a yasnippet with # binding: TAB f o o in the header. This is processed by the yasnippet library as 9 102 111 111. With respect to a keymap of a major-mode, both \C-i and (kbd "TAB") are ...
1
vote
1answer
153 views
Keybinds on xterm and emacs-nox
I've looked on google, stack exchange, GNU emacs manual, xterm manual, etc. and still haven't found an answer that satisfies my problem(s).
Problem:
Using Systems: Ubuntu 16.04, xterm, emacs-nox
I ...
1
vote
2answers
69 views
How to troubleshoot a key binding prompting for more key presses?
I have a function bound to Ctrl-b, this runs a command immediately, however after some time running emacs, pressing this binding shows text C-b in the message bar, prompting for other keys to be ...
1
vote
1answer
80 views
Perform key translation in a major mode
key-translation-map allows you to globally translate keys.
For example:
(define-key key-translation-map (kbd "<f11>") (kbd "<f12>"))
But what if I want to restrict the remapping to a ...
2
votes
1answer
89 views
Emacs Widget Library
Using this widget:
(widget-create 'editable-field :size 4 :format "text1 %v text2")
(widget-setup)
I get the following output (where the underscores appear as a fillable grey area)
text1 ____ text2
...
0
votes
1answer
45 views
Call a function by its key (inside a script)
I have a tool that allows me to use the same key (shortcut) C-c C-f to call different functions. Actually I can choose different options (different functions) to pass to the LaTeX compiler, binding ...
0
votes
1answer
34 views
How to find all active bindings which act on a region?
As explained https://emacs.stackexchange.com/a/733/ C-h b lists all bindings available in a buffer.
Is there a way to list all bindings which act on a region? For example C-w (kill-region) is one of ...
0
votes
1answer
35 views
Turn keymap number back to key sequence
When viewing a keymap, prefix keys and keys in their maps are displayed as numerical values. E.g.
(keymap
(M-delete . sp-unwrap-sexp)
(27 keymap
(23 . sp-copy-sexp)
(6 . *-forward-sexp)))
...
1
vote
2answers
147 views
Making Keys Pass Completely Through Emacs
An Autohotkey remapping script I'm using uses the function keys F13-F24 to keep track of layers. This means that {F13 Down}, for example, may get sent as a virtual key code.
This works fine for most ...
14
votes
3answers
4k views
What is the longest known key sequence in Emacs?
Qt supports Emacs-style keybindings, however for only up to four keys. To make a point why this limit should be increased it would be useful to show examples of Emacs-style keybindings with even more ...
0
votes
0answers
43 views
Can't customize xah-fly-keys
I've read the documentation about customizing but I think my knowledge of Lisp is limiting things a bit. I want to bind a in command mode to move-beginning-of-line and QWERTY q (Dvorak) to move-end-of-...
1
vote
1answer
89 views
What does emacs want for non-ASCII keys
Under Debian-Jessie, Emacs recognizes qualified special keys, e.g. C-<home>, in an X terminal (e.g. mate-terminal) but in TTY it does not.
I have corrected this by making a replacement keymap, ...
2
votes
1answer
50 views
Define widget key bindings
The following code:
defines a major mode my-mode where C-d binding is redefined;
opens a my-mode buffer inserting an editable-field widget.
(require 'widget)
(require 'wid-edit)
;; Define ...
5
votes
2answers
90 views
local keymap in mode-line doesn't work in terminal
I'm having trouble with getting local keymap:s to work in the mode-line, but only in terminals (with xterm-mouse-mode enabled).
This applies to both the standard mode-line entries (like mode-line-...
1
vote
1answer
55 views
Emacs triple click handler
What handler is called when I make triple click ? For me, it select whole line. I want this behavior to be binded to C-l, how to do it ?
EDIT:
I tried to bind this to key, but not works, how to fix ...
0
votes
0answers
65 views
Problem with accented greek vowels
I cannot type a Greek accented vowel in emacs.
In Xorg, I use the el keyboard layout and in other applications (e.g. Firefox) the normal way to type an accented vowel (e.g. ά) is, first the colon ...
0
votes
0answers
45 views
Emacs doesn't recognize certain keys outside Unity
I recently updated to Ubuntu 17.10, and Unity was replaced by Gnome3.
Keys such as ´, `, " and ^ have stopped working in emacs. For ´, for instance, I get the following message
<dead-diaeresis>...
0
votes
0answers
84 views
Are super and hyper key modifier permitted in major/minor modes?
I looked to (info "(elisp)Key Binding Conventions") and (info "(elisp)Keymaps and Minor Modes") and (info "(elisp)Major Mode Conventions") and didn't found any restriction to use H- and s- modifier in ...
3
votes
2answers
78 views
Convert bitmap vector keys into a human readable string
If you run (kbd "M-r") you'll get back the bit vector [134217842]. But what if I want to go the other way around: start with [134217842] and return M-r. How does one do that?
I Have looked at the ...
1
vote
1answer
184 views
How to change mode-map of the minor mode?
I would like to change the mode-map of a minor mode with mode map.
I mean replacing the original mode-map that was specified in the define-minor-mode call with another one. Keeping the two mode-map ...
2
votes
1answer
74 views
Proper way to provide a default optional parameter
I like doing PR reviews with Magit's diff, thus calling magit-diff-visit-file pretty often, providing a universal argument for the optional other-window parameter. To optimize the process instead of ...
1
vote
1answer
233 views
How to set the keybinding for addind the hash symbol (#) in spacemacs with MacOS and an UK keyboard
I'm using spacemacs on a Mac OS X laptop with a UK keyboard and I want to be able to use Alt-3 (M-3) to insert the hash symbol #. I tried to add this function that I found on this SO answer without ...
2
votes
0answers
16 views
How to reliably redefine scroll wheel in isearch? [I'm using Mitsuharu Yamamoto's Mac port]
I decided to define <wheel-up> and <wheel-down> to isearch-repeat-forward and isearch-repeat-backward in the isearch-mode-map.
This works, but if you scroll quickly, it reverts to ...
2
votes
3answers
76 views
Changing a mode's keymap for the duration of a command's execution
I would like to bind TAB to my company-mode back-end only for the duration of a command's execution. I am trying to achieve this by using dynamic scoping as follows (the irrelevant part of the ...
1
vote
0answers
120 views
Using company-mode completion with read-from-minibuffer
The following code (mostly coming from here) creates a company-mode back-end and binds TAB to it:
(require 'company)
(defconst sample-completions
'("procedural" "functional" "high-level" "low-...
2
votes
1answer
144 views
Define a customizable (defcustom) key binding
I want to allow the user to redefine key bindings for the interactive commands in a major mode. I tried putting them in strings, but I can't get the customized variable value in my mode-map. Here's ...
2
votes
1answer
131 views
How do I activate my keymap in my mode?
Following the
Mode Tutorial,
I /almost/ finished my own mode (my-mode). Now I only have the
problem, that my mode-map settings seem to be ignored:
(defvar my-mode-map
(let ((map (make-sparse-...
6
votes
2answers
100 views
Is it possible to use let-binding for setting keys?
in LaTeX mode C-cC-f calls the tex-file function. I performed a litte tweak to that function and I wrote a tex-file-mod function.
Now I'd like to call the tex-file-mode with the same key-binding ...
1
vote
1answer
113 views
Copy Paste - Hard to use with one Hand
Coming from casual IDEs I used CUA mode. Switching back to the vanilla keymaps I noticed that M-w & C-y (copy&yank) is significant harder to use with one hand than Ctrl c & Ctrl v
Why are ...
0
votes
1answer
64 views
Keymap on region only updating from mouse click
I have defined some keymaps on org-mode src-blocks. If I click in the block with a mouse, I see the keymap is changed, e.g. the menu items change, and the new keybindings are active. However, if I use ...
2
votes
1answer
146 views
Run command on custom key binding [duplicate]
I am trying to customize emacs/spacemacs to run a command after a key stroke, like running eslint --fix command on the buffer to fix errors.
I already tried
(defun fix-errors-with-eslint ()
(shell-...
4
votes
1answer
511 views
Change default company mode keybindings
I think company-mode is a great package.
Though I would like to change some keybinding it has assigned by default.
For example, I would prefer not to use M-n and M-p in order to move in the different ...
0
votes
1answer
64 views
Fortran mode: Moving with M-f or M-b suddenly stopped working
I was using fortran-mode for some time without problem, but recently the bindings M-f and M-b stopped working.
It seems that they are not bound to the forward-word and backward-word moving commands ...
2
votes
4answers
122 views
Persistent transient keymap for mouse scrolling
I'm trying to create a transient keymap that calls calls quick-peek-hide on any key except mouse scrolling, which should function normally.
I've got the following:
(let ((map (make-sparse-keymap)))
...