emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: An issue with org-agenda-todo-list-sublevels
Date: Wed, 16 Dec 2015 00:33:21 +0100	[thread overview]
Message-ID: <87oadr9tj2.fsf@mbork.pl> (raw)
In-Reply-To: <87y4cwiwoe.fsf@alphaville.usersys.redhat.com>



On 2015-12-14, at 21:48, Nick Dokos <ndokos@gmail.com> wrote:

> Marcin Borkowski <mbork@mbork.pl> writes:
>
>>> On 2015-12-12, at 09:53, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>>>
>>>> You can use a dedicated function in `org-agenda-skip-function' for that
>>>> (e.g., ignore task if one of its parents is a done task).
>>
>> OK, so it doesn't work (probably because I'm doing something wrong...)
>>
>> I did this:
>>
>> (defun mbork/org-agenda-skip-if-parent-done ()
>>   "Return t if any of the parents of the current entry is a DONE
>>   item."
>>   (save-excursion
>>     (catch 'done
>>       (while (org-up-heading-safe)
>> 	(if (org-entry-is-done-p)
>> 	    (throw 'done t))))))
>>
>> (setq org-agenda-custom-commands
>>       '(("n"
>> 	 "Agenda and TODOs"
>> 	 ((agenda "")
>> 	  (alltodo "" ((org-agenda-skip-function #'mbork/org-agenda-skip-if-parent-done)))))))
>>
>> and I see this:
>>
>> and: Wrong type argument: integer-or-marker-p, t
>>
>> What may be the problem?  How do I even debug this?
>>
>
> Are you testing it with emacs -q -l /path/to/min/org-init.el?
> If not, you probably should: I don't get any errors with the
> stuff above in my minimal org file, which leads me to suspect
> it's something in (the rest of) your configuration.

Strange.  I have the same error even with emacs -q, with minimal Org
config - the above function and one simple agenda file, containing this:

* DONE done
** TODO todo

Org-mode version 8.2.10 (release_8.2.10 @ /usr/local/share/emacs/25.0.50/lisp/org/)

Any hints?

Here's the debugger output:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p t)
  goto-char(t)
  (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) (org-agenda-skip-eval org-agenda-skip-function))) (goto-char to))
  (or (save-excursion (goto-char p) (looking-at comment-start-skip)) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (get-text-property p :org-archived) (org-end-of-subtree t)) (and org-agenda-skip-comment-trees (get-text-property p :org-comment) (org-end-of-subtree t)) (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) (org-agenda-skip-eval org-agenda-skip-function))) (goto-char to)) (org-in-src-block-p t))
  (if (or (save-excursion (goto-char p) (looking-at comment-start-skip)) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (get-text-property p :org-archived) (org-end-of-subtree t)) (and org-agenda-skip-comment-trees (get-text-property p :org-comment) (org-end-of-subtree t)) (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) (org-agenda-skip-eval org-agenda-skip-function))) (goto-char to)) (org-in-src-block-p t)) (progn (throw :skip t)))
  (let ((p (point-at-bol)) to) (if (or (save-excursion (goto-char p) (looking-at comment-start-skip)) (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) (get-text-property p :org-archived) (org-end-of-subtree t)) (and org-agenda-skip-comment-trees (get-text-property p :org-comment) (org-end-of-subtree t)) (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) (org-agenda-skip-eval org-agenda-skip-function))) (goto-char to)) (org-in-src-block-p t)) (progn (throw :skip t))))
  org-agenda-skip()
  org-agenda-get-todos()
  org-agenda-get-day-entries("/home/mbork/org/emacs.org" (12 16 2015) :todo)
  org-todo-list(nil)
  funcall-interactively(org-todo-list nil)
  call-interactively(org-todo-list)
  (let ((org-agenda-skip-function (function mbork/org-agenda-skip-if-parent-done))) (call-interactively (quote org-todo-list)))
  (let nil (let ((org-agenda-skip-function (function mbork/org-agenda-skip-if-parent-done))) (call-interactively (quote org-todo-list))))
  eval((let nil (let ((org-agenda-skip-function (function mbork/org-agenda-skip-if-parent-done))) (call-interactively (quote org-todo-list)))))
  org-let2(nil ((org-agenda-skip-function (function mbork/org-agenda-skip-if-parent-done))) (call-interactively (quote org-todo-list)))
  org-agenda-run-series("Agenda and TODOs" (((agenda "") (alltodo "" ((org-agenda-skip-function (function mbork/org-agenda-skip-if-parent-done)))))))
  org-agenda(nil)
  funcall-interactively(org-agenda nil)
  call-interactively(org-agenda nil nil)
  command-execute(org-agenda)
--8<---------------cut here---------------end--------------->8---

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

  reply	other threads:[~2015-12-15 23:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 23:26 An issue with org-agenda-todo-list-sublevels Marcin Borkowski
2015-12-12  8:53 ` Nicolas Goaziou
2015-12-12 11:00   ` Marcin Borkowski
2015-12-14 19:17     ` Marcin Borkowski
2015-12-14 20:48       ` Nick Dokos
2015-12-15 23:33         ` Marcin Borkowski [this message]
2015-12-16  1:54           ` Nick Dokos
2015-12-16  8:20             ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oadr9tj2.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).