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:15:36 +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="18744"; 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:16:26 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 1sZGgK-0004k9-Eo for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 31 Jul 2024 23:16:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZGfl-0006U7-9b; Wed, 31 Jul 2024 17:15:49 -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 1sZGfj-0006Tt-EA for help-gnu-emacs@gnu.org; Wed, 31 Jul 2024 17:15:47 -0400 Original-Received: from mail-40130.protonmail.ch ([185.70.40.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZGfg-0005fV-VI for help-gnu-emacs@gnu.org; Wed, 31 Jul 2024 17:15:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722460542; x=1722719742; bh=vkxpAbm10bFwp24ZEBP1TVK114I7Pt/80P0mjdSe5eM=; 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=p7dLVvWmv4+j2V6U4LH0ZgrWFEGiJ2N1nS1iSnLNxF8RzKn77+GT0XUUc/ac43wDV KFXYWisXZGwUmDE10ryYc2zhKW4ryuJAxqQ2QMRTYrAzAsKETCuxEUT6sh/RjIQChc ptf8BjAH0LZA6h+R8QwttBI62W5iIWoDB8UOsqO3Dq5Y28a2GKIYYPM2e9SWDmMRvO DqsmMVNKLly5SyNywNOEuPqlp/wczo0aF1HJLzZ/Clj0HYt9+K+rPMvd+Y6NWoH/DK pYZm2EB9cm9IkNNwJei/LyS3uTDIH+IqQQ6cmhIloFOvFikgKV9MpTyTxaKlaRDJoo rV1FIGNhhKnDA== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 91d7a945402004b9ef053d450f0122cd2ca98b56 Received-SPF: pass client-ip=185.70.40.130; envelope-from=heimeborgia@protonmail.com; helo=mail-40130.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:147469 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<>? () >=20 > (message "Hello")) >=20 > Perfectly legitimate, and none of those chars > even require escaping. >=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. Looked into the Elisp Ref Manual and could not find a description of \s_