0

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!

NickD
  • 27,023
  • 3
  • 23
  • 42
  • 1
    What does `C-h k \ ` tell you? – phils May 05 '20 at 13:31
  • 1
    What is Prelude? Why is there no way to type a `\\`? Do not expect other people to know what you are talking about just because you can see it: please explain. – NickD May 05 '20 at 13:49
  • Do you see the same thing when you start Emacs using `emacs -Q` (no init file)? If not, bisect your init file to find the culprit. – Drew May 05 '20 at 18:20

2 Answers2

1

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?
Étienne
  • 93
  • 5
  • 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 05 '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 06 '20 at 18:22
0

As a work-around you can try C-q \. Try Étienne Deparis answer for a permanent resolution.