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: Emacs Interactive functions with arguments Date: Fri, 9 Oct 2020 13:52:49 +0200 Message-ID: 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="5470"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 13:54:48 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 1kQqz0-0001Ia-8y for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 13:54:46 +0200 Original-Received: from localhost ([::1]:45578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQqyz-0005xO-3V for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 07:54:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQqxB-0005xH-BB for help-gnu-emacs@gnu.org; Fri, 09 Oct 2020 07:52:53 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:52699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQqx9-0004Yh-8h for help-gnu-emacs@gnu.org; Fri, 09 Oct 2020 07:52:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602244369; bh=jR5msPUAOG96kCVOIADxnWsP9bBp6bKfxo8rB4HUSg0=; h=X-UI-Sender-Class:From:To:Subject:Date; b=dnHUQaCqGgYNu6jgEDr0Vh67ifI2egNWDuGHLpbeD+RtRhtbxInm9xyl7Av4oIAh8 ePQqrqQESCPCao1LGf9TERHWFTzHLQXuRE1fKtpvsYBxEPBGPQGXdYK9+MpdSO1u3q rDaGlwITiYMRnZUma3H7MzV8wiNZ6L1+td+NX8yk= 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 13:52:49 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:8AygcWAIxliijeCVhtwCLDP+/sIHEvsVSp4Kt6bXMIUo34Ukfi6mkPZD6DFKWQ5bll6xc Us2kAxNZ3AyPEeb0fhqv6mVfOrfQ/OQPTxLxg8nmE4QZTD9UWJl2M7H2xl6rScqnZfIASxPuVyhY /N01DBZV3G+bkBEN+fs+faqGkgEawWykw0k9QRByN0ToaMMd97eUWBLL3vaK8TabRCt0VkRBKNiH cicZG6m5JevBEJATy89dcMi1waHYtw+s7Rks8UI5ssgytRssEaQ/JY+37zdA23O4hISWhY5Q9u/c W4= X-UI-Out-Filterresults: notjunk:1;V03:K0:eQGw60SFpmc=:CnzfqJmoJMYR4ihkqp+rnx QivvQ/eUj+gU9dObCu3T4EvDYa2RRzXy0NVLACjgK7WpREXlNJcP24GGLW7Dn4dK4FnNBRvLs HBaWLuY5P47BLlha2miFgywWRIsr/PApVqUQ59eg/Fz3kbZ2iZjVqvLYdR4I0lAjzb04cKjce Flj0GvCFxJHsrPT5XbhJumfWPriTincQJtIp99QXtaJ3wXQwTSPXji1flpmbYUg5FTqftT1GX x23zY5y8cRbyM0PC5kH0gefYJX7HUGXyykImfdcvBbZcyLdoipRl66MzIWVEugms5zI3DHhYq IHCJi7tkS25pkhQ6tmicfleVeTGaBDA3a4DVBiCOu3m1a7jjOyXqZMa5PW939i/wfermYRTfz gVKx8tTGiDQiA0PV1BhqYJjHdJSDlhp97WehrSp8DX6NTqXNKd96EM4X2cX9nv8eliOrFKaXd ENek60dIIu/Z1qLIv0dmWExemfuh4T62XVLQwm8TujIS3wkeCR9g8x3R3YXV4yRvCDgjakbGi hbXevc2JVqwJ9457Qpm7aeYTo+yid5CXNQEB9Hlts1uxGW1XxyQdUbHn+DMfyncCcU/tBo6PB cvyBxBxJ/ONjUmrXHHMBQ9owMBLZxclNo0J2BtOoVb9drumjPV+aZRKY49xVRKcM8pQuK79lY 2HEeolQK1WcnBsjaZULlEp4wOBasVvqpoIFOaGAsD49+oK0Qq1kvG1yvmXpb/qMgKDpI= Received-SPF: pass client-ip=212.227.15.19; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/09 07:52:49 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:124396 Archived-At: Dear Compeers, I understand a few things about Emacs Functions. For instance, the following function uses simply an (interactive) declaration. This means that IntchgW will not accept the passing of arguments to it. ( defun IntchgW () "Interchanges words using (transpose-words arg)." (interactive) (transpose-words -2) ) Have also constructed the function IntchgW to interchange words. ( defun IntchgW (arg) "Interchanges words using (transpose-words arg)." (interactive "NType Arg to transpose-words: ") (transpose-words arg) ) I can call the function using two methods (1) Using "M-x IntchgW -2 " Arg is inputted through the Mini-Buffer. (2) Using "C-u -2 M-x IntchgW" Here Arg is passed as a prefix to IntchgW. And if I use (interactive "nType Arg to transpose-words: "), I can only pass the argument Arg using the Min-Buffer "M-x IntchgW -2 ". I cannot pass Arg as a prefix to IntchgW using "C-u -2 M-x IntchgW" But then I have the following functions. And the effect of the (interactive "p") and (interactive "pType Arg to transpose-words: ") is confusing to me. Besides general comments, I have some specific question. (1) The two constructs (interactive "p") and (interactive "pMessage: ") are valid, but are they equivalent? (2) How is (interactive "p") different from (interactive "N"). They both represent numeric arguments, but what is different? Reagrds ( defun IntchgWp (arg) "TODO" (interactive "p") (transpose-words arg) ) ( defun IntchgW--pmesg (arg) "TODO" (interactive "pType Arg to transpose-words: ") (transpose-words arg) )