diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-04 18:00:00 -0800 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2019-03-17 22:52:27 -0400 |
commit | 602f2280e37b1d4f7a41b685cbb7cc39b41d0d69 (patch) | |
tree | 5b43db0458d2735e9ac5e6d6c277fe9bed841bc3 | |
parent | 0007df863d94fef911bf10c86cb35e7a08a0e519 (diff) | |
download | org-mode-602f2280e37b1d4f7a41b685cbb7cc39b41d0d69.tar.gz |
Backport commit 3c94c7bc0 and db9c924d3 from Emacs
* lisp/ob-core.el (org-babel-string-read):
* lisp/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org-element.el (org-element-keyword-parser):
* lisp/org-list.el (org-list-indent-item-generic):
* lisp/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org-mobile.el (org-mobile-apply):
* lisp/org-mouse.el (org-mouse-context-menu):
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/ox-ascii.el (org-ascii-item):
* lisp/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/ox.el (org-export-expand-include-keyword):
Fix regular-expression infelicities and typos.
Fix regular-expression glitches and typos
3c94c7bc02fcacb4a101188dddb0c44d53444178
Paul Eggert
Mon Mar 4 18:00:58 2019 -0800
More regexp corrections and tweaks
db9c924d3d53f46846ad8fd74a5d08f4586a520e
Paul Eggert
Fri Mar 8 09:09:40 2019 -0800
Note(km): These two commits are ported together because, with respect
to Org files, db9c924d3 is a fix of an error from 3c94c7bc0.
-rw-r--r-- | lisp/ob-core.el | 2 | ||||
-rw-r--r-- | lisp/org-agenda.el | 2 | ||||
-rw-r--r-- | lisp/org-element.el | 2 | ||||
-rw-r--r-- | lisp/org-list.el | 2 | ||||
-rw-r--r-- | lisp/org-mhe.el | 2 | ||||
-rw-r--r-- | lisp/org-mobile.el | 4 | ||||
-rw-r--r-- | lisp/org-mouse.el | 2 | ||||
-rw-r--r-- | lisp/org-plot.el | 2 | ||||
-rw-r--r-- | lisp/org-protocol.el | 2 | ||||
-rw-r--r-- | lisp/org-table.el | 11 | ||||
-rw-r--r-- | lisp/org.el | 4 | ||||
-rw-r--r-- | lisp/ox-ascii.el | 4 | ||||
-rw-r--r-- | lisp/ox-latex.el | 2 | ||||
-rw-r--r-- | lisp/ox.el | 2 |
14 files changed, 22 insertions, 21 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 9ac998d..1a6bb84 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2972,7 +2972,7 @@ If the table is trivial, then return it as a scalar." (defun org-babel-string-read (cell) "Strip nested \"s from around strings." (org-babel-read (or (and (stringp cell) - (string-match "\\\"\\(.+\\)\\\"" cell) + (string-match "\"\\(.+\\)\"" cell) (match-string 1 cell)) cell) t)) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 069abbe..31f3dac 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9480,7 +9480,7 @@ the resulting entry will not be shown. When TEXT is empty, switch to (goto-char (point-min)) (cl-case type (anniversary - (or (re-search-forward "^*[ \t]+Anniversaries" nil t) + (or (re-search-forward "^\\*[ \t]+Anniversaries" nil t) (progn (or (org-at-heading-p t) (progn diff --git a/lisp/org-element.el b/lisp/org-element.el index 0fea9b3..e4e704d 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -2150,7 +2150,7 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and ;; this corner case. (let ((begin (or (car affiliated) (point))) (post-affiliated (point)) - (key (progn (looking-at "[ \t]*#\\+\\(\\S-+*\\):") + (key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):") (upcase (match-string-no-properties 1)))) (value (org-trim (buffer-substring-no-properties (match-end 0) (point-at-eol)))) diff --git a/lisp/org-list.el b/lisp/org-list.el index 727ec67..cfd674f 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2657,7 +2657,7 @@ Return t if successful." (error "Cannot outdent beyond margin") ;; Change bullet if necessary. (when (and (= (+ top-ind offset) 0) - (string-match "*" + (string-match "\\*" (org-list-get-bullet beg struct))) (org-list-set-bullet beg struct (org-list-bullet-string "-"))) diff --git a/lisp/org-mhe.el b/lisp/org-mhe.el index 969bff3..a37c41a 100644 --- a/lisp/org-mhe.el +++ b/lisp/org-mhe.el @@ -142,7 +142,7 @@ So if you use sequences, it will now work." "Return the name of the message folder in an index folder buffer." (save-excursion (mh-index-previous-folder) - (if (re-search-forward "^\\(+.*\\)$" nil t) + (if (re-search-forward "^\\(\\+.*\\)$" nil t) (message "%s" (match-string 1))))) (defun org-mhe-get-message-folder () diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7d2640a..baac7a9 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -859,11 +859,11 @@ If BEG and END are given, only do this in that region." (cl-incf cnt-error) (throw 'next t)) (move-marker bos-marker (point)) - (if (re-search-forward "^** Old value[ \t]*$" eos t) + (if (re-search-forward "^\\** Old value[ \t]*$" eos t) (setq old (buffer-substring (1+ (match-end 0)) (progn (outline-next-heading) (point))))) - (if (re-search-forward "^** New value[ \t]*$" eos t) + (if (re-search-forward "^\\** New value[ \t]*$" eos t) (setq new (buffer-substring (1+ (match-end 0)) (progn (outline-next-heading) diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el index 0cca65c..13d88da 100644 --- a/lisp/org-mouse.el +++ b/lisp/org-mouse.el @@ -633,7 +633,7 @@ This means, between the beginning of line and the point." ,@(org-mouse-list-options-menu (mapcar 'car org-startup-options) 'org-mode-restart)))) ((or (eolp) - (and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") + (and (looking-at "\\( \\|\t\\)\\(\\+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$") (looking-back " \\|\t" (- (point) 2) (line-beginning-position)))) (org-mouse-popup-global-menu)) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index aa34e40..a5635e3 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -336,7 +336,7 @@ line directly before or after the table." (insert "\n") (insert-file-contents (plist-get params :script)) (goto-char (point-min)) - (while (re-search-forward "$datafile" nil t) + (while (re-search-forward "\\$datafile" nil t) (replace-match data-file nil nil))) (insert (org-plot/gnuplot-script data-file num-cols params))) ;; Graph table. diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index d9fdef0..0577c31 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -330,7 +330,7 @@ returned list." (len 0) dir ret) - (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-z0-9][-_a-zA-z0-9]*:/+\\)\\(.*\\)" trigger) + (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-Z0-9][-_a-zA-Z0-9]*:/+\\)\\(.*\\)" trigger) (setq dir (match-string 1 trigger)) (setq len (length dir)) (setcar l (concat dir (match-string 3 trigger)))) diff --git a/lisp/org-table.el b/lisp/org-table.el index f4e3d35..e22ee95 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -1156,7 +1156,7 @@ to a number. In the case of a timestamp, increment by days." (- (org-time-string-to-absolute txt) (org-time-string-to-absolute txt-up))) ((string-match org-ts-regexp3 txt) 1) - ((string-match "\\([-+]\\)?\\(?:[0-9]+\\)?\\(?:\.[0-9]+\\)?" txt-up) + ((string-match "\\([-+]\\)?[0-9]*\\(?:\\.[0-9]+\\)?" txt-up) (- (string-to-number txt) (string-to-number (match-string 0 txt-up)))) (t 1))) @@ -2327,7 +2327,7 @@ LOCATION instead." "\n")))) (defsubst org-table-formula-make-cmp-string (a) - (when (string-match "\\`$[<>]" a) + (when (string-match "\\`\\$[<>]" a) (let ((arrow (string-to-char (substring a 1)))) ;; Fake a high number to make sure this is sorted at the end. (setq a (org-table-formula-handle-first/last-rc a)) @@ -2375,7 +2375,7 @@ LOCATION is a buffer position, consider the formulas there." (cond ((not (match-end 2)) m) ;; Is it a column reference? - ((string-match-p "\\`$\\([0-9]+\\|[<>]+\\)\\'" m) m) + ((string-match-p "\\`\\$\\([0-9]+\\|[<>]+\\)\\'" m) m) ;; Since named columns are not possible in ;; LHS, assume this is a named field. (t (match-string 2 string))))) @@ -3236,7 +3236,7 @@ known that the table will be realigned a little later anyway." (cond ((string-match "\\`@-?I+" old-lhs) (user-error "Can't assign to hline relative reference")) - ((string-match "\\`$[<>]" old-lhs) + ((string-match "\\`\\$[<>]" old-lhs) (let ((new (org-table-formula-handle-first/last-rc old-lhs))) (when (assoc new eqlist) @@ -3659,7 +3659,8 @@ Parameters get priority." (setq startline (org-current-line)) (dolist (entry eql) (let* ((type (cond - ((string-match "\\`$\\([0-9]+\\|[<>]+\\)\\'" (car entry)) + ((string-match "\\`\\$\\([0-9]+\\|[<>]+\\)\\'" + (car entry)) 'column) ((equal (string-to-char (car entry)) ?@) 'field) (t 'named))) diff --git a/lisp/org.el b/lisp/org.el index ca4c5d5..d5a7bf5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10058,7 +10058,7 @@ This is still an experimental function, your mileage may vary." ((and (equal type "lisp") (string-match "^/" path)) ;; Planner has a slash, we do not. (setq type "elisp" path (substring path 1))) - ((string-match "^//\\(.?*\\)/\\(<.*>\\)$" path) + ((string-match "^//\\(.*\\)/\\(<.*>\\)$" path) ;; A typical message link. Planner has the id after the final slash, ;; we separate it with a hash mark (setq path (concat (match-string 1 path) "#" @@ -21994,7 +21994,7 @@ assumed to be significant there." (save-excursion (skip-chars-backward "[ \t]") (skip-chars-backward "\\\\") - (looking-at "\\\\\\\\\\($\\|[^\\\\]\\)"))) + (looking-at "\\\\\\\\\\($\\|[^\\]\\)"))) (defun org-fill-paragraph-with-timestamp-nobreak-p () "Non-nil when a new line at point would split a timestamp." diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 25317cb..7917e3d 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -1472,8 +1472,8 @@ contextual information." (replace-regexp-in-string "-" "•" (replace-regexp-in-string - "+" "⁃" - (replace-regexp-in-string "*" "‣" bul)))))))) + "\\+" "⁃" + (replace-regexp-in-string "\\*" "‣" bul)))))))) (indentation (if (eq list-type 'descriptive) org-ascii-quote-margin (string-width bullet)))) (concat diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index e09312f..a147111 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1610,7 +1610,7 @@ INFO is a plist used as a communication channel." (defun org-latex-clean-invalid-line-breaks (data _backend _info) (replace-regexp-in-string - "\\(\\end{[A-Za-z0-9*]+}\\|^\\)[ \t]*\\\\\\\\[ \t]*$" "\\1" + "\\(\\\\end{[A-Za-z0-9*]+}\\|^\\)[ \t]*\\\\\\\\[ \t]*$" "\\1" data)) @@ -3300,7 +3300,7 @@ storing and resolving footnotes. It is created automatically." (setq value (replace-match "" nil nil value))))) (lines (and (string-match - ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" + ":lines +\"\\([0-9]*-[0-9]*\\)\"" value) (prog1 (match-string 1 value) (setq value (replace-match "" nil nil value))))) |