From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Transposing words over middle words Date: Thu, 16 Nov 2017 15:55:17 -0700 Message-ID: <20171116152956604638874@bob.proulx.com> References: <20171115155650067497545@bob.proulx.com> <87vaia9e9v.fsf@mbork.pl> <86h8tu53il.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1510872964 10363 195.159.176.226 (16 Nov 2017 22:56:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Nov 2017 22:56:04 +0000 (UTC) User-Agent: NeoMutt/20170609 (1.8.3) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 16 23:56:01 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 1eFT4f-0002Bl-6m for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Nov 2017 23:55:57 +0100 Original-Received: from localhost ([::1]:43160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFT4m-0003sv-Fn for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Nov 2017 17:56:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFT47-0003sc-Ag for help-gnu-emacs@gnu.org; Thu, 16 Nov 2017 17:55:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFT43-0001AB-AL for help-gnu-emacs@gnu.org; Thu, 16 Nov 2017 17:55:23 -0500 Original-Received: from havoc.proulx.com ([96.88.95.61]:50231) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFT43-00019K-4Q for help-gnu-emacs@gnu.org; Thu, 16 Nov 2017 17:55:19 -0500 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id AD9AF2D2 for ; Thu, 16 Nov 2017 15:55:17 -0700 (MST) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 4CD522183B for ; Thu, 16 Nov 2017 15:55:17 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 41B982DC5C; Thu, 16 Nov 2017 15:55:17 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <86h8tu53il.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 96.88.95.61 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:114913 Archived-At: Emanuel Berg wrote: > Marcin Borkowski wrote: > > I had no idea! How cool is that? > > Thanks a lot!!! > > Cool indeed, but the mark business makes it as > complicated anyway compared with transposing > two times: Yes. Agreed. > (defun transpose-over-word () > (interactive) > (transpose-subr #'forward-word 2) > (backward-word 1) > (transpose-subr #'forward-word -1) ) This is a nice example of the joy of customizing emacs. For my tastes I would want it to move the point with the word being dragged forward two words. Here is my modification to the above. (defun transpose-over-word () (interactive) (transpose-subr #'forward-word 2) (backward-word 1) (transpose-subr #'forward-word -1) (forward-word 1) ) That actually does exactly what I would want M-1 M-t to do. Bob