From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60157: 30.0.50; [PATCH]: Change interactive form in transpose-chars Date: Sat, 24 Dec 2022 09:01:55 +0200 Message-ID: <83y1qx5lp8.fsf@gnu.org> References: <87k02qte06.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35158"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60157@debbugs.gnu.org, monnier@iro.umontreal.ca To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 24 08:03:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8yYv-0008r3-Gr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Dec 2022 08:03:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8yYi-0006lr-Fr; Sat, 24 Dec 2022 02:03:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8yYg-0006jL-JU for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8yYf-0004Ro-Vk for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:03:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8yYf-0002IN-Rf for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2022 07:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60157 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60157-submit@debbugs.gnu.org id=B60157.16718653268805 (code B ref 60157); Sat, 24 Dec 2022 07:03:01 +0000 Original-Received: (at 60157) by debbugs.gnu.org; 24 Dec 2022 07:02:06 +0000 Original-Received: from localhost ([127.0.0.1]:41275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8yXl-0002Hx-MH for submit@debbugs.gnu.org; Sat, 24 Dec 2022 02:02:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8yXj-0002HZ-PZ for 60157@debbugs.gnu.org; Sat, 24 Dec 2022 02:02:04 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8yXe-0004Ij-C8; Sat, 24 Dec 2022 02:01:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MO4t05vloKypPDvDn2rNktenBgSGUroRHTJ9bocvzAk=; b=TGG1QluMh3Dm 3QzndSn8OKno7KYiGg+GAJtzq6unlYTuvoiNsfXdYkJRoSlc90uRcWsRL+JgxyeDUCwS26v8mK6k+ oekCOAAU7TiAepaKo6zzn9c02heeLNpHqLnOvn8Qu9PsYPgGd88880vqllNAGg8laJLzeYhG6XXy7 XJRCGQwxwlD9vYsLAypiyYFM6LJOx8w7u6Nx9inPBFg8zR6p7TssVgzfGKN0J9I577YVrP/Ide3yK qyDyiPmENB7FDhYdlMQaY5LC7mbB3EwJC2EUtG2ANX1gDAdot0o91SRp+MleI38/U1qm/Ex4vkxlW b/AdUd83FS/jBvZjne4dcQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8yXd-0001pd-7F; Sat, 24 Dec 2022 02:01:57 -0500 In-Reply-To: <87k02qte06.fsf@thornhill.no> (message from Theodor Thornhill on Sat, 17 Dec 2022 13:23:53 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251762 Archived-At: > Cc: monnier@iro.umontreal.ca, eliz@gnu.org > From: Theodor Thornhill > Date: Sat, 17 Dec 2022 13:23:53 +0100 > > Hi Stefan and Eli! > > As a part of my investigation into transposing things using tree-sitter > I promised to also introduce some improvements to both the code and > documentation, as the latter is a little sparse. I'll add some patches > while I work on the tree-sitter stuff. > > This commit simplifies the transpose-chars. The bug described in the > commit history is no longer reproducible, so I think its complicated > nature can be removed. What do you think? > > Theo > > >From f7d98eb478b9d10c15e6b2d168049e65fcd3c448 Mon Sep 17 00:00:00 2001 > From: Theodor Thornhill > Date: Sat, 17 Dec 2022 13:14:22 +0100 > Subject: [PATCH] Use *p in interactive form in transpose-chars > > There are two changes in this commit. The first one is removal of an > obsolete guard against moving into read-only text, as described in > bug#17829. The second is a simplification of the code to make it more > similar to its sibling commands. We can convert the prefix into a > number immediately, rather than later. > > * lisp/simple.el (transpose-chars): Use '*p' instead of '*P' like the > other transpose-* functions. > --- > lisp/simple.el | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/lisp/simple.el b/lisp/simple.el > index dcc2242e49..bde65d96f1 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -8421,11 +8421,8 @@ transpose-chars > With prefix arg ARG, effect is to take character before point > and drag it forward past ARG other characters (backward if ARG negative). > If no argument and at end of line, the previous two chars are exchanged." > - (interactive "*P") > - (when (and (null arg) (eolp) (not (bobp)) > - (not (get-text-property (1- (point)) 'read-only))) > - (forward-char -1)) > - (transpose-subr 'forward-char (prefix-numeric-value arg))) > + (interactive "*p") > + (transpose-subr 'forward-char arg)) > > (defun transpose-words (arg) > "Interchange words around point, leaving point at end of them. > -- > 2.34.1 Stefan, any further comments, or should I install this?