diff options
author | Eli Barzilay <eli@barzilay.org> | 2015-11-13 11:46:20 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-11-13 21:58:52 +0200 |
commit | 27b93ec0a5fd2268d2ebfa338df6e1434cb7d451 (patch) | |
tree | 06adf28a91559da70aaa8b440a72236da074d90f | |
parent | e0d2dc5fd7205dcfd9125a35a7dc4468d9f6b2af (diff) | |
download | emacs-27b93ec0a5fd2268d2ebfa338df6e1434cb7d451.tar.gz |
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)
Backport.
-rw-r--r-- | lisp/simple.el | 3 |
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." (setq pos1 (funcall aux -1)) (goto-char (car pos1)) (setq pos2 (funcall aux arg)) - (transpose-subr-1 pos1 pos2))))) + (transpose-subr-1 pos1 pos2) + (goto-char (+ (car pos2) (- (cdr pos1) (car pos1)))))))) (defun transpose-subr-1 (pos1 pos2) (when (> (car pos1) (cdr pos1)) (setq pos1 (cons (cdr pos1) (car pos1)))) |