]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (transpose-chars): Don't move point into read-only area.
authorJuri Linkov <juri@jurta.org>
Tue, 8 Jul 2014 08:27:46 +0000 (11:27 +0300)
committerJuri Linkov <juri@jurta.org>
Tue, 8 Jul 2014 08:27:46 +0000 (11:27 +0300)
Fixes: debbugs:17829
lisp/ChangeLog
lisp/simple.el

index cc864810c8c9be6c6d7ca3ef5f442ca36868a93f..26699e0ff4d59d8fb304b277abcdf36911fa8f5e 100644 (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.
index 6fd50197a10d2c44fb67360ee2306aa705dc2efd..5da662c21248498de38ad065d53b67d489a0b19e 100644 (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)