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: Define interactive function with arguments Date: Fri, 9 Oct 2020 08:38:02 +0200 Message-ID: References: <87v9fkth3m.fsf@ebih.ebihd> 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="16493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: moasenwood@zoho.eu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 08:53:18 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 1kQmHG-0004Bd-Ku for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 08:53:18 +0200 Original-Received: from localhost ([::1]:54508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQmHF-0001OV-FM for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 02:53:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQm2b-0006IC-UP for help-gnu-emacs@gnu.org; Fri, 09 Oct 2020 02:38:11 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:42971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQm2X-0000RM-3M for help-gnu-emacs@gnu.org; Fri, 09 Oct 2020 02:38:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602225482; bh=zRdV8DFio1rUetIJqGQiLJ8tTKi5Fp4+lUpco3g3zBM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LYSGrS6hZ1acrK5vFHRcvvWUGftE2z0Q99ccgTS2+3JxA9ODS9yW2JRq3xZsZ7tEz GyaaiwasHHy91My8QS/OJMDr6DtrQcbfz4hKFn3mVqlsXsDkMVSMeSPoYhAw/eK/iv z0xpRLsrP6N0Rr7Orc+Zbz8eZp6VTZcmu5g5N+is= 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-bs09.server.lan [172.19.170.177]) (via HTTP); Fri, 9 Oct 2020 08:38:02 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <87v9fkth3m.fsf@ebih.ebihd> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:Xq/3lmTAsiQKWEaMvNS9NqS0G7+BNOBb1gppEyXtMqOLxxexSavHHwCgMQF3fBfWQBeu8 ntq60xiw41ZruV/H/3wbC4EWTIe4ygRW3RX/5DyqW9238S3egnLVGpDA9lHNpJ5trwdPWPBAR4bv Nv+16pJH863mrJAJVq10zLcCYcX/7xKzcNeTbL4PO4THrR/eRTQHXhPnGvF1jtwW7QjYjMM2w1yy qpcPYNRPbNGLJdieOR8KQQrx+xD/szkNEd91/8uS+L7Ba3feAnNUTASnePusC6Dr5FqplgVX0Y6h fU= X-UI-Out-Filterresults: notjunk:1;V03:K0:v61hKAuKq50=:ed/y1jIzOfHmoYbu7j6tGM ZRZUcRYHgYfR1AEnXo2G1O3tJm435SKEaCN9QOh0fx/Lh/NMjKyeE0lVRtUPy9w158k2vC4IA Qj9ztwC5v39jbkgEatzt3vfCEQzOzeTLi51zxoTnCT4i8H4Kvi0Dk9um2XBWTV19c27DAaTpH eF86aZpKLZOfiEyvYR0XD0X6IerVJ8Vnv5Yz6srhnFoj1rx98v6/Jg2t8V1adkxiHPV2FHK6L tLRW13Dv3RK0zGgBZLcsj8PD8lemW4meIQSq+RqRjq7E4YmqDS7sbiM8WQll4hBbXbYouLV1b H9n7Oufayb5BoL+v3OkfZO4bDlkvlgl2wCBXOId3c+MwWgHtwX7kpdcKUDj6EWebZaOK1KcuD gekztcBimaYdNqghIaouzy+4mqjcvIHCzeYIbN/LquOmIfPhIj4wLB5KzT0UjXbXrQNjNhe2T GRxdCOR/7EAKagdBNWHAauZxlUQNdMUbFStdB92sO9xvoz/6VPSPaJEwN1J8gbHYSvbNmZ7xy 2/4bS0MzuxHzZripqtzy2CzEuFFfuVRW2jLWFCPlvPkbBrivJovMj2pq6a5G/tH9iRK7qyILa qEhMt1L2CqnuVWFKjOGeWFFSHj/42x75y/DV9DoqLmXrHSnJ1/Ph/hrVEAyk3bj/zulR1dgZG lr19EDbAH7Ty1zOyPGR0PKth/BVbZeqQwiBTc8TEVEGASHg== Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/09 02:38:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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:124391 Archived-At: Is the following code the way to write user defined functions with arguments? ( defun Transpose-Paragraphs-Arg (arg) "Transfer paragraph backward" (interactive) (transpose-paragraphs arg) ) Regards C* > Sent: Friday, October 09, 2020 at 1:47 AM > From: "Emanuel Berg via Users list for the GNU Emacs text editor" > To: help-gnu-emacs@gnu.org > Subject: Re: Define interactive function with arguments > > Christopher Dimech wrote: > > > I want to call a function that takes a numeric > > argument to I can shift paragraphs. > > > > ( defun Transpose-Paragraphs-Arg (arg) > > "Transfer paragraph backward" > > (interactive) > > (transpose-paragraphs arg) > > ) > > > > I have been using "M-x Transpose-Paragraphs-Arg" > > > > But then, how does one pass the value of the > > argument to the function. > > C-u X M-x transpose-paragraphs RET > > where X marks the spot! > > Use without an explicit number also works, > > just C-u - 4 > then C-u C-u - 16 > and so on > > Also negative values are possible, e.g. > > C-u -1 M-x transpose-paragraphs RET > > Also works with shortcuts. > > See > > C-h f universal-argument RET > > -- > underground experts united > http://user.it.uu.se/~embe8573 > https://dataswamp.org/~incal > > >