unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: "'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)'" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Regexp for matching (defun lines
Date: Wed, 31 Jul 2024 21:15:36 +0000	[thread overview]
Message-ID: <dNX6Hp3Oj7eiVRMrSiV7qOv5IkY1eXxiNYqcZC7SdV1X-GEN4-VOWSbV80JL9dhKsUAgWJBrOFVD26N2RiUQwbt9d-pxrhgsFA5nQW6kcW8=@protonmail.com> (raw)
In-Reply-To: <DS7PR10MB5232D7F72F5FF0DF3CB3F938F3B12@DS7PR10MB5232.namprd10.prod.outlook.com>

On Thursday, August 1st, 2024 at 9:02 AM, Drew Adams <drew.adams@oracle.com> wrote:

> > > (concat
> > > "^\\s-("
> > > (regexp-opt...)
> > > t)
> > > "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)")
> > 
> > I see that you use "\\sw". What is the advantage verses "[[:alnum:]-_]"
> 
> 
> No special advantage. You can include any other
> chars you want, so you can pick up, e.g.,
> 
> (defun foo!@$%^&*+={}/:42<>? ()
> 
> (message "Hello"))
> 
> Perfectly legitimate, and none of those chars
> even require escaping.
> 
> 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.
> 
> My point was really to point out that there are
> many ways to define a function, other than just
> `defun'.
> 
> > Why do you use the OR "\\|" with "\\s_" ?
> 
> 
> 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_



  reply	other threads:[~2024-07-31 21:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 19:23 Regexp for matching (defun lines Heime
2024-07-31 19:59 ` [External] : " Drew Adams
2024-07-31 20:14   ` Heime
2024-07-31 21:02     ` Drew Adams
2024-07-31 21:15       ` Heime [this message]
2024-08-01  2:11         ` Drew Adams
2024-07-31 21:29       ` Heime
2024-08-01  2:08         ` Drew Adams
2024-08-01  2:24           ` Heime
2024-08-01  3:34             ` Drew Adams
2024-08-01  4:15               ` Heime

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='dNX6Hp3Oj7eiVRMrSiV7qOv5IkY1eXxiNYqcZC7SdV1X-GEN4-VOWSbV80JL9dhKsUAgWJBrOFVD26N2RiUQwbt9d-pxrhgsFA5nQW6kcW8=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).