unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Experimental regexp check: repetition of empty-matching expression
Date: Sat, 13 Apr 2019 10:09:57 +0200	[thread overview]
Message-ID: <EA1F1FF0-069C-4EC0-A0D7-ECB1C5A0D782@acm.org> (raw)
In-Reply-To: <6820fa9a-b99d-d2ad-ee28-1145f545ebda@cs.ucla.edu>

13 apr. 2019 kl. 04.47 skrev Paul Eggert <eggert@cs.ucla.edu>:
> 
> I think it's useful, except that the last entry (in dabbrev.el) seems to be a false alarm, as a regexp pattern is initially nil but is assigned something else before use, and the trawler assumes it's nil.

Yes, I couldn't make up my mind about the best way to suppress that one. Ignoring repetitions of the empty string, like \(?:\)*, may be the answer.

> I installed the attached patch into master to fix the other issues as best I could. Thanks.

That was quick work!

--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -383,7 +383,7 @@ mail-extr-initial-pattern
 ;; Matches telephone extensions.
 (defconst mail-extr-telephone-extension-pattern
   (purecopy
-   "\\(\\([Ee]xt\\|\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+"))
+   "\\(\\([Ee]xt\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+"))
                                             ^
Doesn't it look like the dot is meant to be escaped?
 
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -53,7 +53,7 @@ tramp-adb-method
   "When this method name is used, forward all calls to Android Debug Bridge.")
 
 (defcustom tramp-adb-prompt
-  "^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+  "^[[:digit:]]*|?\\(?:[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
There is a second one a bit later in the same regexp.




  reply	other threads:[~2019-04-13  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 20:00 Experimental regexp check: repetition of empty-matching expression Mattias Engdegård
2019-04-13  2:47 ` Paul Eggert
2019-04-13  8:09   ` Mattias Engdegård [this message]
2019-04-19 15:24     ` Paul Eggert

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=EA1F1FF0-069C-4EC0-A0D7-ECB1C5A0D782@acm.org \
    --to=mattiase@acm.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@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.
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).