aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-12-18 14:35:09 +0100
committerMattias EngdegÄrd2020-12-18 14:35:09 +0100
commit46394dff7f01e7fe4af06a6c344e151af5c3eef4 (patch)
tree25d5e5aa0ae9c4ed51161980f158d686fd874993
parent0ad1c0d51cd3e1b02deedee9b05647fcd0734076 (diff)
downloademacs-46394dff7f01e7fe4af06a6c344e151af5c3eef4.tar.gz
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.
-rw-r--r--lisp/help-fns.el2
-rw-r--r--lisp/org/ob-core.el2
-rw-r--r--lisp/org/org-agenda.el6
3 files changed, 5 insertions, 5 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 043c79f3900..20fe382cb09 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -653,7 +653,7 @@ FILE is the file where FUNCTION was probably defined."
653 ;; of the *packages* in which the function is defined. 653 ;; of the *packages* in which the function is defined.
654 (let* ((name (symbol-name symbol)) 654 (let* ((name (symbol-name symbol))
655 (re (concat "\\_<" (regexp-quote name) "\\_>")) 655 (re (concat "\\_<" (regexp-quote name) "\\_>"))
656 (news (directory-files data-directory t "\\`NEWS\\($\\|\\.\\)")) 656 (news (directory-files data-directory t "\\`NEWS\\(\\'\\|\\.\\)"))
657 (place nil) 657 (place nil)
658 (first nil)) 658 (first nil))
659 (with-temp-buffer 659 (with-temp-buffer
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."
2995 "If STRING represents a number return its value. 2995 "If STRING represents a number return its value.
2996Otherwise return nil." 2996Otherwise return nil."
2997 (unless (or (string-match-p "\\s-" (org-trim string)) 2997 (unless (or (string-match-p "\\s-" (org-trim string))
2998 (not (string-match-p "^[0-9-e.+ ]+$" string))) 2998 (not (string-match-p "^[0-9e.+ -]+$" string)))
2999 (let ((interned-string (ignore-errors (read string)))) 2999 (let ((interned-string (ignore-errors (read string))))
3000 (when (numberp interned-string) 3000 (when (numberp interned-string)
3001 interned-string)))) 3001 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'."
7734 (negate (equal strip-or-accumulate '(4))) 7734 (negate (equal strip-or-accumulate '(4)))
7735 (cf (mapconcat #'identity org-agenda-category-filter "")) 7735 (cf (mapconcat #'identity org-agenda-category-filter ""))
7736 (tf (mapconcat #'identity org-agenda-tag-filter "")) 7736 (tf (mapconcat #'identity org-agenda-tag-filter ""))
7737 (rpl-fn (lambda (c) (replace-regexp-in-string "^\+" "" (or (car c) "")))) 7737 (rpl-fn (lambda (c) (replace-regexp-in-string "^\\+" "" (or (car c) ""))))
7738 (ef (replace-regexp-in-string "^\+" "" (or (car org-agenda-effort-filter) ""))) 7738 (ef (replace-regexp-in-string "^\\+" "" (or (car org-agenda-effort-filter) "")))
7739 (rf (replace-regexp-in-string "^\+" "" (or (car org-agenda-regexp-filter) ""))) 7739 (rf (replace-regexp-in-string "^\\+" "" (or (car org-agenda-regexp-filter) "")))
7740 (ff (concat cf tf ef (when (not (equal rf "")) (concat "/" rf "/")))) 7740 (ff (concat cf tf ef (when (not (equal rf "")) (concat "/" rf "/"))))
7741 (f-string (completing-read 7741 (f-string (completing-read
7742 (concat 7742 (concat