unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
Cc: 60157@debbugs.gnu.org
Subject: bug#60157: 30.0.50; [PATCH]: Change interactive form in transpose-chars
Date: Sat, 24 Dec 2022 20:11:41 +0100	[thread overview]
Message-ID: <87mt7cr502.fsf@thornhill.no> (raw)
In-Reply-To: <jwvo7rsgbx1.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> 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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-p-in-interactive-form-in-transpose-chars.patch --]
[-- Type: text/x-diff, Size: 1322 bytes --]

From 21cabdb2779caa55a53c972150d9bee8a4ca14e5 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
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


  reply	other threads:[~2022-12-24 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17 12:23 bug#60157: 30.0.50; [PATCH]: Change interactive form in transpose-chars Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-24  7:01 ` Eli Zaretskii
2022-12-24 13:40   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-24 19:11     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-25  1:11       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-25  7:36         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06  7:08           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mt7cr502.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60157@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).