From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: org-scan-tags Date: Thu, 03 Feb 2011 00:17:11 +0100 Message-ID: <87lj1y6n7s.fsf@altern.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=52723 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pklwl-0007uB-NR for emacs-orgmode@gnu.org; Wed, 02 Feb 2011 18:17:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pklwk-0008RU-Tx for emacs-orgmode@gnu.org; Wed, 02 Feb 2011 18:17:11 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:53706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pklwk-0008RK-PV for emacs-orgmode@gnu.org; Wed, 02 Feb 2011 18:17:10 -0500 Received: by wyj26 with SMTP id 26so538206wyj.0 for ; Wed, 02 Feb 2011 15:17:09 -0800 (PST) In-Reply-To: (Ilya Shlyakhter's message of "Tue, 14 Sep 2010 23:19:21 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ilya Shlyakhter Cc: emacs-orgmode Hi Ilya, Ilya Shlyakhter writes: > In org-scan-tags, if todo-only is t, would it be possible to speed > things up by changingthe regexp go to just the lines with a TODO > keyword? > I.e. in > > (let* ((re (concat "^" outline-regexp " *\\(\\<\\(" > (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") > (org-re > "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$"))) > > remove the first "?" if todo-only is t. Also, regexp-opt might make > a more efficient regexp than mapconcat with regexp-quote. I've optimized org-scan-tags a bit following your ideas (gaining ~12% according to elp) -- thanks for these directions. > It would be good if the parameter todo-only could be a list of > strings, and org-scan-tags would return only the headlines where the > todo keyword is from this list. This would be confusing. Particularily, org-tags-view uses org-scan-tags using both the todo-only argument and a matcher: so if you make the todo-only argument aware of TODO keywords, there might be some interference between todo-only and the matcher. I'd rather not go that route. Thanks, -- Bastien