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: bounds for strings with - between subwords Date: Fri, 7 May 2021 01:37:54 +0200 Message-ID: References: <871raj32ba.fsf@zoho.eu> 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="36177"; 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 May 07 01:39:07 2021 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 1lenaF-0009EU-7n for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 01:39:07 +0200 Original-Received: from localhost ([::1]:54976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lenaD-0001uj-Ns for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 06 May 2021 19:39:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lenZG-0001ty-TG for help-gnu-emacs@gnu.org; Thu, 06 May 2021 19:38:07 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:47121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lenZ6-0005LZ-Cr for help-gnu-emacs@gnu.org; Thu, 06 May 2021 19:38:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620344274; bh=cZo1TQSP1c1CB6OWdnMQUaCK00WsNYnmzuo5ft28NEg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=A+9euHUaWF2MJiWI6GmwrqhwJ4woyeP3jEYF3NoNohFcGm1AMw/KmrLUAMyAVLkwd AdwJ0NBm0KmhF+nWMP7Y6TsUfp7AfMNGGAUGe3JR7Qv9aPFaTd60MRXB1HxblRr3HC H+ztd6xTnR5w+G5fAp0w+EMkwmOg16/fcvQ7szbE= 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-bs12.server.lan [172.19.170.180]) (via HTTP); Fri, 7 May 2021 01:37:54 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <871raj32ba.fsf@zoho.eu> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:HVlWZZG2HIyhZjvIPT2/D9VsYt8+KDgj4UWVs05Krn5iIO64yQltXL8R80De7Kx7UrOq4 keM4SRl6uns76zzLTs4uZkJyUc1FGgCnxkpQT6A0bCGKrCYETsuT1MnRB4YpyUxWm/5oWUsZsjH5 CvqMSfPLHWugIzyzKeAld62L6JKzoreK1ScFkmSjheg5YUliS7tLwT1FSmzcajF9fOZ6GediSL5+ /6cIDqAxAyfuIWRMh2GENcgjJzoZOkfPHSUNeOyph2Kph95kES6hOPYompsTG5E19QEISHryl3Wq qc= X-UI-Out-Filterresults: notjunk:1;V03:K0:HuF0HN3sdow=:9znKg97S2Gk7lD8U0BYkET Vzu2YvnGCpeXLf0+8xuEm3CJPB8kL28vZoU0mWxiMw4RNCJ0KIkJbqASzVLPcrXMn8C/2dtSr 27JKxgdeXYfhPlScpmX1leVw7uYPxK8JOS0S2FuowZH9tTX3yYldrUKrp8wLYGmg1r1Cw92ti PZu6Yt6Vu3NntPP1n+ZCYzP8E4/TX07AbVEiELHoD1Lncc9J1M/P+1FBsPc4zll6h4NV29Lfq oDweQ4Py99CNoI1caOTO7KM5JnHH3eVLZmQwjsyXNuvoSE/OrU8jgXzEiCE3m05Z1mlJVJ7cD EGs7ZrPpAXvqVAVdkcgEw+QSCE5klXg81Xv+CACSSUIkerJ6r7MOiNcvDn8uqxgbqX5EHxg4z RT1QImrpmt3k1uDyqsrdR/HLWZ5Dmq+jWZANYAUZCewJ/juuU1eyCOd9tJF1PtUggoDy6f0R6 nSz6jDP4Hlh/nHa3G69TAH+Y4SFerHn1F7LRnocaPOofP4bqn8aaEWhbvIywfJkkk19LWeF7c 0Qdds1NyCK2MsVArXyqvzCrsoQuxiVyh6bZRsfv3h+U89/czlrIpLfQJBKm2LA/hwHZcfxVrp EU8jFZtMleQuVA7bKVdUHqT4yqsM49i+KGI4UXFmentbWn/uxPAOAKnarvhGt2SAzgjpRuBuK rQJO9mT8txexRyHk7PMdmFUPgWIWgqdfrwD8GMu4BdnHzsB6i3ybhJLa0w5JVs18+rTc+HRJj +3LV7MhWlin/dFOZ94YDIUp5GGkUDznJ5O6ieuE4zCDLhV6iCh0NvK+U0tX1ZfAXeOhOhnvs Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.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:129537 Archived-At: > Sent: Friday, May 07, 2021 at 10:49 AM > From: "Emanuel Berg via Users list for the GNU Emacs text editor" > To: help-gnu-emacs@gnu.org > Subject: Re: bounds for strings with - between subwords > > steve-humphreys wrote: > > > I am using the following function that gets me the bounds > > for each word. > > > > But I have strings like > > > > bibl-bellerive-etal-2016 > > > > which I want to get the bounds for strings with - > > between subwords. > > I'm not following 100% but you can add digits and a dash to > your below work if that helps? > > (skip-chars-forward "[:alnum:]-") > > > (defun alpha-bounds () > > "Gets bounds of a subword unit defined by regular expression [a-zA-= Z]." > > (let ( ($bounds nil) $ma $mb ) > > (skip-chars-backward "[:alpha:]") > > (setq $ma (point)) > > (skip-chars-forward "[:alpha:]") > > (setq $mb (point)) > > (setq $bounds (bounds-of-thing-at-point 'word)) > > (cons $ma $mb) )) > > You can put all that in the `let' to avoid the use of `setq'. > > Also $bounds doesn't seem to do anything? bounds are used in another function. You can see there is (cons $ma $mb) = at the end, which is used as output when you call "alpha-bounds". > And what's the purpose of the $? I use $ no tell me the variable is local and not being modified from outsi= de. It is coming from the $1, $2, $3, ... function parameter idea. > -- > underground experts united > https://dataswamp.org/~incal > > >