From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: org-batch-agenda will not search for tags of length 2 [8.3.2 (8.3.2-10-g00dacd-elpaplus @ /Users/cg/.emacs.d/elpa/org-plus-contrib-20151005/)] Date: Sun, 08 Nov 2015 20:15:14 +0100 Message-ID: <877fls716l.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvVP8-0005JY-Jg for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 14:13:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvVP7-0003Bs-MO for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 14:13:30 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:36431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvVP7-0003BR-Gs for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 14:13:29 -0500 In-Reply-To: (Christoph Gaitzsch's message of "Sun, 08 Nov 2015 11:24:47 +0100") 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: Christoph Gaitzsch Cc: emacs-orgmode@gnu.org Hello, Christoph Gaitzsch writes: > Calling e.g. (org-batch-agenda 'ab') will report "Invalid agenda key" > instead of printing headlines with tag "ab". > > To fix, change the macro line 10 to > > (defmacro org-batch-agenda (cmd-key &rest parameters) > "Run an agenda command in batch mode and send the result to STDOUT. > If CMD-KEY is a string of length 1, it is used as a key in > `org-agenda-custom-commands' and triggers this command. If it is a > longer string it is used as a tags/todo match string. > Parameters are alternating variable names and values that will be bound > before running the agenda command." > (org-eval-in-environment (org-make-parameter-alist parameters) > (let (org-agenda-sticky) > (if (> (length cmd-key) 1) ;; CHANGE HERE TO 1 > (org-tags-view nil cmd-key) > (org-agenda nil cmd-key)))) > (set-buffer org-agenda-buffer-name) > (princ (buffer-string))) Applied. Thank you. Regards, -- Nicolas Goaziou