aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/org
diff options
context:
space:
mode:
authorPaul Eggert2019-03-19 18:45:17 -0700
committerPaul Eggert2019-03-19 18:47:53 -0700
commite14c0d748efe35afc653151ff18c4dd93dcc456e (patch)
treef31050be99133f3466413728c2c948ab7914fcb7 /lisp/org
parentb2dd61ffb0b4efc0419f4b5cbe279c2700b549e8 (diff)
downloademacs-e14c0d748efe35afc653151ff18c4dd93dcc456e.tar.gz
emacs-e14c0d748efe35afc653151ff18c4dd93dcc456e.zip
More minor regex cleanup
Problems reported by Mattias EngdegÄrd in: https://lists.gnu.org/r/emacs-devel/2019-03/msg00643.html plus a few others that I noticed. * lisp/auth-source-pass.el (auth-source-pass--parse-data): * lisp/org/org-datetree.el (org-datetree--find-create): * lisp/org/org-pcomplete.el (org-thing-at-point): * lisp/progmodes/js.el (js--end-of-do-while-loop-p): * lisp/textmodes/sgml-mode.el: (sgml-electric-tag-pair-before-change-function): * lisp/textmodes/texnfo-upd.el (texinfo-menu-copy-old-description): * lisp/url/url-http.el (url-http-parse-response): Fix regular expression and similar syntax.
Diffstat (limited to 'lisp/org')
-rw-r--r--lisp/org/org-datetree.el9
-rw-r--r--lisp/org/org-pcomplete.el4
2 files changed, 7 insertions, 6 deletions
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index aea2c8d3d61..b4797de1e58 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -138,15 +138,16 @@ will be built under the headline at point."
138 "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$" 138 "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
139 year month day)))) 139 year month day))))
140 140
141(defun org-datetree--find-create (regex year &optional month day insert) 141(defun org-datetree--find-create
142 "Find the datetree matched by REGEX for YEAR, MONTH, or DAY. 142 (regex-template year &optional month day insert)
143REGEX is passed to `format' with YEAR, MONTH, and DAY as 143 "Find the datetree matched by REGEX-TEMPLATE for YEAR, MONTH, or DAY.
144REGEX-TEMPLATE is passed to `format' with YEAR, MONTH, and DAY as
144arguments. Match group 1 is compared against the specified date 145arguments. Match group 1 is compared against the specified date
145component. If INSERT is non-nil and there is no match then it is 146component. If INSERT is non-nil and there is no match then it is
146inserted into the buffer." 147inserted into the buffer."
147 (when (or month day) 148 (when (or month day)
148 (org-narrow-to-subtree)) 149 (org-narrow-to-subtree))
149 (let ((re (format regex year month day)) 150 (let ((re (format regex-template year month day))
150 match) 151 match)
151 (goto-char (point-min)) 152 (goto-char (point-min))
152 (while (and (setq match (re-search-forward re nil t)) 153 (while (and (setq match (re-search-forward re nil t))
diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el
index 49983c40a52..cf272de90a8 100644
--- a/lisp/org/org-pcomplete.el
+++ b/lisp/org/org-pcomplete.el
@@ -49,10 +49,10 @@
49 "Examine the thing at point and let the caller know what it is. 49 "Examine the thing at point and let the caller know what it is.
50The return value is a string naming the thing at point." 50The return value is a string naming the thing at point."
51 (let ((beg1 (save-excursion 51 (let ((beg1 (save-excursion
52 (skip-chars-backward "[:alnum:]-_@") 52 (skip-chars-backward "-[:alnum:]_@")
53 (point))) 53 (point)))
54 (beg (save-excursion 54 (beg (save-excursion
55 (skip-chars-backward "a-zA-Z0-9-_:$") 55 (skip-chars-backward "-a-zA-Z0-9_:$")
56 (point))) 56 (point)))
57 (line-to-here (buffer-substring (point-at-bol) (point)))) 57 (line-to-here (buffer-substring (point-at-bol) (point))))
58 (cond 58 (cond