From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.help
Subject: Re: Swapping Substrings
Date: Sat, 31 Oct 2020 12:57:18 +0100
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="8861"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: "help-gnu-emacs@gnu.org"
To: jai-bholeki
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 31 12:58:11 2020
Return-path:
Envelope-to: geh-help-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 1kYpWM-0002DV-Q0
for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 12:58:10 +0100
Original-Received: from localhost ([::1]:50890 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1kYpWL-0004u4-QS
for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 07:58:09 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34476)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1kYpVk-0004tv-ID
for help-gnu-emacs@gnu.org; Sat, 31 Oct 2020 07:57:32 -0400
Original-Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]:39035)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1kYpVi-0003VH-JU
for help-gnu-emacs@gnu.org; Sat, 31 Oct 2020 07:57:32 -0400
Original-Received: by mail-ot1-x336.google.com with SMTP id z16so2901446otq.6
for ; Sat, 31 Oct 2020 04:57:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=HasA7vksckADal3sw1Q291jpgX8DkXgIwnKHVRZi2bI=;
b=nFLphuEQEtJFGaNsMWLf+/2hiQOYJ2pKoC0qBqPOk/DWCGAm8+dMzVKSi1lZ64cYQ/
gqdL5frGDkSTzrf9gIsWNmgxMTL4STPWWSHqqUNZJPxwieU4LovlOy6vu7MN+SKcjpG8
mNtBvnrsd3CKdeXDsmYQSQ77FEn7XRwXghMEvrGyzWxGUmDJktO9zjjSJPlJlbEj0pYh
WGMpey5bQOlusiWaKAA6MSdxB8FYX4oKrY5yAfIDEURgDs4zhuMJV92gJdD7NCRQYRh8
gqaPSgRkWy8+hwFaSNTgrpLfZeVzHC0sMK2pIE8PWVamlLkLPXo5QwXACOoYtuDGyIxY
MyMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=HasA7vksckADal3sw1Q291jpgX8DkXgIwnKHVRZi2bI=;
b=iLCyjMxV0XerFP9kRNUTUeCazRJrtWt/OXQU870FnKkvZp0vyFXDBvGksbUvEkxR/q
SyN9nfXMwCQhds91MFh46Z5DDFH1ON2nz/qAr17EQMgXLmEU+mMSRTb4OEv/0/sjyWT4
ew3SKKipnQ+EOASiZ8511EeNRbFkHJPbjFDrB8TFJz4dl6navRVjE0zDg/9c5+3sDQJI
1s8GV7SOdogy6Du2tN9EgR/bPsJcY26x0gKBhJzL69uhpQapxNVbfjgz4EyXoJGYjpOy
P1wwjSM7oAX0miyFxFofOkCFs7A6A+lQ3VPV3Q8WXzSxiexESUhEjRVNbXRD+JVwnLhG
GCxw==
X-Gm-Message-State: AOAM532v54wlOH+SXyX5PGH8pc+b1m+GFF3+K7D/awttC3cbxoabj0DM
ewk0Lzto9nEAhhxKamGJJpPwHfKtSV1+6ylte5c=
X-Google-Smtp-Source: ABdhPJzt/5RnOBGb4wYJ41TwKgCC4Dbey5kNp/fxQyKsNmhPET/zN0hzDRRWJH0G5UAKc+VLzktAXrZpsYJGd+PGA80=
X-Received: by 2002:a9d:12f3:: with SMTP id g106mr4871938otg.149.1604145449412;
Sat, 31 Oct 2020 04:57:29 -0700 (PDT)
In-Reply-To:
Received-SPF: pass client-ip=2607:f8b0:4864:20::336;
envelope-from=p.stephani2@gmail.com; helo=mail-ot1-x336.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
That's all we know.
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: Users list for the GNU Emacs text editor
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "help-gnu-emacs"
Xref: news.gmane.io gmane.emacs.help:124828
Archived-At:
Am Sa., 31. Okt. 2020 um 11:22 Uhr schrieb jai-bholeki via Users list
for the GNU Emacs text editor :
>
> I need to swap two sub-strings in a word. The idea is that with the cursor
> within a string, the two sub-strings get swapped.
>
> Examples:
>
> For the word ParSkip with point on the letter S, one gets SkipPar
>
> For the word Keybinding with point on the letter b, one gets bindingKey
Maybe something like this:
(defun my-transpose ()
(interactive "*")
(let ((point (point)))
(cl-destructuring-bind (begin . end) (bounds-of-thing-at-point
'word-strictly)
(goto-char begin)
(insert (delete-and-extract-region point end)))))