From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: An issue with org-agenda-todo-list-sublevels Date: Tue, 15 Dec 2015 20:54:16 -0500 Message-ID: <87a8pbupiv.fsf@pierrot.dokosmarshall.org> References: <877fkldgvw.fsf@mbork.pl> <87h9jo121d.fsf@nicolasgoaziou.fr> <87vb84aq48.fsf@mbork.pl> <871taoc00z.fsf@mbork.pl> <87y4cwiwoe.fsf@alphaville.usersys.redhat.com> <87oadr9tj2.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a91IS-0003Yb-3l for emacs-orgmode@gnu.org; Tue, 15 Dec 2015 20:54:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a91IO-0001Jm-3l for emacs-orgmode@gnu.org; Tue, 15 Dec 2015 20:54:28 -0500 Received: from plane.gmane.org ([80.91.229.3]:52883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a91IN-0001Ji-Sh for emacs-orgmode@gnu.org; Tue, 15 Dec 2015 20:54:24 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a91IM-0001HS-Gb for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 02:54:22 +0100 Received: from pool-74-104-158-160.bstnma.fios.verizon.net ([74.104.158.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Dec 2015 02:54:22 +0100 Received: from ndokos by pool-74-104-158-160.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Dec 2015 02:54:22 +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: emacs-orgmode@gnu.org Marcin Borkowski writes: > On 2015-12-14, at 21:48, Nick Dokos wrote: > >> Marcin Borkowski writes: >> >>>> On 2015-12-12, at 09:53, Nicolas Goaziou 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: > > 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)) Not so strange: I probably did not hit the (throw 'done t) in your function. The spec says that the function has to return a position in the buffer: ,---- | org-agenda-skip-function is a variable defined in ‘org-agenda.el’. | Its value is nil | | This variable may be risky if used as a file-local variable. | | Documentation: | Function to be called at each match during agenda construction. | If this function returns nil, the current match should not be skipped. | Otherwise, the function must return a position from where the search | should be continued. `---- -- Nick