From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60157: 30.0.50; [PATCH]: Change interactive form in transpose-chars Date: Sat, 24 Dec 2022 20:11:41 +0100 Message-ID: <87mt7cr502.fsf@thornhill.no> References: <87k02qte06.fsf@thornhill.no> <83y1qx5lp8.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2810"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60157@debbugs.gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 24 20:12:10 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 1p99wH-0000XQ-MI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Dec 2022 20:12:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p99wD-00053p-1a; Sat, 24 Dec 2022 14:12:05 -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 1p99wA-00053f-ML for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 14:12:02 -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 1p99wA-0001pD-78 for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 14:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p99w9-00080Z-Mf for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 14:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2022 19:12: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.167190910730755 (code B ref 60157); Sat, 24 Dec 2022 19:12:01 +0000 Original-Received: (at 60157) by debbugs.gnu.org; 24 Dec 2022 19:11:47 +0000 Original-Received: from localhost ([127.0.0.1]:47161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p99vv-0007zy-5y for submit@debbugs.gnu.org; Sat, 24 Dec 2022 14:11:47 -0500 Original-Received: from out-111.mta0.migadu.com ([91.218.175.111]:24060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p99vs-0007zp-Fw for 60157@debbugs.gnu.org; Sat, 24 Dec 2022 14:11:45 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671909102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+cCQRs6oo/x9KgDuhEl7eRMMLso39k6btI1Zm1YtdIk=; b=oRCcpih0G1J+wNpfm2A8XW2El8bxPpVHnFR7wFJoJXA3/AUqj4BO0xC3BVSlKFw9f7ijv6 vCreXV8gT7M/42DtmOFCsJKiQ/PXhYJX4h3s3nnhB1ww7NvhkE8y+vTVgifn7r5m/uDk8O KUa+C6oBcJX1teJonzNg/aGQK1xCES4PrwtdrfBzsuNJBWJzQHK01hMyjSdT8YOUlR4xq2 NtqyAFu8zEGWDSKF7yiBhb1Kt95kWy7ZHu6Izn4VETTp/ybsW4ThFIuriTHMm1wZ6dHXx8 e1KqSB8/3x22xav8dlGLlVdLL6llZ1k/4htSFGsWW/NMtBymLfNPpAY4vt5PaQ== In-Reply-To: X-Migadu-Flow: FLOW_OUT 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:251813 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: >>> 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)) > > Hmm... If you remove this, does it still behave as described on the last > line of the docstring? > You're right. It does not. I fixed that in the latest patch. >>> + (transpose-subr 'forward-char arg)) > > Please use #' to quote function names. > Sure! Is this okay? Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Use-p-in-interactive-form-in-transpose-chars.patch >From 21cabdb2779caa55a53c972150d9bee8a4ca14e5 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 * lisp/simple.el (transpose-chars): Use '*p' instead of '*P' like the other transpose-* functions. --- lisp/simple.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index b3174eef7d..69a7189a35 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8423,12 +8423,12 @@ transpose-chars "Interchange characters around point, moving forward one character. 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)) +If at end of line, the previous two chars are exchanged." + (interactive "*p") + (when (and (eolp) (not (bobp)) (not (get-text-property (1- (point)) 'read-only))) (forward-char -1)) - (transpose-subr 'forward-char (prefix-numeric-value arg))) + (transpose-subr #'forward-char arg)) (defun transpose-words (arg) "Interchange words around point, leaving point at end of them. -- 2.34.1 --=-=-=--