From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pietru@caramail.com Newsgroups: gmane.emacs.help Subject: Optional Arguments Date: Mon, 7 Dec 2020 04:17:10 +0100 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="32996"; 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 Mon Dec 07 04:22:01 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 1km768-0008Sb-Nt for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Dec 2020 04:22:00 +0100 Original-Received: from localhost ([::1]:38862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1km767-0003Xb-KZ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Dec 2020 22:21:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1km71X-0003XU-RW for help-gnu-emacs@gnu.org; Sun, 06 Dec 2020 22:17:15 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:36059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1km71W-0003yt-3I for help-gnu-emacs@gnu.org; Sun, 06 Dec 2020 22:17:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607311030; bh=/lInb3s35f8uqVs2St5RG9HYeleV1hpb6qBJjmkViZY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=eavnBXeVEJuoIuZrIdkN2GoBUZ8X5rNU5r8EPsGSUH7oMDSkAVXnINo808qm47wrN B2nbMnJoDldYlznVZmX5AmvBBvEzoAcl9YCFDawNF1YTfbKoxFV1dvQc4mZB1yf0Yh jbstY+3l4TlID5hf+4u5t/hU260w9jBCr3z0Blwg= 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-bs11.server.lan [172.19.170.179]) (via HTTP); Mon, 7 Dec 2020 04:17:10 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:m/KSI5TcicLRyHmeCdR+wipBSeOi5RW179fYoX6sQxh7GAzw9Xr2+OeU3dEV0BmB+lWBF ryECnTAPkQD/0ipYGLFZTzjaZFDbtQXquXK/j5DbJNRZu2hwON1tMTbPcmErXpzfDbAza5Bspwkh j1qLdm/z4QynQPQoYzOfe+PTihwi4j0VDVZyAOaPrpvao7F/5qznnekrVZH9WvS+NchKTHtEneAj JcJpHWzalnT3qhhiXI9amYESMkH9GUMSSwmSGoYH1A+uE35znI+czHmm7/zOTeiju5f91Nsxhyrp 3s= X-UI-Out-Filterresults: notjunk:1;V03:K0:XRZFJ/u+U4w=:YdYSa9+7ngKdF7wUUt4whT 536SGSappRHdiABvRQFszJeJ8G/K0r22M6huAEvgCQcb34Z9ICyLaISE4uU2TIE6aOzGbaUt5 7XN0AQWRantn7erJIEiXgVFvGYoSA7JkLQ7WEC640QjyD3pnWZyTeAOLcj9trA1YX1+LPz1wO 14D8THepuqocVlGGJ0fxakzaT2tUVqdiLgazKNWBmGh2uR6RzxrvdO5v2QtQjt8YcTHjZNF5c UxjgjlQO7PU2zfxAF14IO6yXjcgZAMZdeug3nGOB3uaJrV7mhVoxnvOAuKKKoaPquWsunfJdq EHyqBc5B+Mmdy3BkUPKbQZw9r67UQwivQ6X40P2Ur62iVRqRKfH+pTR0SvxO2elT9KZYF5TZO H724w8naqDd/1JIJNUoaQqMmm3jMJRCV3UwolSJCNej6XEYURzInaOBuub6Ww+xQxbrp7uIFI sbVqbVLCiN0v0lHcl9oXhuFZv/PABmwOIdERElJYApNlCOvRKfqXPsi93snn70H1lCm9mN2Du VF9qBDua/JsvvP96Rw1hLJhVJBnpD60WFopkEYHk6RcD2TNP827sfP/DDwnqxJezjnUwnGYdT i+rMGw88rUbEs= Received-SPF: pass client-ip=212.227.15.18; envelope-from=pietru@caramail.com; helo=mout.gmx.net 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:126135 Archived-At: Would like to have two functions 1. skip-chars - skip to beg of word (if no argument) or end of word (if ar= gument is 1) 2. word-markers - get beg and end of a word position of word Have written the following. For the first one, I have not used optional ar= guments before. And have read documentation about functions. About the second, there errors when I try to execute. (defun typh-skip-chars (&optional n) (interactive "n Skip direction: ") (if (=3D n 1) (skip-chars-forward "[:alpha:]") (skip-chars-backward "[:alpha:]")) ) (defun typh-word-markers (ma mb) (interactive) (skip-chars-backward "[:alpha:]") (setq ma (point)) (skip-chars-forward "[:alpha:]") (setq mb (point)) (message "[ma,mb]: %s,%s" ma mb) )