summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2020-02-23 12:46:31 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2020-02-23 12:51:07 +0100
commitee0dba64028c29edd31bc99ae40feb6e9b1bb8c6 (patch)
tree1ced8b30ddbeff21256dfec4c293f6a8ff9c796c
parentfe5962ce9b2474f5a85bcb609b8097ac62a73e64 (diff)
downloadorg-mode-ee0dba64028c29edd31bc99ae40feb6e9b1bb8c6.tar.gz
Small fix to headline search string
* lisp/ol.el (org-link-heading-search-string): (org-link-search): * lisp/ox.el (org-export-search-cells): Replace statistics cookies with a space before squeezing spaces so as to handle properly, e.g., "wordCOOKIEword".
-rw-r--r--lisp/ol.el8
-rw-r--r--lisp/ox.el2
2 files changed, 4 insertions, 6 deletions
diff --git a/lisp/ol.el b/lisp/ol.el
index e9bed39..d8e2f5b 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1192,7 +1192,7 @@ of matched result, which is either `dedicated' or `fuzzy'."
(when (equal words
(split-string
(replace-regexp-in-string
- cookie-re ""
+ cookie-re " "
(replace-regexp-in-string
comment-re "" (org-get-heading t t t)))))
(throw :found t)))
@@ -1258,10 +1258,8 @@ into a single one."
(unless (string-prefix-p "*" s) (setq s (concat "*" s)))
(replace-regexp-in-string comment-re "" s))))
(cookie-re "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]"))
- (org-trim
- (replace-regexp-in-string
- cookie-re ""
- (org-link--squeeze-white-spaces context)))))
+ (org-link--squeeze-white-spaces
+ (replace-regexp-in-string cookie-re " " context))))
(defun org-link-open-as-file (path arg)
"Pretend PATH is a file name and open it.
diff --git a/lisp/ox.el b/lisp/ox.el
index 4e22eed..f266a09 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4354,7 +4354,7 @@ ignores white spaces and statistics cookies, if applicable."
(`headline
(let ((title (split-string
(replace-regexp-in-string
- "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" ""
+ "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" " "
(org-element-property :raw-value datum)))))
(delq nil
(list