Browse Source

Backport commit 4c9330771 from Emacs

* lisp/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.el (org-clone-subtree-with-time-shift): Fix a regexp typo
that mishandled strings like ‘\1d’, reported by the same email.

2019-12-05 regexp lint fixes
4c933077157ba409d645f4649c8a3a8e534d53d5
Paul Eggert
Thu Dec 5 19:32:12 2019 -0800
Paul Eggert 7 months ago
parent
commit
a3101370bd
2 changed files with 2 additions and 2 deletions
  1. 1 1
      lisp/org-agenda.el
  2. 1 1
      lisp/org.el

+ 1 - 1
lisp/org-agenda.el

@@ -7670,7 +7670,7 @@ the variable `org-agenda-auto-exclude-function'."
 		       (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))

+ 1 - 1
lisp/org.el

@@ -7825,7 +7825,7 @@ with the original repeater."
 		"")))			;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)