all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Theodor Thornhill <theo@thornhill.no>
Cc: 60157@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#60157: 30.0.50; [PATCH]: Change interactive form in transpose-chars
Date: Sat, 24 Dec 2022 09:01:55 +0200	[thread overview]
Message-ID: <83y1qx5lp8.fsf@gnu.org> (raw)
In-Reply-To: <87k02qte06.fsf@thornhill.no> (message from Theodor Thornhill on Sat, 17 Dec 2022 13:23:53 +0100)

> Cc: monnier@iro.umontreal.ca, eliz@gnu.org
> From: Theodor Thornhill <theo@thornhill.no>
> 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 <theo@thornhill.no>
> 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?





  reply	other threads:[~2022-12-24  7:01 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=83y1qx5lp8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60157@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.