[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select b3c36c4 122/218: Revert move of intera
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select b3c36c4 122/218: Revert move of interactive `transpose-regions' to Lisp |
Date: |
Fri, 14 Dec 2018 03:35:14 -0500 (EST) |
branch: feature/gnus-select
commit b3c36c49b5f5ddcad9e6cc1e1ac15fa58f42840b
Author: Karl Fogel <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Revert move of interactive `transpose-regions' to Lisp
This reverts my commit 3a3aa0e056a of 2018-03-18 at 21:43:18 UTC.
I thought consensus had been reached, but it had not: Eli Zaretskii
felt the pre-3a3aa0e056a situation was fine and would not like to
see it changed without at least further discussion.
---
lisp/simple.el | 28 ----------------------------
src/editfns.c | 22 +++++++++++++++++++---
2 files changed, 19 insertions(+), 31 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 61d0932..7d8010f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7014,34 +7014,6 @@ With argument 0, interchanges line point is in with line
mark is in."
(forward-line arg))))
arg))
-(defun transpose-regions (startr1 endr1 startr2 endr2 &optional leave-markers)
- "Transpose region STARTR1 to ENDR1 with STARTR2 to ENDR2.
-The regions should not be overlapping, because the size of the buffer is
-never changed in a transposition.
-
-Optional fifth arg LEAVE-MARKERS, if non-nil, means don't update
-any markers that happen to be located in the regions.
-
-Transposing beyond buffer boundaries is an error.
-
-Interactively, STARTR1 and ENDR1 are point and mark; STARTR2 and ENDR2
-are the last two marks pushed to the mark ring; LEAVE-MARKERS is nil.
-If a prefix argument N is given, STARTR2 and ENDR2 are the two
-successive marks N entries back in the mark ring. A negative prefix
-argument instead counts forward from the oldest mark in the mark
-ring."
- (interactive
- (if (< (length mark-ring) 2)
- (error "Other region must be marked before transposing two regions")
- (let* ((num (if current-prefix-arg
- (prefix-numeric-value current-prefix-arg)
- 0))
- (ring-length (length mark-ring))
- (eltnum (mod num ring-length))
- (eltnum2 (mod (1+ num) ring-length)))
- (list (point) (mark) (elt mark-ring eltnum) (elt mark-ring eltnum2)))))
- (transpose-regions-internal startr1 endr1 startr2 endr2 leave-markers))
-
;; FIXME seems to leave point BEFORE the current object when ARG = 0,
;; which seems inconsistent with the ARG /= 0 case.
;; FIXME document SPECIAL.
diff --git a/src/editfns.c b/src/editfns.c
index e248672..d263194 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -5112,7 +5112,16 @@ transpose_markers (ptrdiff_t start1, ptrdiff_t end1,
}
}
-DEFUN ("transpose-regions-internal", Ftranspose_regions_internal,
Stranspose_regions_internal, 4, 5, 0,
+DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5,
+ "(if (< (length mark-ring) 2)\
+ (error \"Other region must be marked before transposing two
regions\")\
+ (let* ((num (if current-prefix-arg\
+ (prefix-numeric-value current-prefix-arg)\
+ 0))\
+ (ring-length (length mark-ring))\
+ (eltnum (mod num ring-length))\
+ (eltnum2 (mod (1+ num) ring-length)))\
+ (list (point) (mark) (elt mark-ring eltnum) (elt mark-ring
eltnum2))))",
doc: /* Transpose region STARTR1 to ENDR1 with STARTR2 to ENDR2.
The regions should not be overlapping, because the size of the buffer is
never changed in a transposition.
@@ -5120,7 +5129,14 @@ never changed in a transposition.
Optional fifth arg LEAVE-MARKERS, if non-nil, means don't update
any markers that happen to be located in the regions.
-Transposing beyond buffer boundaries is an error. */)
+Transposing beyond buffer boundaries is an error.
+
+Interactively, STARTR1 and ENDR1 are point and mark; STARTR2 and ENDR2
+are the last two marks pushed to the mark ring; LEAVE-MARKERS is nil.
+If a prefix argument N is given, STARTR2 and ENDR2 are the two
+successive marks N entries back in the mark ring. A negative prefix
+argument instead counts forward from the oldest mark in the mark
+ring. */)
(Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object
endr2, Lisp_Object leave_markers)
{
register ptrdiff_t start1, end1, start2, end2;
@@ -5565,5 +5581,5 @@ functions if all the text being accessed has this
property. */);
defsubr (&Swiden);
defsubr (&Snarrow_to_region);
defsubr (&Ssave_restriction);
- defsubr (&Stranspose_regions_internal);
+ defsubr (&Stranspose_regions);
}
- [Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' when line numbers are displayed, (continued)
- [Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' when line numbers are displayed, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e907e4a 102/218: Improve word motion docs (Bug#30815), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 08b32c9 105/218: Print test timings unconditionally, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 58da563 110/218: * lisp/url/url-handlers.el: Require subr-x., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 513b7fc 111/218: Fix compilation warnings in subr-x-tests.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select aceb821 047/218: Remove many items obsolete since Emacs 22.1, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select ec18ff5 118/218: Followup to last change in browse-url.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 10794c8 119/218: Print top time consuming tests if advised, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1ac0958 123/218: Fix recently-added POP doc glitch, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0f8f94d 121/218: Fix frame resize flicker on macOS (bug#30699), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b3c36c4 122/218: Revert move of interactive `transpose-regions' to Lisp,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 24e07c4 129/218: Tune time zone 0, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a3605b6 130/218: * test/lisp/info-xref-tests.el (info-xref-test-emacs-manuals): New., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 15d031e 128/218: * doc/emacs/building.texi (Starting GUD): Mention 'guiler'., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c5dd420 112/218: Move interactive `transpose-regions' to Lisp, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select abe37f8 127/218: Yet more proofreading of the Emacs manual, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 98cca72 140/218: Better support for 'transpose-chars' in Flyspell mode, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f1168aa 139/218: Correct Info link markup, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a5db603 137/218: Minor improvements in building.texi, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7325e18 146/218: * cc-engine.el (c-looking-at-or-maybe-in-bracelist): Remove pessimization, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select cbea6b1 145/218: Avoid redisplay problems with too wide wrap-prefix, Andrew G Cohen, 2018/12/14