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!

3
  • 1
    What does C-h k \ tell you?
    – phils
    Commented May 5, 2020 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
    Commented May 5, 2020 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
    Commented May 5, 2020 at 18:20

2 Answers 2

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?
2
  • 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
    Commented May 5, 2020 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). " Commented May 6, 2020 at 18:22
0

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

4
  • I did not get how to get \ if I can type it :P Commented May 6, 2020 at 18:21
  • Do you not have a \ key on your keyboard then? Commented May 6, 2020 at 22:59
  • 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. Commented May 8, 2020 at 3:30
  • I've never encountered such a keyboard. Commented May 8, 2020 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.