unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Janne Nykopp <newcup@peruna.fi>
To: help-gnu-emacs@gnu.org
Subject: Regexp search: syntax class for comment starter (\s<) does not work consistently in all modes
Date: Fri, 27 Sep 2019 23:22:11 +0300	[thread overview]
Message-ID: <20190927202211.3onie75t3ydknsmb@peruna.fi> (raw)

Hello!

Seems that regexp search for comment starter syntax class, \s<,
doesn't work out of the box in C, C++, Java, javascript (neither for
// or /* comment styles), or pascal ((*), ada or sql (--) modes, for
instance.

It does work out of the box in e.g. lisp (;) - but not for the
two-character comment delimiter (#|), sh (#), fortran (C and !),
postscript ps-mode (%), DOS batch bat-mode (:: and REM), HTML mode
(<!--) ...

I find this strange, because e.g. bat-mode's or html-mode's syntax
specifications (C-h s) don't say anything about comments. On the other
hand, C and the other modes have syntax specifications filled with
detailed comment syntax information. Hence, I'd expect it to be
vice-versa, that \s< wouldn't work in bat-mode but would in c-mode.

I tested with freshly compiled emacs-24.5, 25.3 and 26.3, launching
them with emacs -q -Q. They all seem to behave identically.

I'm wondering whether it's a known and accepted issue that comment
starter syntax class regexp search doesn't quite work in all modes?

Best regards,
Janne Nykopp



             reply	other threads:[~2019-09-27 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 20:22 Janne Nykopp [this message]
2019-09-27 21:32 ` Regexp search: syntax class for comment starter (\s<) does not work consistently in all modes Stefan Monnier
2019-10-01 20:08   ` Janne Nykopp
2019-10-02  1:44     ` Stefan Monnier

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=20190927202211.3onie75t3ydknsmb@peruna.fi \
    --to=newcup@peruna.fi \
    --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).