0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-26 20:02:53 +00:00

Allow escaped spaces in agenda search view

* lisp/org-agenda.el (org-search-view): Recover spaces in search words
if they were escaped with \ or inside a regexp.
This commit is contained in:
Carsten Dominik 2010-09-23 08:51:19 +02:00
parent 045413afdf
commit 9ec705cb57

View file

@ -3556,6 +3556,20 @@ in `org-agenda-text-search-extra-files'."
(member (string-to-char words) '(?- ?+ ?\{)))
(setq boolean t))
(setq words (org-split-string words))
(let (www w)
(while (setq w (pop words))
(while (and (string-match "\\\\\\'" w) words)
(setq w (concat (substring w 0 -1) " " (pop words))))
(push w www))
(setq words (nreverse www) www nil)
(while (setq w (pop words))
(when (and (string-match "\\`[-+]?{" w)
(not (string-match "}\\'" w)))
(while (and words (not (string-match "}\\'" (car words))))
(setq w (concat w " " (pop words))))
(setq w (concat w " " (pop words))))
(push w www))
(setq words (nreverse www)))
(setq org-agenda-last-search-view-search-was-boolean boolean)
(when boolean
(let (wds w)