unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Lars Ingebrigtsen <larsi@gnus.org>, Eli Zaretskii <eliz@gnu.org>
Cc: mattiase@acm.org, emacs-devel@gnu.org
Subject: Re: Emacs regexp scan (Sep 29)
Date: Sat, 5 Oct 2019 11:52:19 -0700	[thread overview]
Message-ID: <75094dd8-2c75-1d8e-fc14-12b614a9b1a4@cs.ucla.edu> (raw)
In-Reply-To: <87h84n6sc6.fsf@gnus.org>

On 10/5/19 9:59 AM, Lars Ingebrigtsen wrote:
> what's so special about regexps that "[-+]" has to be mass-rewritten
> as "[+-]"?

There's no mass rewriting here. I changed regexps near other (more-complicated) 
regexps that didn't put "-" at the end, regexps that were in fact incorrect 
evidently due to their authors' confusion. Using a consistent style in a 
trouble-prone area can help avoid future bugs when someone changes that code in 
the future.

If you add regexps to Emacs in the future, I suggest putting literal "-" at the 
end of bracket expressions, since that's the style recommended in the manual for 
a solid technical reason, namely to avoid all-too-common confusion in this area 
that causes real bugs. That is why the regexp scanner flags these "-" instances: 
it finds real bugs, some of which were fixed in the most-recent patch in this 
area. Of course there's a cost-benefit analysis to doing lint checking like 
this. In this particular case, the number of actual bugs and the simplicity of 
pacifying the lint checker mean that the benefits of using the checker outweigh 
the cost.

That being said, there's no pressing need to go through all the Emacs code and 
rewrite [-+] to [+-], just as there's no pressing need to go through all the 
Emacs code and remove the useless and distracting "register" keyword.



  reply	other threads:[~2019-10-05 18:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 19:39 Emacs regexp scan (Sep 29) Mattias Engdegård
2019-10-04 21:42 ` Paul Eggert
2019-10-05  8:10   ` Eli Zaretskii
2019-10-05  9:37     ` Mattias Engdegård
2019-10-05 10:49       ` Eli Zaretskii
2019-10-05 15:16         ` Stefan Monnier
2019-10-05 16:02           ` Eli Zaretskii
2019-10-05  9:52     ` Paul Eggert
2019-10-05 10:59       ` Eli Zaretskii
2019-10-05 15:20         ` Stefan Monnier
2019-10-05 16:03           ` Eli Zaretskii
2019-10-06 13:42             ` Stefan Monnier
2019-10-06 18:01               ` Eli Zaretskii
2019-10-05 19:19         ` Paul Eggert
2019-10-05 19:31           ` Eli Zaretskii
2019-10-05 19:50             ` Paul Eggert
2019-10-06 17:19               ` Eli Zaretskii
2019-10-06 17:33                 ` Paul Eggert
2019-10-06 18:53                   ` Eli Zaretskii
2019-10-06 19:19                     ` Paul Eggert
2019-10-06 19:31                       ` Eli Zaretskii
2019-10-05 16:59     ` Lars Ingebrigtsen
2019-10-05 18:52       ` Paul Eggert [this message]
2019-10-05 10:03   ` Mattias Engdegård

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=75094dd8-2c75-1d8e-fc14-12b614a9b1a4@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=mattiase@acm.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).