From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: An issue with org-agenda-todo-list-sublevels Date: Wed, 16 Dec 2015 09:20:48 +0100 Message-ID: <87lh8uajof.fsf@mbork.pl> 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> <87a8pbupiv.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a97KS-0000qU-Cf for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 03:20:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a97KP-0002U5-5h for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 03:20:56 -0500 Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:36612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a97KO-0002To-QA for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 03:20:53 -0500 In-reply-to: <87a8pbupiv.fsf@pierrot.dokosmarshall.org> 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: Nick Dokos Cc: emacs-orgmode@gnu.org On 2015-12-16, at 02:54, Nick Dokos wrote: > 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 w= rote: >>>>> >>>>>> 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 thi= s: >> >> * 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-glo= bal) (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 =E2=80=98org-agenda= .el=E2=80=99. > | Its value is nil > |=20 > | This variable may be risky if used as a file-local variable. > |=20 > | 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. > `---- Stupid me. Thanks. --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University