unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Michael Welsh Duggan <mwd@md5i.com>,
	Richard Copley <rcopley@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Regexp linting scan
Date: Thu, 5 Dec 2019 19:34:25 -0800	[thread overview]
Message-ID: <abac7741-8b3e-311f-cbe4-699e93d22d9b@cs.ucla.edu> (raw)
In-Reply-To: <68EA74A2-F64C-46BC-8FCA-FEB41BA9DD2E@acm.org>

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

On 12/5/19 4:11 AM, Mattias Engdegård wrote:

> Correction: the '?' can be removed (keeping the '+') since the \1 is matched unconditionally.

Thanks, I installed the attached patch to fix that and the two new Org 
problems you mentioned today.


[-- Attachment #2: 0001-2019-12-05-regexp-lint-fixes.patch --]
[-- Type: text/x-patch, Size: 2945 bytes --]

From b59a0352c5245ba63ce0be5fd2eec58229e45330 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 5 Dec 2019 19:31:00 -0800
Subject: [PATCH] 2019-12-05 regexp lint fixes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/org/org-agenda.el (org-agenda-filter):
Fix unescaped literal ‘+’ in regexp.  Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org/org.el (org-clone-subtree-with-time-shift):
Fix a regexp typo that mishandled strings like ‘\1d’,
reported by the same emaikl.
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Omit unnecessary ‘?’ in regexp.  Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00217.html
---
 lisp/org/org-agenda.el         | 2 +-
 lisp/org/org.el                | 2 +-
 lisp/progmodes/verilog-mode.el | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 7cb5cca34c..2404ca43dc 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -7670,7 +7670,7 @@ org-agenda-filter
 		       (if negate "Negative filter" "Filter")
 		       " [+cat-tag<0:10-/regexp/]: ")
 		      'org-agenda-filter-completion-function))
-	   (keep (or (if (string-match "^+[-+]" f-string)
+	   (keep (or (if (string-match "^\\+[+-]" f-string)
 			 (progn (setq f-string (substring f-string 1)) t))
 		     (equal strip-or-accumulate '(16))))
 	   (fc (if keep org-agenda-category-filter))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index b37beeb96a..f25c53caaf 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -7825,7 +7825,7 @@ org-clone-subtree-with-time-shift
 		"")))			;No time shift
 	 (doshift
 	  (and (org-string-nw-p shift)
-	       (or (string-match "\\`[ \t]*\\([\\+\\-]?[0-9]+\\)\\([dwmy]\\)[ \t]*\\'"
+	       (or (string-match "\\`[ \t]*\\([+-]?[0-9]+\\)\\([dwmy]\\)[ \t]*\\'"
 				 shift)
 		   (user-error "Invalid shift specification %s" shift)))))
     (goto-char end-of-tree)
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 6ec8d995c1..01914aade5 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -10973,7 +10973,7 @@ verilog-inject-inst
 		(t
 		 ;; Delete identical interconnect
                  (let ((case-fold-search nil))  ; So we don't convert upper-to-lower, etc
-		   (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+\\)?\\s *(\\s *\\1\\s *)\\s *" end-pt t)
+		   (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+\\)\\s *(\\s *\\1\\s *)\\s *" end-pt t)
 		     (delete-region (match-beginning 0) (match-end 0))
                      (setq end-pt (- end-pt (- (match-end 0) (match-beginning 0))))  ; Keep it correct
 		     (while (or (looking-at "[ \t\n\f,]+")
-- 
2.23.0


  reply	other threads:[~2019-12-06  3:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-01 22:20 Regexp linting scan Mattias Engdegård
2019-12-02 10:14 ` Richard Copley
2019-12-02 10:19   ` Mattias Engdegård
2019-12-05  0:57     ` Paul Eggert
2019-12-05  2:10       ` Michael Welsh Duggan
2019-12-05 11:38         ` Mattias Engdegård
2019-12-05 12:11           ` Mattias Engdegård
2019-12-06  3:34             ` Paul Eggert [this message]
2019-12-05 10:21       ` Mattias Engdegård
  -- strict thread matches above, loose matches on Subject: below --
2020-01-30 16:16 Mattias Engdegård
2020-02-20 15:13 ` 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=abac7741-8b3e-311f-cbe4-699e93d22d9b@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    --cc=mwd@md5i.com \
    --cc=rcopley@gmail.com \
    /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).