Subject: Re: bug#17829: 24.4.50; `C-t' in empty minibuffer traps user in read-only text

From: Juri Linkov <[email-masked]>
Date: Sun, 22 Jun 2014 01:01:04 +0300

> `M-x C-t' gives you a "Text is read-only" error, and it moves point
> backward into the minibuffer prompt.  Repeating it does not move point
> further backward but continues to raise the error.

I often get into the same trap when mistyping C-t instead of C-y
to yank text into the minibuffer.  This is one of possible fixes:

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2014-01-31 06:42:29 +0000
+++ lisp/simple.el	2014-06-21 21:54:06 +0000
@@ -5902,7 +5902,8 @@ (defun transpose-chars (arg)
 and drag it forward past ARG other characters (backward if ARG negative).
 If no argument and at end of line, the previous two chars are exchanged."
   (interactive "*P")
-  (and (null arg) (eolp) (forward-char -1))
+  (when (and (null arg) (eolp) (not (get-text-property (1- (point)) 'read-only)))
+    (forward-char -1))
   (transpose-subr 'forward-char (prefix-numeric-value arg)))
 
 (defun transpose-words (arg)