From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: Optional Arguments Date: Mon, 07 Dec 2020 21:52:11 +0100 Message-ID: References: <20201207130630.GA10719@tuxteam.de> <20201207153847.GB15617@tuxteam.de> <87y2i9e6j3.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 07 21:53:21 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 1kmNVX-0003ui-0S for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Dec 2020 21:53:19 +0100 Original-Received: from localhost ([::1]:58900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmNVW-0005g3-3X for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Dec 2020 15:53:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmNUh-0005e2-GC for help-gnu-emacs@gnu.org; Mon, 07 Dec 2020 15:52:27 -0500 Original-Received: from mail-oln040092075051.outbound.protection.outlook.com ([40.92.75.51]:53179 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmNUY-0001Cc-L6 for help-gnu-emacs@gnu.org; Mon, 07 Dec 2020 15:52:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WVl+ji9eFlysU1Y/j3us/FEZlF9RLImEyDQe0iL05oFWv0h8FpRCw2fltZyiOD8ZbTOR6h/0MWB3FWoT/shbvVNJv0TzbBPAnd/ZW12qVRO1/Sh9eVNeyPbanYpmCqhWQEbKOQHgCxFPjUEHeiro29QZ0+uruOGl6bwBcWmj4mxmVQHp9zFFECYZtDVYSwaCFyFtNr5A34fOsHNgf/4ayw6KADtfY2KLYzMTlfzO+dvubvdFrOPNBicCdHa3qlJ5wESpn1ylp9iE8mwilCZVPHdMNNS6DUmDwpwNwtmzj8tzw2XOROCnThObPsJH+r7Hy0lfeHYw+IQ5YUsAYndEuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CNwBZAnzueDvrU4NV8M0FBnKsxhR8lgjMlpykOC536E=; b=A7MQFJJ8qys4NwYNMWJOPmavwdG9KW4l/gwsENFhZxCkFypMPULzVrSpL5xmmxMyXE5lOLb0xEY8SvecLen050X6MzSTUtZhOOjg4PTScJDF5RwuTx30ATB5CFTeIWNqSiDwESJ4kTHFasicFPGrR7FUQjt0Tw9ZMiTiZ1rjAs2gqYBxayjEmHwkpGJh3LXlVK32aW1+fOo2koabEZ5sZXPeHJzg3opxOWX/+JKCqDG54B7urWDbc9qWP2KiP8PrlxIuuKoVIjy9A1jI9tcLf0jPZdSAzbB/JUMOzpEMcYjePjsb6xwM+EbNoEznadvyOc4kqzW/9BpfdeVvlahn7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CNwBZAnzueDvrU4NV8M0FBnKsxhR8lgjMlpykOC536E=; b=p3KujJTgMPQbAH/XbLfVaNNrUyCW3KKudCPihkQN9PFy+mZhuaDJkI9d6ayUGSd20z4MOYAK+OrQKep2fRUWNxf6ZARr/kNm/vbPu2PXGN6qyvBs2CUlXymy+FI1AWP/zvLCrQ4wAG2PrhAOzyBoOIbJYSCt0kkNm8Z3sYxMBALSSKqLGduUiG5eRixwspX7c63bCxaJcX2bEIwa9uo84toQTt89GP/7RjeKLeu8ETyXsn6JZbonNgA3iqtXCa29ybQpaxPjeZbboqm4oaNgg4zmZChBreJTboMJsPF4jQ0Nek+0d9nPSic0jTwj7jCnpki0N3PBUmKlMgRvw2ZObw== Original-Received: from HE1EUR04FT019.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::46) by HE1EUR04HT065.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::333) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 20:52:13 +0000 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com (2a01:111:e400:7e0d::51) by HE1EUR04FT019.mail.protection.outlook.com (2a01:111:e400:7e0d::117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Mon, 7 Dec 2020 20:52:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A700F0B8D63C7281D7CD509665EB436C627E87D3E6F3522F25E1F539F6CEB24C; UpperCasedChecksum:56338BB1CD94FAF2BD8A387622D91A51474710F71201155B3C6DDABE32D6EBBB; SizeAsReceived:8014; Count:46 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993]) by AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993%7]) with mapi id 15.20.3632.018; Mon, 7 Dec 2020 20:52:13 +0000 In-Reply-To: <87y2i9e6j3.fsf@web.de> (Michael Heerdegen's message of "Mon, 07 Dec 2020 20:54:24 +0100") X-TMN: [eoEttyfJ1vmKpwipt122y/URCJaTkfDu] X-ClientProxiedBy: AS8PR04CA0166.eurprd04.prod.outlook.com (2603:10a6:20b:331::21) To AM0PR06MB6577.eurprd06.prod.outlook.com (2603:10a6:208:19a::23) X-Microsoft-Original-Message-ID: <87o8j5qqys.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AS8PR04CA0166.eurprd04.prod.outlook.com (2603:10a6:20b:331::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21 via Frontend Transport; Mon, 7 Dec 2020 20:52:12 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 1063b2ad-6b99-4025-f1fc-08d89af1f8e8 X-MS-TrafficTypeDiagnostic: HE1EUR04HT065: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AJs5FR6zKPemjjHE4bf42hBcfV2dih2qNKwcQggOILqBrPUAzvy3OZlt/hzzm5Z9JEmpP0z5SurDq4cUC9cbHG0cYnGoYtaHBsZrmD1Tafh/DlGD3jjC/0tVhdk2Tqqui61yDerU6n2fKWFHhbvSvv1y/iifuBWgRdr0rnmaxmu4oKu9YTZvpMpiTuz1MDOozgAvFVFbgT7IyRvuZfXLTQ== X-MS-Exchange-AntiSpam-MessageData: S8XuVa3CuC5QfjKj8T5rV486B7r9+SZV0/Zysc6G2uJcgIOXoZDZTgow1Q712qFcy36OS5pOBRaiB+zBQA3VVDSPgJ5YqXXRZFKJCEFaxnzXbKKTzHTDZSqMvhk/qN2zJD7fz+4FtpI6fQnqee8yKQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1063b2ad-6b99-4025-f1fc-08d89af1f8e8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 20:52:13.0390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT019.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT065 Received-SPF: pass client-ip=40.92.75.51; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:126174 Archived-At: Michael Heerdegen writes: > pietru@caramail.com writes: > >> Am getting an error with the following. >> >> (defun word-markers () >> (let ((ma mb)) <-- > > You bind `ma' to the value of `mb'. That's not what you want. Exactly; this is what I had in my scratch when I tested: I just didn't copy everything in previous answer: (defun word-markers () (let (ma mb) (skip-chars-backward "[:alpha:]") (setq ma (point)) (skip-chars-forward "[:alpha:]") (setq mb (point)) (cons ma mb))) (defun test () (interactive) (let ((deactivate-mark nil) bounds ma mb) (if (use-region-p) (setq ma (region-beginning) mb (region-end)) (save-excursion (setq bounds (word-markers)) (setq ma (car bounds)) (setq mb (cdr bounds)))) (message "Bounds: %s" (pp bounds)) (message "Region: [%s %s]" ma mb) (message "Region-string: [%s]" (buffer-substring-no-properties ma mb)))) (test) Tou should drop one parenthesis around ma and mb in your let expression. That will declare two variables and initialize them to nil both.