I'm on Prelude, and there is no way I can type a \
. I was thinking maybe I should create a keybinding but I don't know how to create it to output a character such as \
. Any help welcome! Thank you!
Emacs by default doesn't associate \
with any command… You should be able to directly type it without any trouble. If you cannot, then you should have a module enabled, which takes it.
If you need further help, please answer the following questions:
- are you using emacs in terminal (in a TTY?) or in graphical mode?
- where do you want to type a backslash? In a document body, in the minibuffer, elsewhere?
- as @phils asks, what does
C-h k \
give you? - what is your keyboard layout?
-
To be more precise, most keys are bound to
self-insert-command
, which is the command that inserts the key you pressed into the buffer. – db48x May 5 '20 at 23:00 -
Apologies. I managed to find the keyboard binding for that \. Apparently I needed the RIGHT Alt key, not the left one (even though in the Mac Kayboard layout both are giving the backslash). When I type C-h k \ I get "\ runs the command org-self-insert-command (found in org-mode-map), which is an interactive compiled Lisp function in ‘org-9.3.6/org.el’. It is bound to SPC..~, ..\377. (org-self-insert-command N). " – Emmanuel Goldstein May 6 '20 at 18:22
As a work-around you can try C-q \
. Try Étienne Deparis answer for a permanent resolution.
-
-
-
I resolved this issue. My keyboard produces it outside Emacs when pressing SHIFT+ALT(left or right)+7. I always use ALT(left). Since it did not work in Emacs, I thought something was wrong. Apparently some other keybinding is associated with that combo, but using ALT(right) works. – Emmanuel Goldstein May 8 '20 at 3:30
-
C-h k \
tell you? – phils May 5 '20 at 13:31emacs -Q
(no init file)? If not, bisect your init file to find the culprit. – Drew May 5 '20 at 18:20