[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17829: 24.4.50; `C-t' in empty minibuffer traps user in read-only te
From: |
Juri Linkov |
Subject: |
bug#17829: 24.4.50; `C-t' in empty minibuffer traps user in read-only text |
Date: |
Sun, 22 Jun 2014 01:01:04 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) |
> `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)