From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Keybinding Default Command and Execution with Argument Date: Thu, 5 Nov 2020 17:19:16 +0100 Message-ID: References: <20201105155811.GB24492@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29172"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 05 17:22:38 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 1kai21-0007SQ-QH for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Nov 2020 17:22:37 +0100 Original-Received: from localhost ([::1]:54182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kai20-0000LT-Lg for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 05 Nov 2020 11:22:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kahz6-0000II-WB for help-gnu-emacs@gnu.org; Thu, 05 Nov 2020 11:19:38 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:45105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kahz4-0001RA-8l for help-gnu-emacs@gnu.org; Thu, 05 Nov 2020 11:19:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1604593156; bh=9sUxNQ8wub3k+6bHR+MErTr/gFVKFGaQBdV+sr/Mt/s=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XKcNP4oSpv4F9vv5iLFG4ysmy5kVSPu1pNbIrwObZxL1JKcIsMRCHIgZ5khSN6X84 LFEty/R21l+SuM37D/IdTigWXGJe+rk0ZMepuXTkq8TqoIwJSKmQQCjCyDsYb5OBsD qLsftGcZmjMcyv9HeSmlugyLh8fn90OW8i3NLjns= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs14.server.lan [172.19.170.182]) (via HTTP); Thu, 5 Nov 2020 17:19:16 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <20201105155811.GB24492@tuxteam.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:P+wt8Aul9Wh2BAgtP5NQNG16pc3PQqhuEwEwc8a7k/xRW+sRvVHd32BW4uPgSR+vRK0hL 332qj8IV32IAD5khqxmao8M1wAdxxzxvdx4lLfjhVxdxpSLhQk7fxAPeBFtsLIYZydf63I88TIiu kwPRxiee2vt/7BaiunBteRcPNelE75ooFnNwNenHVNEAoF79VBnwS+IhL6SEITl62hzGxSh9Zub9 7SNsWu0fftfI1Og1RJaYlFpWni2WQfgCC7WL+MW+ZOozciaaUu7TbK4xHGUFiwwd5EufTnleQT+m kU= X-UI-Out-Filterresults: notjunk:1;V03:K0:bq23ft2dY/g=:UdMq3uw6EWkCZNpsqmFOAr GllDhl/j+/Spi6oNKFVnzDaKTlxUIBIm1iYrC31PM4c2PoWMjTQ4r+CWuoEc1MF3ieBF+k2Y6 T97QWcSoSdnkvp3t98HTRkzWMA41guR9+KyVBZZEMNMsNiPckMrs++S3DVYl/ZUsFQKmICgVH DOGBgSuNarxQnX3gZZ4fdNwlQorMETEbBLvaqoJWFBs6QBrZSDCVRwcEMTAEuD5QDDrhPUOb4 YxwLSNXVDqF7K+V3I0vdUDlky8Hbc52bk79h/8619qBV3jHcswg7fLOZKqdEKO2Xn+BWx37EG JkYNi7x0yDBL9aCQH6EMLqNkF7Ti2FY/Htet8GWdgazlWPbXbE+sLkvrRBipIlwCLZ23N/+je WlkC784xaQ54lO3gqgZngJqsUwPqNa2ImS8KRCtyy3G3jyEfNcMIIkuYv4E8sjkvSAbP3cSog zBo/2ZjmEKAIJv2y0eLdTOAfcxYD2VJNVzXQFFCNlSCVXznrG1pHtvppz1kkCxbjhbPJDUj30 9EIRg0RN8ZwIKD4IHLMEmsiqmpvAmypc61HLTC0DgOrlp3I5j++n8sruywB+6U++gleZGzl91 C2zSOn+llK4WQ= Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/05 10:56:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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:125026 Archived-At: My Emacs is insane then as it does not give me the link to simple=2Eel > Sent: Thursday, November 05, 2020 at 4:58 PM > From: tomas@tuxteam=2Ede > To: help-gnu-emacs@gnu=2Eorg > Subject: Re: Keybinding Default Command and Execution with Argument > > On Thu, Nov 05, 2020 at 04:41:11PM +0100, Christopher Dimech wrote: > > I made a simple defun to move the current character over n other chara= cters=2E > > It behaves a differently than transpose-chars, because the cursor poin= t stays > > on the same character, rather than moving to the cursor next to the sw= apped > > character to the right=2E > >=20 > > When using transpose-chars=2E one can use transpose-chars without any = argument, > > taking the default of one=2E > >=20 > > M-x transpose-chars > >=20 > > Alternatively, one can pass an argument (e=2Eg=2E 3) as follows > >=20 > > C-u 3 M-x transpose-chars > >=20 > > Currently, I can only use Skip-Over-Chars with argument=2E Is there a= way to > > use the function Skip-Over-Chars without requiring an argument, but de= faulting > > the argument to one as what can be done with transpose-chars? >=20 > Ask `transpose-chars' itself :) >=20 > I=2Ee=2E do >=20 > C-h f transpose-chars >=20 > You'll get a small help buffer explaining transpose-chars=2E Basically t= he > function's docstring, and then something=2E >=20 > Part of this something is the function's location, like so: >=20 > "transpose-chars is an interactive compiled Lisp function in > in =E2=80=98simple=2Eel=E2=80=99=2E >=20 > It is bound to C-t=2E >=20 > [more stuff]" >=20 > The simple=2Eel is highlighted as a link=2E It is a link=2E If your > Emacs installation is sane, you can put point at this link > (alternatively you click on it), and you get to transpose-char's > definition, in simple=2Eel=2E There you see: >=20 > (defun transpose-chars (arg) > "Interchange characters around point, moving forward one character= =2E > With prefix arg ARG, effect is to take character before point > and drag it forward past ARG other characters (backward if ARG negativ= e)=2E > If no argument and at end of line, the previous two chars are exchange= d=2E" > (interactive "*P") > (when (and (null arg) (eolp) (not (bobp)) > =2E=2E=2E ) =2E=2E=2E) =2E=2E=2E) >=20 > So they are using (interactive "P") for that=2E You can look up what tha= t > means in `interactive's documentation=2E The asterisk is there to ensure > that the buffer is writable=2E >=20 > Emacs teaches you the tricks of the Grandmasters ;-) >=20 > Cheers > - t >