aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Barzilay2015-11-13 11:46:20 +0200
committerEli Zaretskii2015-11-13 11:46:20 +0200
commite221d32daf4c3072a5a368bd813f758711dd6ff5 (patch)
tree06adf28a91559da70aaa8b440a72236da074d90f
parent35f5afbca1779f7b6d1d78cae97437a56fd5a9ba (diff)
downloademacs-e221d32daf4c3072a5a368bd813f758711dd6ff5.tar.gz
emacs-e221d32daf4c3072a5a368bd813f758711dd6ff5.zip
Fix point positioning after transposing with negative arg
* lisp/simple.el (transpose-subr): When invoked with a negative argument, move point to after the transposed text, like we do when invoked with a positive argument. (Bug#21885)
-rw-r--r--lisp/simple.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 2781ad02b97..b115a2a0cbb 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6634,7 +6634,8 @@ current object."
6634 (setq pos1 (funcall aux -1)) 6634 (setq pos1 (funcall aux -1))
6635 (goto-char (car pos1)) 6635 (goto-char (car pos1))
6636 (setq pos2 (funcall aux arg)) 6636 (setq pos2 (funcall aux arg))
6637 (transpose-subr-1 pos1 pos2))))) 6637 (transpose-subr-1 pos1 pos2)
6638 (goto-char (+ (car pos2) (- (cdr pos1) (car pos1))))))))
6638 6639
6639(defun transpose-subr-1 (pos1 pos2) 6640(defun transpose-subr-1 (pos1 pos2)
6640 (when (> (car pos1) (cdr pos1)) (setq pos1 (cons (cdr pos1) (car pos1)))) 6641 (when (> (car pos1) (cdr pos1)) (setq pos1 (cons (cdr pos1) (car pos1))))