diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-12-18 14:35:09 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-12-18 14:35:09 +0100 |
commit | 46394dff7f01e7fe4af06a6c344e151af5c3eef4 (patch) | |
tree | 25d5e5aa0ae9c4ed51161980f158d686fd874993 /lisp/org | |
parent | 0ad1c0d51cd3e1b02deedee9b05647fcd0734076 (diff) | |
download | emacs-46394dff7f01e7fe4af06a6c344e151af5c3eef4.tar.gz emacs-46394dff7f01e7fe4af06a6c344e151af5c3eef4.tar.bz2 emacs-46394dff7f01e7fe4af06a6c344e151af5c3eef4.zip |
Follow good regexp practice
These were found by relint 1.19.
* lisp/help-fns.el (help-fns--first-release): Use string-end instead
of line-end when matching a file name.
* lisp/org/ob-core.el (org-babel--string-to-number): Put hyphen last
in alternative.
* lisp/org/org-agenda.el (org-agenda-filter): Escape '+' correctly.
Diffstat (limited to 'lisp/org')
-rw-r--r-- | lisp/org/ob-core.el | 2 | ||||
-rw-r--r-- | lisp/org/org-agenda.el | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index 7300f239eef..ede35e154a3 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -2995,7 +2995,7 @@ situations in which is it not appropriate." "If STRING represents a number return its value. Otherwise return nil." (unless (or (string-match-p "\\s-" (org-trim string)) - (not (string-match-p "^[0-9-e.+ ]+$" string))) + (not (string-match-p "^[0-9e.+ -]+$" string))) (let ((interned-string (ignore-errors (read string)))) (when (numberp interned-string) interned-string)))) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 83f30bf96af..5a2ba027f97 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -7734,9 +7734,9 @@ the variable `org-agenda-auto-exclude-function'." (negate (equal strip-or-accumulate '(4))) (cf (mapconcat #'identity org-agenda-category-filter "")) (tf (mapconcat #'identity org-agenda-tag-filter "")) - (rpl-fn (lambda (c) (replace-regexp-in-string "^\+" "" (or (car c) "")))) - (ef (replace-regexp-in-string "^\+" "" (or (car org-agenda-effort-filter) ""))) - (rf (replace-regexp-in-string "^\+" "" (or (car org-agenda-regexp-filter) ""))) + (rpl-fn (lambda (c) (replace-regexp-in-string "^\\+" "" (or (car c) "")))) + (ef (replace-regexp-in-string "^\\+" "" (or (car org-agenda-effort-filter) ""))) + (rf (replace-regexp-in-string "^\\+" "" (or (car org-agenda-regexp-filter) ""))) (ff (concat cf tf ef (when (not (equal rf "")) (concat "/" rf "/")))) (f-string (completing-read (concat |