* lisp/simple.el (transpose-chars): Don't move point into read-only area.

Fixes: debbugs:17829
This commit is contained in:
Juri Linkov 2014-07-08 11:27:46 +03:00
parent f0f70ec0bc
commit 43bb0be61a
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2014-07-08 Juri Linkov <juri@jurta.org>
* simple.el (transpose-chars): Don't move point into read-only area.
(Bug#17829)
2014-07-08 Juri Linkov <juri@jurta.org>
* window.el (with-displayed-buffer-window): New macro.

View file

@ -5934,7 +5934,9 @@ With prefix arg ARG, effect is to take character before point
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 (bobp))
(not (get-text-property (1- (point)) 'read-only)))
(forward-char -1))
(transpose-subr 'forward-char (prefix-numeric-value arg)))
(defun transpose-words (arg)