From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: RE: [External] : Regexp for matching (defun lines Date: Wed, 31 Jul 2024 21:29:03 +0000 Message-ID: References: <5kzhsBHCj8GW4rjzi0sutBSutYlMHmDBIV7PD1V_v0CGB-KH5pSJPw0jrwHErO5ivHjsPTAcmmaAHXNJH4u6VON3xL6q7Hdwnf2SNxOw_G8=@protonmail.com> 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="34700"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)'" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 31 23:29:54 2024 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 1sZGtO-0008rq-BX for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 31 Jul 2024 23:29:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZGsi-0008Kj-9l; Wed, 31 Jul 2024 17:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZGsf-0008BJ-88 for help-gnu-emacs@gnu.org; Wed, 31 Jul 2024 17:29:09 -0400 Original-Received: from mail-40141.protonmail.ch ([185.70.40.141]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZGsd-0004rF-GG for help-gnu-emacs@gnu.org; Wed, 31 Jul 2024 17:29:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722461344; x=1722720544; bh=Y5NfyRPF0IViTdO26/hFVf7cte7BVtSoHwhD4fdD+ds=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=gxc6hUpooX6OvFi10RZYbP4LFMMQaxk61fZsNGrpj1hiJJHcg6UGDqlCkCPZhTakQ dbEAzTg9Gh7GQJux8cMU9wIvl+nVxmt8DW++GRk7SeiIlW9u2GA6dFAOi2w/rH7esn AWpiMCntoJ3vBkzzopMll8xhWrA4aahIP9elRQ2CA3ynJko1Yq8eEgwG3xUukCAtM7 O5m+I2+e4qP2nvlvB7PzFOmGTJut/3Cff5bskUzJGdjLem3HYgAoesizRPgrK/tRpS EVh6s9ndrIjPs3CqKdUqKi8lfMgU3TmaIRB4AQQe6gSNCGEmwAg4MfDn3yzk/Wl3JG jq0gVZP2rxHqg== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 64dd6a4a33c9a956bddda8a01e22f5da4d4af5d6 Received-SPF: pass client-ip=185.70.40.141; envelope-from=heimeborgia@protonmail.com; helo=mail-40141.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147471 Archived-At: On Thursday, August 1st, 2024 at 9:02 AM, Drew Adams wrote: > > > (concat > > > "^\\s-(" > > > (regexp-opt...) > > > t) > > > "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)") > >=20 > > I see that you use "\\sw". What is the advantage verses "[[:alnum:]-_]" >=20 >=20 > No special advantage. You can include any other > chars you want, so you can pick up, e.g., >=20 > (defun foo!@$%^&*+=3D{}/:42<>? () > > (message "Hello")) > > Perfectly legitimate, and none of those chars > even require escaping. Meaning that \\sw is superior to [[:alnum:]-_], right ? =20 > A function name can include ANY chars, including > whitespace and chars that normally have special > meaning for Lisp, but some need to be escaped > in the defun. If you want to handle such cases, > go for it. >=20 > My point was really to point out that there are > many ways to define a function, other than just > `defun'. >=20 > > Why do you use the OR "\\|" with "\\s_" ? >=20 >=20 > Word-syntax chars plus symbol-syntax chars. > But use whatever you like.