From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Feb 2018 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 30343@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151773656919863 (code B ref -1); Sun, 04 Feb 2018 09:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Feb 2018 09:29:29 +0000 Received: from localhost ([127.0.0.1]:56189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGc4-0005AI-NA for submit@debbugs.gnu.org; Sun, 04 Feb 2018 04:29:28 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:39969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGc2-0005A5-Eo for submit@debbugs.gnu.org; Sun, 04 Feb 2018 04:29:26 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 8DE2A22678 for ; Sun, 4 Feb 2018 09:29:24 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1517736563; x=1518600564; bh=Dk/4UXRRtGQKyUxyJU8lf4z6W4xKBFy5zsW 8994aBvQ=; b=SxhHhW2fjy9BjCvfKqo7bOLA2Mp5EyIGKlMzl2o+6BNc290EpH7 AX4w0Vo1pFg5U/SAh10EJCtQcQHLVmtsNJW6kX0D2vs8vMJR4oydiEly2U9nZrne PIjg33wzham2SQAEKoSP01DhJiVVt/B/XbY57mkEh7uIaCYJ6LwKMgIM= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id piqhVZatOW6r for ; Sun, 4 Feb 2018 09:29:23 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 47B762264C for ; Sun, 4 Feb 2018 09:29:22 +0000 (UTC) Date: Sun, 04 Feb 2018 10:37:22 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: emacs Version: 27.0.50 From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Feb 2018 09:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 30343@debbugs.gnu.org Received: via spool by 30343-submit@debbugs.gnu.org id=B30343.151773705520617 (code B ref 30343); Sun, 04 Feb 2018 09:38:01 +0000 Received: (at 30343) by debbugs.gnu.org; 4 Feb 2018 09:37:35 +0000 Received: from localhost ([127.0.0.1]:56195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGjv-0005MS-GF for submit@debbugs.gnu.org; Sun, 04 Feb 2018 04:37:35 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:40000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGjt-0005MD-6B for 30343@debbugs.gnu.org; Sun, 04 Feb 2018 04:37:34 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id CA31322678 for <30343@debbugs.gnu.org>; Sun, 4 Feb 2018 09:37:31 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1517737050; x=1518601051; bh=2h8192pUY5RV3 WuEz73shpIbQhACnWVB/MbuzFCSq7c=; b=XWxu09PcxinnQIu8wq34dFQlbvKLR 3VENNukhJr1yYq2Y8gRrzPCaws0PmiVwVq1p7zbRr+AUlcBcchtMib0hqEY5h7fp DfE9+QGHjaLng5TMUbX7Rj99Ofs+PfENHp+PRRC9tsskWHKVEgPCoJQSchocZxPm 3ism+3fUMBTYtQ= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YGjhGqSm3I2i for <30343@debbugs.gnu.org>; Sun, 4 Feb 2018 09:37:30 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id B1C0B2264C for <30343@debbugs.gnu.org>; Sun, 4 Feb 2018 09:37:30 +0000 (UTC) Date: Sun, 04 Feb 2018 10:45:45 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) In-reply-to: (charles@aurox.ch) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) What follows is a patch to make transpose-regions interactive. I also noticed that transpose-sentences/paragraphs are not documented, so I'll add those in another commit. >From 8468059f55ea459dc56c3dae6c6667950c6767d2 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sun, 4 Feb 2018 10:41:00 +0100 Subject: [PATCH] Make transpose-regions interactive (Bug#30343) * doc/emacs/fixit.texi (Transpose): Mention and explain the new command. * editfns.c (Ftranspose_regions): Add an interactive calling specification, and add documentation for it. --- doc/emacs/fixit.texi | 12 +++++++++++- src/editfns.c | 11 +++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index ced1ef9..a35ef6b 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -146,6 +146,8 @@ Transpose Transpose two balanced expressions (@code{transpose-sexps}). @item C-x C-t Transpose two lines (@code{transpose-lines}). +@item M-x transpose-regions +Transpose two regions. @end table @kindex C-t @@ -183,7 +185,7 @@ Transpose (@code{transpose-lines}) exchanges lines. They work like @kbd{M-t} except as regards what units of text they transpose. - A numeric argument to a transpose command serves as a repeat count: it + A numeric argument to most transpose commands serves as a repeat count: it tells the transpose command to move the character (word, expression, line) before or containing point across several other characters (words, expressions, lines). For example, @kbd{C-u 3 C-t} moves the character before @@ -198,6 +200,14 @@ Transpose transpose the character (word, expression, line) ending after point with the one ending after the mark. +@findex transpose-regions + @kbd{M-x transpose-regions} transposes the text between point and +mark with the text between the first two elements of the mark ring. +Unlike the other transpose commands, it does not behave differently +when given a prefix argument. This command is best used for +transposing multiple units of text (words, sentences, paragraphs) in +one go. + @node Fixing Case @section Case Conversion diff --git a/src/editfns.c b/src/editfns.c index 96bb271..66dd2a4 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -5112,7 +5112,10 @@ transpose_markers (ptrdiff_t start1, ptrdiff_t end1, } } -DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, 0, +DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, + "(if (< (length mark-ring) 2)\ + (error \"Mark ring must contain at least two elements\")\ + (list (point) (mark) (car mark-ring) (cadr mark-ring)))", 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 +5123,11 @@ 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 first and second markers in the mark ring. +LEAVE-MARKERS is nil. */) (Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object endr2, Lisp_Object leave_markers) { register ptrdiff_t start1, end1, start2, end2; -- 2.9.4 From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2018 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: charles@aurox.ch (Charles A. Roelli) Cc: 30343@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 30343-submit@debbugs.gnu.org id=B30343.151826033413270 (code B ref 30343); Sat, 10 Feb 2018 10:59:02 +0000 Received: (at 30343) by debbugs.gnu.org; 10 Feb 2018 10:58:54 +0000 Received: from localhost ([127.0.0.1]:36107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekSrt-0003Ry-M9 for submit@debbugs.gnu.org; Sat, 10 Feb 2018 05:58:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekSrs-0003Rl-IT for 30343@debbugs.gnu.org; Sat, 10 Feb 2018 05:58:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekSrj-0004m1-1s for 30343@debbugs.gnu.org; Sat, 10 Feb 2018 05:58:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekSri-0004lr-Tm; Sat, 10 Feb 2018 05:58:42 -0500 Received: from [176.228.60.248] (port=3480 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ekSrg-0003af-PS; Sat, 10 Feb 2018 05:58:41 -0500 Date: Sat, 10 Feb 2018 12:58:23 +0200 Message-Id: <83h8qp2jsg.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (charles@aurox.ch) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 04 Feb 2018 10:45:45 +0100 > From: charles@aurox.ch (Charles A. Roelli) > > What follows is a patch to make transpose-regions interactive. > > I also noticed that transpose-sentences/paragraphs are not documented, > so I'll add those in another commit. Thanks. > @@ -183,7 +185,7 @@ Transpose > (@code{transpose-lines}) exchanges lines. They work like @kbd{M-t} > except as regards what units of text they transpose. > > - A numeric argument to a transpose command serves as a repeat count: it > + A numeric argument to most transpose commands serves as a repeat count: it > [...] > +@findex transpose-regions > + @kbd{M-x transpose-regions} transposes the text between point and > +mark with the text between the first two elements of the mark ring. I would say "... with the text between the last two marks pushed to the mark ring." I would also add a cross-reference here to where set-mark-command is described. > +Unlike the other transpose commands, it does not behave differently > +when given a prefix argument. This command is best used for > +transposing multiple units of text (words, sentences, paragraphs) in > +one go. Would it make sense to make the new command interpret the prefix argument the same way as the other transpose commands? E.g., why not use pairs of marks further back in the mark ring? > -DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, 0, > +DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, > + "(if (< (length mark-ring) 2)\ > + (error \"Mark ring must contain at least two elements\")\ > + (list (point) (mark) (car mark-ring) (cadr mark-ring)))", The error message could be made more clear, e.g. by saying that the other region should be marked first. Talking about the size of the mark ring is too technical, IMO. > +Interactively, STARTR1 and ENDR1 are point and mark. STARTR2 and > +ENDR2 are the first and second markers in the mark ring. > +LEAVE-MARKERS is nil. */) "First and second" is ambiguous, since you don't tell from which end they are counted. Also, these 3 sentences all talk about interactive invocation, so they should probably be a single sentence separated with semi-colons instead. From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Mar 2018 20:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 30343@debbugs.gnu.org Received: via spool by 30343-submit@debbugs.gnu.org id=B30343.15204555322882 (code B ref 30343); Wed, 07 Mar 2018 20:46:01 +0000 Received: (at 30343) by debbugs.gnu.org; 7 Mar 2018 20:45:32 +0000 Received: from localhost ([127.0.0.1]:49866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etfwK-0000kP-16 for submit@debbugs.gnu.org; Wed, 07 Mar 2018 15:45:32 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:54429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etfwH-0000k5-B2 for 30343@debbugs.gnu.org; Wed, 07 Mar 2018 15:45:30 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id DA839226BA for <30343@debbugs.gnu.org>; Wed, 7 Mar 2018 20:45:59 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1520455557; x=1521319558; bh=C3TXayagvxzDv CgqCt4WzfkiGMdFaoJVyycihcgjfXk=; b=VI8XAp27hoD4MLO+UNL+Tm5hTHnoy ElDQVHyE+V24F3Flig33uwR22tJPGKwliyOVdD7jiQ3c7DFcF5hF8iKSiwwtBoJx IXZkfdVK6md72G27k5zswgZj9GFbmr4gkNsuH4k9L7WAgtxdaKjS84m7I5ZL3Ipw Rj8aKOMS3pLOLs= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qR-UbHeoO48L for <30343@debbugs.gnu.org>; Wed, 7 Mar 2018 20:45:57 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 1BF4E22688; Wed, 7 Mar 2018 20:45:57 +0000 (UTC) Date: Wed, 07 Mar 2018 21:56:28 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) In-reply-to: <83h8qp2jsg.fsf@gnu.org> (message from Eli Zaretskii on Sat, 10 Feb 2018 12:58:23 +0200) References: <83h8qp2jsg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Date: Sat, 10 Feb 2018 12:58:23 +0200 > From: Eli Zaretskii > > > @@ -183,7 +185,7 @@ Transpose > > (@code{transpose-lines}) exchanges lines. They work like @kbd{M-t} > > except as regards what units of text they transpose. > > > > - A numeric argument to a transpose command serves as a repeat count: it > > + A numeric argument to most transpose commands serves as a repeat count: it > > [...] > > +@findex transpose-regions > > + @kbd{M-x transpose-regions} transposes the text between point and > > +mark with the text between the first two elements of the mark ring. > > I would say "... with the text between the last two marks pushed to > the mark ring." I would also add a cross-reference here to where > set-mark-command is described. > > > +Unlike the other transpose commands, it does not behave differently > > +when given a prefix argument. This command is best used for > > +transposing multiple units of text (words, sentences, paragraphs) in > > +one go. > > Would it make sense to make the new command interpret the prefix > argument the same way as the other transpose commands? E.g., why not > use pairs of marks further back in the mark ring? > > > -DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, 0, > > +DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, > > + "(if (< (length mark-ring) 2)\ > > + (error \"Mark ring must contain at least two elements\")\ > > + (list (point) (mark) (car mark-ring) (cadr mark-ring)))", > > The error message could be made more clear, e.g. by saying that the > other region should be marked first. Talking about the size of the > mark ring is too technical, IMO. > > > +Interactively, STARTR1 and ENDR1 are point and mark. STARTR2 and > > +ENDR2 are the first and second markers in the mark ring. > > +LEAVE-MARKERS is nil. */) > > "First and second" is ambiguous, since you don't tell from which end > they are counted. Also, these 3 sentences all talk about interactive > invocation, so they should probably be a single sentence separated > with semi-colons instead. Thanks for the review. Could you please look at the following second iteration? All your points should be addressed. diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 7cacac4..eb783d1 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -149,6 +149,8 @@ Transpose Transpose two balanced expressions (@code{transpose-sexps}). @item C-x C-t Transpose two lines (@code{transpose-lines}). +@item M-x transpose-regions +Transpose two regions. @end table @kindex C-t @@ -204,6 +206,15 @@ Transpose transpose the character (or word or expression or line) ending after point with the one ending after the mark. +@findex transpose-regions + @kbd{M-x transpose-regions} transposes the text between point and +mark with the text between the last two marks pushed to the mark ring +(@pxref{Setting Mark}). With a numeric prefix argument, it transposes +the text between point and mark with the text between two successive +marks that many entries back in the mark ring. This command is best +used for transposing multiple characters (or words or sentences or +paragraphs) in one go. + @node Fixing Case @section Case Conversion diff --git a/src/editfns.c b/src/editfns.c index 96bb271..9183bd1 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -5112,7 +5112,16 @@ transpose_markers (ptrdiff_t start1, ptrdiff_t end1, } } -DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 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 backwards in the mark ring. A negative +prefix argument instead counts forwards 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; From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Mar 2018 12:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: charles@aurox.ch (Charles A. Roelli) Cc: 30343@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 30343-submit@debbugs.gnu.org id=B30343.152068333212330 (code B ref 30343); Sat, 10 Mar 2018 12:03:02 +0000 Received: (at 30343) by debbugs.gnu.org; 10 Mar 2018 12:02:12 +0000 Received: from localhost ([127.0.0.1]:53181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eudCW-0003Co-5e for submit@debbugs.gnu.org; Sat, 10 Mar 2018 07:02:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eudCU-0003Cb-VL for 30343@debbugs.gnu.org; Sat, 10 Mar 2018 07:02:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eudCL-00022P-Ah for 30343@debbugs.gnu.org; Sat, 10 Mar 2018 07:02:06 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eudCL-00022K-72; Sat, 10 Mar 2018 07:02:01 -0500 Received: from [176.228.60.248] (port=3038 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eudCK-0005CD-KG; Sat, 10 Mar 2018 07:02:01 -0500 Date: Sat, 10 Mar 2018 14:02:01 +0200 Message-Id: <83zi3gt9za.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (charles@aurox.ch) References: <83h8qp2jsg.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Wed, 07 Mar 2018 21:56:28 +0100 > From: charles@aurox.ch (Charles A. Roelli) > CC: 30343@debbugs.gnu.org > > Thanks for the review. Could you please look at the following second > iteration? All your points should be addressed. This LGTM, thanks. One minor comment: > +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 backwards in the mark ring. A negative > +prefix argument instead counts forwards from the oldest mark in the Please use "back" in "forward" here, instead of "backwards" and "forwards". ("Backwards" has a meaning that might confuse readers here.) From unknown Sun Jun 22 03:59:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30343: make transpose-regions interactive Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Mar 2018 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: charles@aurox.ch Cc: 30343@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 30343-submit@debbugs.gnu.org id=B30343.15206917388903 (code B ref 30343); Sat, 10 Mar 2018 14:23:01 +0000 Received: (at 30343) by debbugs.gnu.org; 10 Mar 2018 14:22:18 +0000 Received: from localhost ([127.0.0.1]:53227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eufO6-0002JX-4K for submit@debbugs.gnu.org; Sat, 10 Mar 2018 09:22:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eufO4-0002JJ-Ef for 30343@debbugs.gnu.org; Sat, 10 Mar 2018 09:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eufNu-0002RI-GS for 30343@debbugs.gnu.org; Sat, 10 Mar 2018 09:22:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eufNu-0002RE-Cu; Sat, 10 Mar 2018 09:22:06 -0500 Received: from [176.228.60.248] (port=3154 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eufNt-0007Ok-Q0; Sat, 10 Mar 2018 09:22:06 -0500 Date: Sat, 10 Mar 2018 16:22:06 +0200 Message-Id: <83woykt3ht.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <83zi3gt9za.fsf@gnu.org> (message from Eli Zaretskii on Sat, 10 Mar 2018 14:02:01 +0200) References: <83h8qp2jsg.fsf@gnu.org> <83zi3gt9za.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sat, 10 Mar 2018 14:02:01 +0200 > From: Eli Zaretskii > Cc: 30343@debbugs.gnu.org > > Please use "back" in "forward" here ^^ I meant "and", of course. Sorry. From unknown Sun Jun 22 03:59:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: charles@aurox.ch (Charles A. Roelli) Subject: bug#30343: closed (Re: bug#30343: make transpose-regions interactive) Message-ID: References: X-Gnu-PR-Message: they-closed 30343 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 30343@debbugs.gnu.org Date: Sun, 11 Mar 2018 11:00:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1520766003-2827-1" This is a multi-part message in MIME format... ------------=_1520766003-2827-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30343: make transpose-regions interactive which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30343@debbugs.gnu.org. --=20 30343: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30343 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1520766003-2827-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30343-done) by debbugs.gnu.org; 11 Mar 2018 10:59:59 +0000 Received: from localhost ([127.0.0.1]:54701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euyhr-0000j5-J9 for submit@debbugs.gnu.org; Sun, 11 Mar 2018 06:59:59 -0400 Received: from sinyavsky.aurox.ch ([37.35.109.145]:56391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euyhq-0000ip-Hq for 30343-done@debbugs.gnu.org; Sun, 11 Mar 2018 06:59:59 -0400 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 65ACF226C8 for <30343-done@debbugs.gnu.org>; Sun, 11 Mar 2018 11:00:32 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1520766030; x=1521630031; bh=5Qmos6Gb4wYhe OEsxodUDaNLtfBSeyaE09u1EpmJZ9M=; b=vxAqmV8yyj0qwrqqtqr3/NNrCLXhQ 4xnamRxfop0hCfXE8bH/L0fWbPZVQs5BZ9UR3aFPGdjGgtU9Gr2OGOaRaVpTj5Xv /SWLnBqXe5g2EvaNKp2oiQfA7pY+ZyD18YTGvm1rlqmbTJVSSGFZkobQNhaoVa5c fhYcJY3acWtJDY= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id q5YOd77L96EH for <30343-done@debbugs.gnu.org>; Sun, 11 Mar 2018 11:00:30 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 58749226B0; Sun, 11 Mar 2018 11:00:30 +0000 (UTC) Date: Sun, 11 Mar 2018 12:11:19 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: Eli Zaretskii In-reply-to: <83zi3gt9za.fsf@gnu.org> (message from Eli Zaretskii on Sat, 10 Mar 2018 14:02:01 +0200) Subject: Re: bug#30343: make transpose-regions interactive References: <83h8qp2jsg.fsf@gnu.org> <83zi3gt9za.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30343-done Cc: 30343-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Date: Sat, 10 Mar 2018 14:02:01 +0200 > From: Eli Zaretskii > CC: 30343@debbugs.gnu.org > Reply-to: Eli Zaretskii > > This LGTM, thanks. One minor comment: > > > +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 backwards in the mark ring. A negative > > +prefix argument instead counts forwards from the oldest mark in the > > Please use "back" in "forward" here, instead of "backwards" and > "forwards". ("Backwards" has a meaning that might confuse readers > here.) Thanks again for the review, it's pushed now with your doc fix. commit b88e7c8bcd523f1f503f87a1734679405322b5ec Date: Sun Mar 11 11:59:01 2018 +0100 Make transpose-regions interactive (Bug#30343) * doc/emacs/fixit.texi (Transpose): Mention and explain the new command. * editfns.c (Ftranspose_regions): Add an interactive calling specification, and add documentation for it. ------------=_1520766003-2827-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Feb 2018 09:29:29 +0000 Received: from localhost ([127.0.0.1]:56189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGc4-0005AI-NA for submit@debbugs.gnu.org; Sun, 04 Feb 2018 04:29:28 -0500 Received: from sinyavsky.aurox.ch ([37.35.109.145]:39969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiGc2-0005A5-Eo for submit@debbugs.gnu.org; Sun, 04 Feb 2018 04:29:26 -0500 Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 8DE2A22678 for ; Sun, 4 Feb 2018 09:29:24 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= subject:subject:to:from:from:message-id:date:date; s=dkim; t= 1517736563; x=1518600564; bh=Dk/4UXRRtGQKyUxyJU8lf4z6W4xKBFy5zsW 8994aBvQ=; b=SxhHhW2fjy9BjCvfKqo7bOLA2Mp5EyIGKlMzl2o+6BNc290EpH7 AX4w0Vo1pFg5U/SAh10EJCtQcQHLVmtsNJW6kX0D2vs8vMJR4oydiEly2U9nZrne PIjg33wzham2SQAEKoSP01DhJiVVt/B/XbY57mkEh7uIaCYJ6LwKMgIM= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id piqhVZatOW6r for ; Sun, 4 Feb 2018 09:29:23 +0000 (UTC) Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 47B762264C for ; Sun, 4 Feb 2018 09:29:22 +0000 (UTC) Date: Sun, 04 Feb 2018 10:37:22 +0100 Message-Id: From: charles@aurox.ch (Charles A. Roelli) To: submit@debbugs.gnu.org Subject: make transpose-regions interactive X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: emacs Version: 27.0.50 ------------=_1520766003-2827-1--