Emacs Init: Stop Cursor Going into Minibuffer Prompt

By Xah Lee. Date: . Last updated: .

in emacs Minibuffer prompt, when you press the left arrow key, the cursor moves back all the way over the prompt text. This is annoying because when you start to type, you get error “This is read-only”.

put this in your Emacs Init File:

;; minibuffer, stop cursor going into prompt
 (quote (read-only t cursor-intangible t face minibuffer-prompt)))

( Thanks to Clément Pit-Claudel)

Here's alternative way to do it.

  1. Alt+x customize-group.
  2. Type “minibuffer”.
  3. scroll down to “Minibuffer Prompt Properties”.
  4. Check box “Don't Enter”.
  5. Go to the top, click “Apply and Save”
emacs customize-group minibuffer 2016-06-16
M-x customize-group, “minibuffer”.

After that, emacs will insert the following to your init file:

 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
    (read-only t cursor-intangible t face minibuffer-prompt))))

Emacs, minibuffer