mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-22 04:21:24 -08:00
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)
This commit is contained in:
parent
35f5afbca1
commit
e221d32daf
1 changed files with 2 additions and 1 deletions
|
|
@ -6634,7 +6634,8 @@ current object."
|
||||||
(setq pos1 (funcall aux -1))
|
(setq pos1 (funcall aux -1))
|
||||||
(goto-char (car pos1))
|
(goto-char (car pos1))
|
||||||
(setq pos2 (funcall aux arg))
|
(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)
|
(defun transpose-subr-1 (pos1 pos2)
|
||||||
(when (> (car pos1) (cdr pos1)) (setq pos1 (cons (cdr pos1) (car pos1))))
|
(when (> (car pos1) (cdr pos1)) (setq pos1 (cons (cdr pos1) (car pos1))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue