From: Juri Linkov Date: Tue, 8 Jul 2014 08:27:46 +0000 (+0300) Subject: * lisp/simple.el (transpose-chars): Don't move point into read-only area. X-Git-Tag: emacs-25.0.90~2636^2~64 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=43bb0be61a0788045f90d9df5d378506cbbab422;p=emacs.git * lisp/simple.el (transpose-chars): Don't move point into read-only area. Fixes: debbugs:17829 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc864810c8c..26699e0ff4d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-07-08 Juri Linkov + + * simple.el (transpose-chars): Don't move point into read-only area. + (Bug#17829) + 2014-07-08 Juri Linkov * window.el (with-displayed-buffer-window): New macro. diff --git a/lisp/simple.el b/lisp/simple.el index 6fd50197a10..5da662c2124 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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)