From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: Agenda search C-c a s Date: Fri, 18 Jan 2013 16:07:05 +1100 Message-ID: <8738xzgjuu.fsf@breezy.my.home> References: <50F89212.7010207@gmail.com>, , <28851.1358482040@alphaville> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw4Ac-0000Pc-Rw for emacs-orgmode@gnu.org; Fri, 18 Jan 2013 00:07:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tw4AX-0000fE-4z for emacs-orgmode@gnu.org; Fri, 18 Jan 2013 00:07:14 -0500 Received: from mail-pb0-f52.google.com ([209.85.160.52]:35405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw4AW-0000f6-MK for emacs-orgmode@gnu.org; Fri, 18 Jan 2013 00:07:09 -0500 Received: by mail-pb0-f52.google.com with SMTP id ro2so1818693pbb.25 for ; Thu, 17 Jan 2013 21:07:08 -0800 (PST) In-reply-to: <28851.1358482040@alphaville> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: orgmode Nick Dokos writes: > Alan L Tyree wrote: > >> Since a recent ELPA update I get strange behavior when searching >> agenda files. >>=20 >> If the word searched for is NOT in the agenda files, everything works OK. >>=20 >> If the word IS in the agenda files, I get a blank Org Agenda buffer >> and a message: Wrong type argument: listp, t. >>=20 >> Is anyone else having this problem? If not where do I begin to fix it. >>=20 > > Get a backtrace and post it here. See sec. 1.4, "Feedback", of the > org manual to find out how to get a useful backtrace. > > Nick Thanks, Nick. Here are the details. Emacs version 24.2.1 on Debian Wheezy (with emacs24 from Sid) Org org-plus-contrib-20130114 I started emacs with the min org file as explained in Section 1.4 C-U M-X org-reload Loaded an agenda file addr.org and added to agenda M-x agenda s Enter a search term in the minibuffer that I know is in addr.org Obtain the following backtrace: Debugger entered--Lisp error: (wrong-type-argument listp t) memq(todo t) (or (eq org-agenda-show-inherited-tags (quote always)) (memq (quote todo)= org-agenda-show-inherited-tags) (and (eq org-agenda-show-inherited-tags t)= (or (eq org-agenda-use-tag-inheritance t) (memq (quote todo) org-agenda-us= e-tag-inheritance)))) (setq marker (org-agenda-new-marker (point)) category (org-get-category) = category-pos (get-text-property (point) (quote org-category-position)) inhe= rited-tags (or (eq org-agenda-show-inherited-tags (quote always)) (memq (qu= ote todo) org-agenda-show-inherited-tags) (and (eq org-agenda-show-inherite= d-tags t) (or (eq org-agenda-use-tag-inheritance t) (memq (quote todo) org-= agenda-use-tag-inheritance)))) tags (org-get-tags-at nil (not inherited-tag= s)) txt (org-agenda-format-item "" (buffer-substring-no-properties beg1 (po= int-at-eol)) category tags t)) (catch :skip (goto-char beg) (org-agenda-skip) (setq str (buffer-substrin= g-no-properties (point-at-bol) (if hdl-only (point-at-eol) end))) (mapc (la= mbda (wr) (when (string-match wr str) (goto-char (1- end)) (throw :skip t))= ) regexps-) (mapc (lambda (wr) (unless (string-match wr str) (goto-char (1-= end)) (throw :skip t))) (if todo-only (cons (concat "^*+[ ]+" org-not-don= e-regexp) regexps+) regexps+)) (goto-char beg) (setq marker (org-agenda-new= -marker (point)) category (org-get-category) category-pos (get-text-propert= y (point) (quote org-category-position)) inherited-tags (or (eq org-agenda-= show-inherited-tags (quote always)) (memq (quote todo) org-agenda-show-inhe= rited-tags) (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-u= se-tag-inheritance t) (memq (quote todo) org-agenda-use-tag-inheritance))))= tags (org-get-tags-at nil (not inherited-tags)) txt (org-agenda-format-ite= m "" (buffer-substring-no-properties beg1 (point-at-eol)) category tags t))= (org-add-props txt props (quote org-marker) marker (quote org-hd-marker) m= arker (quote org-todo-regexp) org-todo-regexp (quote org-complex-heading-re= gexp) org-complex-heading-regexp (quote priority) 1000 (quote org-category)= category (quote org-category-position) category-pos (quote type) "search")= (push txt ee) (goto-char (1- end))) (while (re-search-forward regexp nil t) (org-back-to-heading t) (skip-cha= rs-forward "* ") (setq beg (point-at-bol) beg1 (point) end (progn (outline-= next-heading) (point))) (catch :skip (goto-char beg) (org-agenda-skip) (set= q str (buffer-substring-no-properties (point-at-bol) (if hdl-only (point-at= -eol) end))) (mapc (lambda (wr) (when (string-match wr str) (goto-char (1- = end)) (throw :skip t))) regexps-) (mapc (lambda (wr) (unless (string-match = wr str) (goto-char (1- end)) (throw :skip t))) (if todo-only (cons (concat = "^*+[ ]+" org-not-done-regexp) regexps+) regexps+)) (goto-char beg) (setq = marker (org-agenda-new-marker (point)) category (org-get-category) category= -pos (get-text-property (point) (quote org-category-position)) inherited-ta= gs (or (eq org-agenda-show-inherited-tags (quote always)) (memq (quote todo= ) org-agenda-show-inherited-tags) (and (eq org-agenda-show-inherited-tags t= ) (or (eq org-agenda-use-tag-inheritance t) (memq (quote todo) org-agenda-u= se-tag-inheritance)))) tags (org-get-tags-at nil (not inherited-tags)) txt = (org-agenda-format-item "" (buffer-substring-no-properties beg1 (point-at-e= ol)) category tags t)) (org-add-props txt props (quote org-marker) marker (= quote org-hd-marker) marker (quote org-todo-regexp) org-todo-regexp (quote = org-complex-heading-regexp) org-complex-heading-regexp (quote priority) 100= 0 (quote org-category) category (quote org-category-position) category-pos = (quote type) "search") (push txt ee) (goto-char (1- end)))) (save-restriction (if org-agenda-restrict (narrow-to-region org-agenda-re= strict-begin org-agenda-restrict-end) (widen)) (goto-char (point-min)) (unl= ess (or (org-at-heading-p) (outline-next-heading)) (throw (quote nextfile) = t)) (goto-char (max (point-min) (1- (point)))) (while (re-search-forward re= gexp nil t) (org-back-to-heading t) (skip-chars-forward "* ") (setq beg (po= int-at-bol) beg1 (point) end (progn (outline-next-heading) (point))) (catch= :skip (goto-char beg) (org-agenda-skip) (setq str (buffer-substring-no-pro= perties (point-at-bol) (if hdl-only (point-at-eol) end))) (mapc (lambda (wr= ) (when (string-match wr str) (goto-char (1- end)) (throw :skip t))) regexp= s-) (mapc (lambda (wr) (unless (string-match wr str) (goto-char (1- end)) (= throw :skip t))) (if todo-only (cons (concat "^*+[ ]+" org-not-done-regexp= ) regexps+) regexps+)) (goto-char beg) (setq marker (org-agenda-new-marker = (point)) category (org-get-category) category-pos (get-text-property (point= ) (quote org-category-position)) inherited-tags (or (eq org-agenda-show-inh= erited-tags (quote always)) (memq (quote todo) org-agenda-show-inherited-ta= gs) (and (eq org-agenda-show-inherited-tags t) (or (eq org-agenda-use-tag-i= nheritance t) (memq ... org-agenda-use-tag-inheritance)))) tags (org-get-ta= gs-at nil (not inherited-tags)) txt (org-agenda-format-item "" (buffer-subs= tring-no-properties beg1 (point-at-eol)) category tags t)) (org-add-props t= xt props (quote org-marker) marker (quote org-hd-marker) marker (quote org-= todo-regexp) org-todo-regexp (quote org-complex-heading-regexp) org-complex= -heading-regexp (quote priority) 1000 (quote org-category) category (quote = org-category-position) category-pos (quote type) "search") (push txt ee) (g= oto-char (1- end))))) (save-excursion (save-restriction (if org-agenda-restrict (narrow-to-regi= on org-agenda-restrict-begin org-agenda-restrict-end) (widen)) (goto-char (= point-min)) (unless (or (org-at-heading-p) (outline-next-heading)) (throw (= quote nextfile) t)) (goto-char (max (point-min) (1- (point)))) (while (re-s= earch-forward regexp nil t) (org-back-to-heading t) (skip-chars-forward "* = ") (setq beg (point-at-bol) beg1 (point) end (progn (outline-next-heading) = (point))) (catch :skip (goto-char beg) (org-agenda-skip) (setq str (buffer-= substring-no-properties (point-at-bol) (if hdl-only (point-at-eol) end))) (= mapc (lambda (wr) (when (string-match wr str) (goto-char ...) (throw :skip = t))) regexps-) (mapc (lambda (wr) (unless (string-match wr str) (goto-char = ...) (throw :skip t))) (if todo-only (cons (concat "^*+[ ]+" org-not-done-= regexp) regexps+) regexps+)) (goto-char beg) (setq marker (org-agenda-new-m= arker (point)) category (org-get-category) category-pos (get-text-property = (point) (quote org-category-position)) inherited-tags (or (eq org-agenda-sh= ow-inherited-tags (quote always)) (memq (quote todo) org-agenda-show-inheri= ted-tags) (and (eq org-agenda-show-inherited-tags t) (or ... ...))) tags (o= rg-get-tags-at nil (not inherited-tags)) txt (org-agenda-format-item "" (bu= ffer-substring-no-properties beg1 (point-at-eol)) category tags t)) (org-ad= d-props txt props (quote org-marker) marker (quote org-hd-marker) marker (q= uote org-todo-regexp) org-todo-regexp (quote org-complex-heading-regexp) or= g-complex-heading-regexp (quote priority) 1000 (quote org-category) categor= y (quote org-category-position) category-pos (quote type) "search") (push t= xt ee) (goto-char (1- end)))))) (let ((case-fold-search t)) (save-excursion (save-restriction (if org-age= nda-restrict (narrow-to-region org-agenda-restrict-begin org-agenda-restric= t-end) (widen)) (goto-char (point-min)) (unless (or (org-at-heading-p) (out= line-next-heading)) (throw (quote nextfile) t)) (goto-char (max (point-min)= (1- (point)))) (while (re-search-forward regexp nil t) (org-back-to-headin= g t) (skip-chars-forward "* ") (setq beg (point-at-bol) beg1 (point) end (p= rogn (outline-next-heading) (point))) (catch :skip (goto-char beg) (org-age= nda-skip) (setq str (buffer-substring-no-properties (point-at-bol) (if hdl-= only ... end))) (mapc (lambda (wr) (when ... ... ...)) regexps-) (mapc (lam= bda (wr) (unless ... ... ...)) (if todo-only (cons ... regexps+) regexps+))= (goto-char beg) (setq marker (org-agenda-new-marker (point)) category (org= -get-category) category-pos (get-text-property (point) (quote org-category-= position)) inherited-tags (or (eq org-agenda-show-inherited-tags ...) (memq= ... org-agenda-show-inherited-tags) (and ... ...)) tags (org-get-tags-at n= il (not inherited-tags)) txt (org-agenda-format-item "" (buffer-substring-n= o-properties beg1 ...) category tags t)) (org-add-props txt props (quote or= g-marker) marker (quote org-hd-marker) marker (quote org-todo-regexp) org-t= odo-regexp (quote org-complex-heading-regexp) org-complex-heading-regexp (q= uote priority) 1000 (quote org-category) category (quote org-category-posit= ion) category-pos (quote type) "search") (push txt ee) (goto-char (1- end))= ))))) (progn (set-syntax-table (org-search-syntax-table)) (unless (derived-mode= -p (quote org-mode)) (error "Agenda file %s is not in `org-mode'" file)) (l= et ((case-fold-search t)) (save-excursion (save-restriction (if org-agenda-= restrict (narrow-to-region org-agenda-restrict-begin org-agenda-restrict-en= d) (widen)) (goto-char (point-min)) (unless (or (org-at-heading-p) (outline= -next-heading)) (throw (quote nextfile) t)) (goto-char (max (point-min) (1-= (point)))) (while (re-search-forward regexp nil t) (org-back-to-heading t)= (skip-chars-forward "* ") (setq beg (point-at-bol) beg1 (point) end (progn= (outline-next-heading) (point))) (catch :skip (goto-char beg) (org-agenda-= skip) (setq str (buffer-substring-no-properties ... ...)) (mapc (lambda ...= ...) regexps-) (mapc (lambda ... ...) (if todo-only ... regexps+)) (goto-c= har beg) (setq marker (org-agenda-new-marker ...) category (org-get-categor= y) category-pos (get-text-property ... ...) inherited-tags (or ... ... ...)= tags (org-get-tags-at nil ...) txt (org-agenda-format-item "" ... category= tags t)) (org-add-props txt props (quote org-marker) marker (quote org-hd-= marker) marker (quote org-todo-regexp) org-todo-regexp (quote org-complex-h= eading-regexp) org-complex-heading-regexp (quote priority) 1000 (quote org-= category) category (quote org-category-position) category-pos (quote type) = "search") (push txt ee) (goto-char (1- end)))))))) (unwind-protect (progn (set-syntax-table (org-search-syntax-table)) (unle= ss (derived-mode-p (quote org-mode)) (error "Agenda file %s is not in `org-= mode'" file)) (let ((case-fold-search t)) (save-excursion (save-restriction= (if org-agenda-restrict (narrow-to-region org-agenda-restrict-begin org-ag= enda-restrict-end) (widen)) (goto-char (point-min)) (unless (or (org-at-hea= ding-p) (outline-next-heading)) (throw (quote nextfile) t)) (goto-char (max= (point-min) (1- ...))) (while (re-search-forward regexp nil t) (org-back-t= o-heading t) (skip-chars-forward "* ") (setq beg (point-at-bol) beg1 (point= ) end (progn ... ...)) (catch :skip (goto-char beg) (org-agenda-skip) (setq= str ...) (mapc ... regexps-) (mapc ... ...) (goto-char beg) (setq marker .= .. category ... category-pos ... inherited-tags ... tags ... txt ...) (org-= add-props txt props ... marker ... marker ... org-todo-regexp ... org-compl= ex-heading-regexp ... 1000 ... category ... category-pos ... "search") (pus= h txt ee) (goto-char ...))))))) (save-current-buffer (set-buffer buffer) (s= et-syntax-table table))) (let ((table (syntax-table)) (buffer (current-buffer))) (unwind-protect (= progn (set-syntax-table (org-search-syntax-table)) (unless (derived-mode-p = (quote org-mode)) (error "Agenda file %s is not in `org-mode'" file)) (let = ((case-fold-search t)) (save-excursion (save-restriction (if org-agenda-res= trict (narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end) = (widen)) (goto-char (point-min)) (unless (or ... ...) (throw ... t)) (goto-= char (max ... ...)) (while (re-search-forward regexp nil t) (org-back-to-he= ading t) (skip-chars-forward "* ") (setq beg ... beg1 ... end ...) (catch := skip ... ... ... ... ... ... ... ... ... ...)))))) (save-current-buffer (se= t-buffer buffer) (set-syntax-table table)))) (with-syntax-table (org-search-syntax-table) (unless (derived-mode-p (quo= te org-mode)) (error "Agenda file %s is not in `org-mode'" file)) (let ((ca= se-fold-search t)) (save-excursion (save-restriction (if org-agenda-restric= t (narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end) (wid= en)) (goto-char (point-min)) (unless (or (org-at-heading-p) (outline-next-h= eading)) (throw (quote nextfile) t)) (goto-char (max (point-min) (1- (point= )))) (while (re-search-forward regexp nil t) (org-back-to-heading t) (skip-= chars-forward "* ") (setq beg (point-at-bol) beg1 (point) end (progn (outli= ne-next-heading) (point))) (catch :skip (goto-char beg) (org-agenda-skip) (= setq str (buffer-substring-no-properties ... ...)) (mapc (lambda ... ...) r= egexps-) (mapc (lambda ... ...) (if todo-only ... regexps+)) (goto-char beg= ) (setq marker (org-agenda-new-marker ...) category (org-get-category) cate= gory-pos (get-text-property ... ...) inherited-tags (or ... ... ...) tags (= org-get-tags-at nil ...) txt (org-agenda-format-item "" ... category tags t= )) (org-add-props txt props (quote org-marker) marker (quote org-hd-marker)= marker (quote org-todo-regexp) org-todo-regexp (quote org-complex-heading-= regexp) org-complex-heading-regexp (quote priority) 1000 (quote org-categor= y) category (quote org-category-position) category-pos (quote type) "search= ") (push txt ee) (goto-char (1- end)))))))) (save-current-buffer (set-buffer buffer) (with-syntax-table (org-search-s= yntax-table) (unless (derived-mode-p (quote org-mode)) (error "Agenda file = %s is not in `org-mode'" file)) (let ((case-fold-search t)) (save-excursion= (save-restriction (if org-agenda-restrict (narrow-to-region org-agenda-res= trict-begin org-agenda-restrict-end) (widen)) (goto-char (point-min)) (unle= ss (or (org-at-heading-p) (outline-next-heading)) (throw (quote nextfile) t= )) (goto-char (max (point-min) (1- ...))) (while (re-search-forward regexp = nil t) (org-back-to-heading t) (skip-chars-forward "* ") (setq beg (point-a= t-bol) beg1 (point) end (progn ... ...)) (catch :skip (goto-char beg) (org-= agenda-skip) (setq str ...) (mapc ... regexps-) (mapc ... ...) (goto-char b= eg) (setq marker ... category ... category-pos ... inherited-tags ... tags = ... txt ...) (org-add-props txt props ... marker ... marker ... org-todo-re= gexp ... org-complex-heading-regexp ... 1000 ... category ... category-pos = ... "search") (push txt ee) (goto-char ...)))))))) (with-current-buffer buffer (with-syntax-table (org-search-syntax-table) = (unless (derived-mode-p (quote org-mode)) (error "Agenda file %s is not in = `org-mode'" file)) (let ((case-fold-search t)) (save-excursion (save-restri= ction (if org-agenda-restrict (narrow-to-region org-agenda-restrict-begin o= rg-agenda-restrict-end) (widen)) (goto-char (point-min)) (unless (or (org-a= t-heading-p) (outline-next-heading)) (throw (quote nextfile) t)) (goto-char= (max (point-min) (1- ...))) (while (re-search-forward regexp nil t) (org-b= ack-to-heading t) (skip-chars-forward "* ") (setq beg (point-at-bol) beg1 (= point) end (progn ... ...)) (catch :skip (goto-char beg) (org-agenda-skip) = (setq str ...) (mapc ... regexps-) (mapc ... ...) (goto-char beg) (setq mar= ker ... category ... category-pos ... inherited-tags ... tags ... txt ...) = (org-add-props txt props ... marker ... marker ... org-todo-regexp ... org-= complex-heading-regexp ... 1000 ... category ... category-pos ... "search")= (push txt ee) (goto-char ...)))))))) (catch (quote nextfile) (org-check-agenda-file file) (setq buffer (if (fi= le-exists-p file) (org-get-agenda-file-buffer file) (error "No such file %s= " file))) (if (not buffer) (setq rtn (list (format "ORG-AGENDA-ERROR: No su= ch org-file %s" file)))) (with-current-buffer buffer (with-syntax-table (or= g-search-syntax-table) (unless (derived-mode-p (quote org-mode)) (error "Ag= enda file %s is not in `org-mode'" file)) (let ((case-fold-search t)) (save= -excursion (save-restriction (if org-agenda-restrict (narrow-to-region org-= agenda-restrict-begin org-agenda-restrict-end) (widen)) (goto-char (point-m= in)) (unless (or ... ...) (throw ... t)) (goto-char (max ... ...)) (while (= re-search-forward regexp nil t) (org-back-to-heading t) (skip-chars-forward= "* ") (setq beg ... beg1 ... end ...) (catch :skip ... ... ... ... ... ...= ... ... ... ...)))))))) (while (setq file (pop files)) (setq ee nil) (catch (quote nextfile) (org= -check-agenda-file file) (setq buffer (if (file-exists-p file) (org-get-age= nda-file-buffer file) (error "No such file %s" file))) (if (not buffer) (se= tq rtn (list (format "ORG-AGENDA-ERROR: No such org-file %s" file)))) (with= -current-buffer buffer (with-syntax-table (org-search-syntax-table) (unless= (derived-mode-p (quote org-mode)) (error "Agenda file %s is not in `org-mo= de'" file)) (let ((case-fold-search t)) (save-excursion (save-restriction (= if org-agenda-restrict ... ...) (goto-char ...) (unless ... ...) (goto-char= ...) (while ... ... ... ... ...))))))) (setq rtn (nreverse ee)) (setq rtna= ll (append rtnall rtn))) (catch (quote exit) (if org-agenda-sticky (setq org-agenda-buffer-name (i= f (stringp string) (format "*Org Agenda(%s:%s)*" (or org-keys (or (and todo= -only "S") "s")) string) (format "*Org Agenda(%s)*" (or (and todo-only "S")= "s"))))) (org-agenda-prepare "SEARCH") (org-compile-prefix-format (quote s= earch)) (org-set-sorting-strategy (quote search)) (setq org-agenda-redo-com= mand (list (quote org-search-view) (if todo-only t nil) (list (quote if) (q= uote current-prefix-arg) nil string))) (setq org-agenda-query-string string= ) (if (equal (string-to-char string) 42) (setq hdl-only t words (substring = string 1)) (setq words string)) (when (equal (string-to-char words) 33) (se= tq todo-only t words (substring words 1))) (when (equal (string-to-char wor= ds) 58) (setq full-words t words (substring words 1))) (if (or org-agenda-s= earch-view-always-boolean (member (string-to-char words) (quote (45 43 123)= ))) (setq boolean t)) (setq words (org-split-string words)) (let (www w) (w= hile (setq w (pop words)) (while (and (string-match "\\\\\\'" w) words) (se= tq w (concat (substring w 0 -1) " " (pop words)))) (push w www)) (setq word= s (nreverse www) www nil) (while (setq w (pop words)) (when (and (string-ma= tch "\\`[-+]?{" w) (not (string-match "}\\'" w))) (while (and words (not (s= tring-match "}\\'" ...))) (setq w (concat w " " (pop words)))) (setq w (con= cat w " " (pop words)))) (push w www)) (setq words (nreverse www))) (setq o= rg-agenda-last-search-view-search-was-boolean boolean) (when boolean (let (= wds w) (while (setq w (pop words)) (if (or (equal (substring w 0 1) "\"") (= and (> ... 1) (member ... ...) (equal ... "\""))) (while (and words (not ..= .)) (setq w (concat w " " ...)))) (and (string-match "\\`\\([-+]?\\)\"" w) = (setq w (replace-match "\\1" nil nil w))) (and (equal (substring w -1) "\""= ) (setq w (substring w 0 -1))) (push w wds)) (setq words (nreverse wds)))) = (if boolean (mapc (lambda (w) (setq c (string-to-char w)) (if (equal c 45) = (setq neg t w (substring w 1)) (if (equal c 43) (setq neg nil w (substring = w 1)) (setq neg nil))) (if (string-match "\\`{.*}\\'" w) (setq re (substrin= g w 1 -1)) (if full-words (setq re (concat "\\<" ... "\\>")) (setq re (rege= xp-quote ...)))) (if neg (push re regexps-) (push re regexps+))) words) (pu= sh (mapconcat (lambda (w) (regexp-quote w)) words "\\s-+") regexps+)) (setq= regexps+ (sort regexps+ (lambda (a b) (> (length a) (length b))))) (if (no= t regexps+) (setq regexp org-outline-regexp-bol) (setq regexp (pop regexps+= )) (if hdl-only (setq regexp (concat org-outline-regexp-bol ".*?" regexp)))= ) (setq files (org-agenda-files nil (quote ifmode))) (when (eq (car org-age= nda-text-search-extra-files) (quote agenda-archives)) (pop org-agenda-text-= search-extra-files) (setq files (org-add-archive-files files))) (setq files= (append files org-agenda-text-search-extra-files) rtnall nil) (while (setq= file (pop files)) (setq ee nil) (catch (quote nextfile) (org-check-agenda-= file file) (setq buffer (if (file-exists-p file) (org-get-agenda-file-buffe= r file) (error "No such file %s" file))) (if (not buffer) (setq rtn (list (= format "ORG-AGENDA-ERROR: No such org-file %s" file)))) (with-current-buffe= r buffer (with-syntax-table (org-search-syntax-table) (unless (derived-mode= -p (quote org-mode)) (error "Agenda file %s is not in `org-mode'" file)) (l= et ((case-fold-search t)) (save-excursion (save-restriction ... ... ... ...= ...)))))) (setq rtn (nreverse ee)) (setq rtnall (append rtnall rtn))) (if = org-agenda-overriding-header (insert (org-add-props (copy-sequence org-agen= da-overriding-header) nil (quote face) (quote org-agenda-structure)) "\n") = (insert "Search words: ") (add-text-properties (point-min) (1- (point)) (li= st (quote face) (quote org-agenda-structure))) (setq pos (point)) (insert s= tring "\n") (add-text-properties pos (1- (point)) (list (quote face) (quote= org-warning))) (setq pos (point)) (unless org-agenda-multi (insert "Press = `[', `]' to add/sub word, `{', `}' to add/sub regexp, `C-u r' to edit\n") (= add-text-properties pos (1- (point)) (list (quote face) (quote org-agenda-s= tructure))))) (org-agenda-mark-header-line (point-min)) (when rtnall (inser= t (org-agenda-finalize-entries rtnall) "\n")) (goto-char (point-min)) (or o= rg-agenda-multi (org-agenda-fit-window-to-buffer)) (add-text-properties (po= int-min) (point-max) (\` (org-agenda-type search org-last-args ((\, todo-on= ly) (\, string) (\, edit-at)) org-redo-cmd (\, org-agenda-redo-command) org= -series-cmd (\, org-cmd)))) (org-agenda-finalize) (setq buffer-read-only t)) (let* ((props (list (quote face) nil (quote done-face) (quote org-agenda-= done) (quote org-not-done-regexp) org-not-done-regexp (quote org-todo-regex= p) org-todo-regexp (quote org-complex-heading-regexp) org-complex-heading-r= egexp (quote mouse-face) (quote highlight) (quote help-echo) (format "mouse= -2 or RET jump to location"))) (full-words org-agenda-search-view-force-ful= l-words) (org-agenda-text-search-extra-files org-agenda-text-search-extra-f= iles) regexp rtn rtnall files file pos inherited-tags marker category categ= ory-pos tags c neg re boolean ee txt beg end words regexps+ regexps- hdl-on= ly buffer beg1 str) (unless (and (not edit-at) (stringp string) (string-mat= ch "\\S-" string)) (setq string (read-string (if org-agenda-search-view-alw= ays-boolean "[+-]Word/{Regexp} ...: " "Phrase or [+-]Word/{Regexp} ...: ") = (cond ((integerp edit-at) (cons string edit-at)) (edit-at string)) (quote o= rg-agenda-search-history)))) (catch (quote exit) (if org-agenda-sticky (set= q org-agenda-buffer-name (if (stringp string) (format "*Org Agenda(%s:%s)*"= (or org-keys (or ... "s")) string) (format "*Org Agenda(%s)*" (or (and tod= o-only "S") "s"))))) (org-agenda-prepare "SEARCH") (org-compile-prefix-form= at (quote search)) (org-set-sorting-strategy (quote search)) (setq org-agen= da-redo-command (list (quote org-search-view) (if todo-only t nil) (list (q= uote if) (quote current-prefix-arg) nil string))) (setq org-agenda-query-st= ring string) (if (equal (string-to-char string) 42) (setq hdl-only t words = (substring string 1)) (setq words string)) (when (equal (string-to-char wor= ds) 33) (setq todo-only t words (substring words 1))) (when (equal (string-= to-char words) 58) (setq full-words t words (substring words 1))) (if (or o= rg-agenda-search-view-always-boolean (member (string-to-char words) (quote = (45 43 123)))) (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 wo= rds (not ...)) (setq w (concat w " " ...))) (setq w (concat w " " (pop word= s)))) (push w www)) (setq words (nreverse www))) (setq org-agenda-last-sear= ch-view-search-was-boolean boolean) (when boolean (let (wds w) (while (setq= w (pop words)) (if (or (equal ... "\"") (and ... ... ...)) (while (and wor= ds ...) (setq w ...))) (and (string-match "\\`\\([-+]?\\)\"" w) (setq w (re= place-match "\\1" nil nil w))) (and (equal (substring w -1) "\"") (setq w (= substring w 0 -1))) (push w wds)) (setq words (nreverse wds)))) (if boolean= (mapc (lambda (w) (setq c (string-to-char w)) (if (equal c 45) (setq neg t= w (substring w 1)) (if (equal c 43) (setq neg nil w ...) (setq neg nil))) = (if (string-match "\\`{.*}\\'" w) (setq re (substring w 1 -1)) (if full-wor= ds (setq re ...) (setq re ...))) (if neg (push re regexps-) (push re regexp= s+))) words) (push (mapconcat (lambda (w) (regexp-quote w)) words "\\s-+") = regexps+)) (setq regexps+ (sort regexps+ (lambda (a b) (> (length a) (lengt= h b))))) (if (not regexps+) (setq regexp org-outline-regexp-bol) (setq rege= xp (pop regexps+)) (if hdl-only (setq regexp (concat org-outline-regexp-bol= ".*?" regexp)))) (setq files (org-agenda-files nil (quote ifmode))) (when = (eq (car org-agenda-text-search-extra-files) (quote agenda-archives)) (pop = org-agenda-text-search-extra-files) (setq files (org-add-archive-files file= s))) (setq files (append files org-agenda-text-search-extra-files) rtnall n= il) (while (setq file (pop files)) (setq ee nil) (catch (quote nextfile) (o= rg-check-agenda-file file) (setq buffer (if (file-exists-p file) (org-get-a= genda-file-buffer file) (error "No such file %s" file))) (if (not buffer) (= setq rtn (list (format "ORG-AGENDA-ERROR: No such org-file %s" file)))) (wi= th-current-buffer buffer (with-syntax-table (org-search-syntax-table) (unle= ss (derived-mode-p ...) (error "Agenda file %s is not in `org-mode'" file))= (let (...) (save-excursion ...))))) (setq rtn (nreverse ee)) (setq rtnall = (append rtnall rtn))) (if org-agenda-overriding-header (insert (org-add-pro= ps (copy-sequence org-agenda-overriding-header) nil (quote face) (quote org= -agenda-structure)) "\n") (insert "Search words: ") (add-text-properties (p= oint-min) (1- (point)) (list (quote face) (quote org-agenda-structure))) (s= etq pos (point)) (insert string "\n") (add-text-properties pos (1- (point))= (list (quote face) (quote org-warning))) (setq pos (point)) (unless org-ag= enda-multi (insert "Press `[', `]' to add/sub word, `{', `}' to add/sub reg= exp, `C-u r' to edit\n") (add-text-properties pos (1- (point)) (list (quote= face) (quote org-agenda-structure))))) (org-agenda-mark-header-line (point= -min)) (when rtnall (insert (org-agenda-finalize-entries rtnall) "\n")) (go= to-char (point-min)) (or org-agenda-multi (org-agenda-fit-window-to-buffer)= ) (add-text-properties (point-min) (point-max) (\` (org-agenda-type search = org-last-args ((\, todo-only) (\, string) (\, edit-at)) org-redo-cmd (\, or= g-agenda-redo-command) org-series-cmd (\, org-cmd)))) (org-agenda-finalize)= (setq buffer-read-only t))) org-search-view(nil) call-interactively(org-search-view) (cond ((setq entry (assoc org-keys org-agenda-custom-commands)) (if (or (= symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (setq type (nth 2 = entry) org-match (eval (nth 3 entry)) lprops (nth 4 entry)) (if org-agenda-= sticky (setq org-agenda-buffer-name (or (and ... ...) (format "*Org Agenda(= %s)*" org-keys)))) (put (quote org-agenda-redo-command) (quote org-lprops) = lprops) (cond ((eq type (quote agenda)) (org-let lprops (quote ...))) ((eq = type (quote alltodo)) (org-let lprops (quote ...))) ((eq type (quote search= )) (org-let lprops (quote ...))) ((eq type (quote stuck)) (org-let lprops (= quote ...))) ((eq type (quote tags)) (org-let lprops (quote ...))) ((eq typ= e (quote tags-todo)) (org-let lprops (quote ...))) ((eq type (quote todo)) = (org-let lprops (quote ...))) ((eq type (quote tags-tree)) (org-check-for-o= rg-mode) (org-let lprops (quote ...))) ((eq type (quote todo-tree)) (org-ch= eck-for-org-mode) (org-let lprops (quote ...))) ((eq type (quote occur-tree= )) (org-check-for-org-mode) (org-let lprops (quote ...))) ((functionp type)= (org-let lprops (quote ...))) ((fboundp type) (org-let lprops (quote ...))= ) (t (error "Invalid custom agenda command type %s" type)))) (org-agenda-ru= n-series (nth 1 entry) (cddr entry)))) ((equal org-keys "C") (setq org-agen= da-custom-commands org-agenda-custom-commands-orig) (customize-variable (qu= ote org-agenda-custom-commands))) ((equal org-keys "a") (call-interactively= (quote org-agenda-list))) ((equal org-keys "s") (call-interactively (quote= org-search-view))) ((equal org-keys "S") (org-call-with-arg (quote org-sea= rch-view) (or arg (quote (4))))) ((equal org-keys "t") (call-interactively = (quote org-todo-list))) ((equal org-keys "T") (org-call-with-arg (quote org= -todo-list) (or arg (quote (4))))) ((equal org-keys "m") (call-interactivel= y (quote org-tags-view))) ((equal org-keys "M") (org-call-with-arg (quote o= rg-tags-view) (or arg (quote (4))))) ((equal org-keys "e") (call-interactiv= ely (quote org-store-agenda-views))) ((equal org-keys "?") (org-tags-view n= il "+FLAGGED") (org-add-hook (quote post-command-hook) (lambda nil (unless = (current-message) (let* ((m ...) (note ...)) (when note (message ...))))) t= t)) ((equal org-keys "L") (unless (derived-mode-p (quote org-mode)) (error= "This is not an Org-mode file")) (unless restriction (put (quote org-agend= a-files) (quote org-restrict) (list bfn)) (org-call-with-arg (quote org-tim= eline) arg))) ((equal org-keys "#") (call-interactively (quote org-agenda-l= ist-stuck-projects))) ((equal org-keys "/") (call-interactively (quote org-= occur-in-agenda-files))) ((equal org-keys "!") (customize-variable (quote o= rg-stuck-projects))) (t (error "Invalid agenda key"))) (let* ((prefix-descriptions nil) (org-agenda-buffer-name org-agenda-buffe= r-name) (org-agenda-window-setup (if (equal (buffer-name) org-agenda-buffer= -name) (quote current-window) org-agenda-window-setup)) (org-agenda-custom-= commands-orig org-agenda-custom-commands) (org-agenda-custom-commands (delq= nil (mapcar (lambda (x) (cond (... ... nil) (... x) (... ...) (t ...))) or= g-agenda-custom-commands))) (org-agenda-custom-commands (org-contextualize-= keys org-agenda-custom-commands org-agenda-custom-commands-contexts)) (buf = (current-buffer)) (bfn (buffer-file-name (buffer-base-buffer))) entry key t= ype org-match lprops ans) (unless org-agenda-overriding-restriction (unless= (org-bound-and-true-p org-agenda-keep-restricted-file-list) (put (quote or= g-agenda-files) (quote org-restrict) nil)) (setq org-agenda-restrict nil) (= move-marker org-agenda-restrict-begin nil) (move-marker org-agenda-restrict= -end nil)) (put (quote org-agenda-redo-command) (quote org-lprops) nil) (pu= t (quote org-agenda-redo-command) (quote last-args) nil) (setq org-agenda-l= ast-dispatch-buffer (current-buffer)) (unless org-keys (setq ans (org-agend= a-get-restriction-and-command prefix-descriptions) org-keys (car ans) restr= iction (cdr ans))) (if org-agenda-sticky (setq org-agenda-buffer-name (form= at "*Org Agenda(%s)*" org-keys))) (when (and (not org-agenda-overriding-res= triction) restriction) (put (quote org-agenda-files) (quote org-restrict) (= list bfn)) (cond ((eq restriction (quote region)) (setq org-agenda-restrict= t) (move-marker org-agenda-restrict-begin (region-beginning)) (move-marker= org-agenda-restrict-end (region-end))) ((eq restriction (quote subtree)) (= save-excursion (setq org-agenda-restrict t) (org-back-to-heading t) (move-m= arker org-agenda-restrict-begin (point)) (move-marker org-agenda-restrict-e= nd (progn (org-end-of-subtree t))))))) (cond ((setq entry (assoc org-keys o= rg-agenda-custom-commands)) (if (or (symbolp (nth 2 entry)) (functionp (nth= 2 entry))) (progn (setq type (nth 2 entry) org-match (eval (nth 3 entry)) = lprops (nth 4 entry)) (if org-agenda-sticky (setq org-agenda-buffer-name (o= r ... ...))) (put (quote org-agenda-redo-command) (quote org-lprops) lprops= ) (cond ((eq type ...) (org-let lprops ...)) ((eq type ...) (org-let lprops= ...)) ((eq type ...) (org-let lprops ...)) ((eq type ...) (org-let lprops = ...)) ((eq type ...) (org-let lprops ...)) ((eq type ...) (org-let lprops .= ..)) ((eq type ...) (org-let lprops ...)) ((eq type ...) (org-check-for-org= -mode) (org-let lprops ...)) ((eq type ...) (org-check-for-org-mode) (org-l= et lprops ...)) ((eq type ...) (org-check-for-org-mode) (org-let lprops ...= )) ((functionp type) (org-let lprops ...)) ((fboundp type) (org-let lprops = ...)) (t (error "Invalid custom agenda command type %s" type)))) (org-agend= a-run-series (nth 1 entry) (cddr entry)))) ((equal org-keys "C") (setq org-= agenda-custom-commands org-agenda-custom-commands-orig) (customize-variable= (quote org-agenda-custom-commands))) ((equal org-keys "a") (call-interacti= vely (quote org-agenda-list))) ((equal org-keys "s") (call-interactively (q= uote org-search-view))) ((equal org-keys "S") (org-call-with-arg (quote org= -search-view) (or arg (quote (4))))) ((equal org-keys "t") (call-interactiv= ely (quote org-todo-list))) ((equal org-keys "T") (org-call-with-arg (quote= org-todo-list) (or arg (quote (4))))) ((equal org-keys "m") (call-interact= ively (quote org-tags-view))) ((equal org-keys "M") (org-call-with-arg (quo= te org-tags-view) (or arg (quote (4))))) ((equal org-keys "e") (call-intera= ctively (quote org-store-agenda-views))) ((equal org-keys "?") (org-tags-vi= ew nil "+FLAGGED") (org-add-hook (quote post-command-hook) (lambda nil (unl= ess (current-message) (let* (... ...) (when note ...)))) t t)) ((equal org-= keys "L") (unless (derived-mode-p (quote org-mode)) (error "This is not an = Org-mode file")) (unless restriction (put (quote org-agenda-files) (quote o= rg-restrict) (list bfn)) (org-call-with-arg (quote org-timeline) arg))) ((e= qual org-keys "#") (call-interactively (quote org-agenda-list-stuck-project= s))) ((equal org-keys "/") (call-interactively (quote org-occur-in-agenda-f= iles))) ((equal org-keys "!") (customize-variable (quote org-stuck-projects= ))) (t (error "Invalid agenda key")))) (catch (quote exit) (let* ((prefix-descriptions nil) (org-agenda-buffer-n= ame org-agenda-buffer-name) (org-agenda-window-setup (if (equal (buffer-nam= e) org-agenda-buffer-name) (quote current-window) org-agenda-window-setup))= (org-agenda-custom-commands-orig org-agenda-custom-commands) (org-agenda-c= ustom-commands (delq nil (mapcar (lambda (x) (cond ... ... ... ...)) org-ag= enda-custom-commands))) (org-agenda-custom-commands (org-contextualize-keys= org-agenda-custom-commands org-agenda-custom-commands-contexts)) (buf (cur= rent-buffer)) (bfn (buffer-file-name (buffer-base-buffer))) entry key type = org-match lprops ans) (unless org-agenda-overriding-restriction (unless (or= g-bound-and-true-p org-agenda-keep-restricted-file-list) (put (quote org-ag= enda-files) (quote org-restrict) nil)) (setq org-agenda-restrict nil) (move= -marker org-agenda-restrict-begin nil) (move-marker org-agenda-restrict-end= nil)) (put (quote org-agenda-redo-command) (quote org-lprops) nil) (put (q= uote org-agenda-redo-command) (quote last-args) nil) (setq org-agenda-last-= dispatch-buffer (current-buffer)) (unless org-keys (setq ans (org-agenda-ge= t-restriction-and-command prefix-descriptions) org-keys (car ans) restricti= on (cdr ans))) (if org-agenda-sticky (setq org-agenda-buffer-name (format "= *Org Agenda(%s)*" org-keys))) (when (and (not org-agenda-overriding-restric= tion) restriction) (put (quote org-agenda-files) (quote org-restrict) (list= bfn)) (cond ((eq restriction (quote region)) (setq org-agenda-restrict t) = (move-marker org-agenda-restrict-begin (region-beginning)) (move-marker org= -agenda-restrict-end (region-end))) ((eq restriction (quote subtree)) (save= -excursion (setq org-agenda-restrict t) (org-back-to-heading t) (move-marke= r org-agenda-restrict-begin (point)) (move-marker org-agenda-restrict-end (= progn ...)))))) (cond ((setq entry (assoc org-keys org-agenda-custom-comman= ds)) (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry))) (progn (set= q type (nth 2 entry) org-match (eval ...) lprops (nth 4 entry)) (if org-age= nda-sticky (setq org-agenda-buffer-name ...)) (put (quote org-agenda-redo-c= ommand) (quote org-lprops) lprops) (cond (... ...) (... ...) (... ...) (...= ...) (... ...) (... ...) (... ...) (... ... ...) (... ... ...) (... ... ..= .) (... ...) (... ...) (t ...))) (org-agenda-run-series (nth 1 entry) (cddr= entry)))) ((equal org-keys "C") (setq org-agenda-custom-commands org-agend= a-custom-commands-orig) (customize-variable (quote org-agenda-custom-comman= ds))) ((equal org-keys "a") (call-interactively (quote org-agenda-list))) (= (equal org-keys "s") (call-interactively (quote org-search-view))) ((equal = org-keys "S") (org-call-with-arg (quote org-search-view) (or arg (quote (4)= )))) ((equal org-keys "t") (call-interactively (quote org-todo-list))) ((eq= ual org-keys "T") (org-call-with-arg (quote org-todo-list) (or arg (quote (= 4))))) ((equal org-keys "m") (call-interactively (quote org-tags-view))) ((= equal org-keys "M") (org-call-with-arg (quote org-tags-view) (or arg (quote= (4))))) ((equal org-keys "e") (call-interactively (quote org-store-agenda-= views))) ((equal org-keys "?") (org-tags-view nil "+FLAGGED") (org-add-hook= (quote post-command-hook) (lambda nil (unless (current-message) (let* ... = ...))) t t)) ((equal org-keys "L") (unless (derived-mode-p (quote org-mode)= ) (error "This is not an Org-mode file")) (unless restriction (put (quote o= rg-agenda-files) (quote org-restrict) (list bfn)) (org-call-with-arg (quote= org-timeline) arg))) ((equal org-keys "#") (call-interactively (quote org-= agenda-list-stuck-projects))) ((equal org-keys "/") (call-interactively (qu= ote org-occur-in-agenda-files))) ((equal org-keys "!") (customize-variable = (quote org-stuck-projects))) (t (error "Invalid agenda key"))))) org-agenda(nil) call-interactively(org-agenda t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) Note: following the same procedure except without loading the min-org.el file: org version 7.8.11 The search works as expected. Thanks for any help. Alan --=20 Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:172385@iptel.org