From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tomas Nordin Newsgroups: gmane.emacs.help Subject: Re: Transposing words over middle words Date: Tue, 21 Nov 2017 18:21:42 +0100 Message-ID: <873757zgwp.fsf@fliptop> References: <871skywvp4.fsf@hornfels.zedat.fu-berlin.de> <83o9o2i4xz.fsf@gnu.org> <20171116152231522684703@bob.proulx.com> <23054.41962.848150.764633@mail.eng.it> <23054.42180.139282.82688@mail.eng.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511284978 8194 195.159.176.226 (21 Nov 2017 17:22:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2017 17:22:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 18:22:51 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHCFz-0001NQ-S3 for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 18:22:48 +0100 Original-Received: from localhost ([::1]:35669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHCG3-0007IQ-Ni for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 12:22:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHCFN-0007HH-Ix for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 12:22:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHCFK-0004G4-AK for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 12:22:09 -0500 Original-Received: from mout01.posteo.de ([185.67.36.141]:36374) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHCFK-0004CW-0H for help-gnu-emacs@gnu.org; Tue, 21 Nov 2017 12:22:06 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3D8CF20D8C for ; Tue, 21 Nov 2017 18:21:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1511284920; bh=dzmN0eqp2PUZWULZs5JZfMFADIKop5LSSpdlOIRt8N0=; h=From:Subject:Date:From; b=iLXeu5/axqK1DLXqiDAXhTW/QTekA8AsGuNxCIOTgC0gnWzO3qWondV8QtaQPIw6z y09EGN23OMP/U1ISH25ils825a67lT2NwQiZI9fcuxqpwMyHPmwi4gfKw8daCGCq2n YjZBY7iHFSu8d2z224DiTr08A5AtJXT2/g9Eemm20qEi/V03EQJMpRG1k23Bk9r4bw NEl7zGR9mIjFKXtiQdOg7WxrI3d//yxKYN1BWfHwxhpBw9B7zzVKxg2nFBBaylt5j/ pn4rJHGimmbNCulw6LYW05/9e9KiHBJvGEAyEjN790jAopCwTyu17/YW/5cbZ9zw+3 blhvapx64FVvQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3yhC7T5bJJz9rxJ for ; Tue, 21 Nov 2017 18:21:57 +0100 (CET) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.67.36.141 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115029 Archived-At: > Than again, maybe M-t should work like `C-0 M-t` whenever the region > is active so you don't even need the C-u at all. Here is an advice to make that happen, respecting possible prefixes. (defun tn-transpose-dwim-advice (transpose-subr &rest args) (if (and (use-region-p) (= (cadr args) 1)) ;; MOVER dwim SPECIAL (apply transpose-subr (car args) 0 (cddr args)) (apply transpose-subr args))) (advice-add 'transpose-subr :around #'tn-transpose-dwim-advice) ;;; remove the hack with this: ;; (advice-remove 'transpose-subr #'tn-transpose-dwim-advice)