From 9ec705cb57b77595dd9aeb17f9168fb1db9ac908 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 23 Sep 2010 08:51:19 +0200 Subject: [PATCH] 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. --- lisp/org-agenda.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index eb8b2390d..f8ee2b3a9 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -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)