emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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/)]
@ 2015-11-08 10:24 Christoph Gaitzsch
  2015-11-08 19:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Gaitzsch @ 2015-11-08 10:24 UTC (permalink / raw)
  To: emacs-orgmode


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

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)))

Emacs  : GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0, NS apple-appkit-1404.13)
 of 2015-11-07 on hal9000.local
Package: Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpaplus @ /Users/cg/.emacs.d/elpa/org-plus-contrib-20151005/)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-08 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-08 10:24 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/)] Christoph Gaitzsch
2015-11-08 19:15 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).