summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-04-03 12:25:31 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-04-03 12:25:31 +0200
commit5d5ea7bcccfaf82a2bff62c2fa81a11f436dfa06 (patch)
tree764e8dea059138a2b10cc5b81bcfae0a8d031a17
parenta9e6c07b6aa075f7e27623c20c4161981a643777 (diff)
downloadorg-mode-5d5ea7bcccfaf82a2bff62c2fa81a11f436dfa06.tar.gz
Fix two bugs in time regular expressions
* lisp/org.el (org-ts-regexp-both): Add "]" to class of characters that should not be matched. (org-ts-regexp0): (org-ts-regexp1): Do not start a class with "^]-+", because that tries to (not) match characters between "]" and "+". Instead, move the "-" to the end of the class where it causes no harm.
-rw-r--r--lisp/org.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 28025ea..2369999 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5003,13 +5003,13 @@ This should be called after the variable `org-link-types' has changed."
(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>"
"Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)[]>]"
+(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*?\\)[]>]"
"Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp0 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]-+0-9>\r\n ]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+(defconst org-ts-regexp0 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
"Regular expression matching time strings for analysis.
This one does not require the space after the date, so it can be used
on a string that terminates immediately after the date.")
-(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) +\\([^]-+0-9>\r\n ]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) +\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
"Regular expression matching time strings for analysis.")
(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
"Regular expression matching time stamps, with groups.")
@@ -15402,6 +15402,7 @@ With prefix ARG, change that many days."
The date will be changed by N times WHAT. WHAT can be `day', `month',
`year', `minute', `second'. If WHAT is not given, the cursor position
in the timestamp determines what will be changed."
+ (debug)
(let ((pos (point))
with-hm inactive
(dm (max (nth 1 org-time-stamp-rounding-minutes) 1))