org-read-date-get-relative: Assure case-insensitive weekday matching
* lisp/org.el (org-read-date-get-relative): Bind `case-fold-search' to non-nil when matching weekdays. This is to avoid breakage for non-default value of `case-fold-search'.
This commit is contained in:
parent
cb1359a3ce
commit
c0d629b5bd
14
lisp/org.el
14
lisp/org.el
|
@ -13988,12 +13988,14 @@ DEF-FLAG is t when a double ++ or -- indicates shift relative to
|
|||
the DEFAULT date rather than TODAY."
|
||||
(require 'parse-time)
|
||||
(when (and
|
||||
(string-match
|
||||
(concat
|
||||
"\\`[ \t]*\\([-+]\\{0,2\\}\\)"
|
||||
"\\([0-9]+\\)?"
|
||||
"\\([hdwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?"
|
||||
"\\([ \t]\\|$\\)") s)
|
||||
;; Force case-insensitive.
|
||||
(let ((case-fold-search t))
|
||||
(string-match
|
||||
(concat
|
||||
"\\`[ \t]*\\([-+]\\{0,2\\}\\)"
|
||||
"\\([0-9]+\\)?"
|
||||
"\\([hdwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?"
|
||||
"\\([ \t]\\|$\\)") s))
|
||||
(or (> (match-end 1) (match-beginning 1)) (match-end 4)))
|
||||
(let* ((dir (if (> (match-end 1) (match-beginning 1))
|
||||
(string-to-char (substring (match-string 1 s) -1))
|
||||
|
|
Loading…
Reference in New Issue