From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: org-map-entries but with arguments? Date: Wed, 18 Sep 2019 14:51:34 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001ddfdc0592d854ec" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56494) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAf3M-0002HT-3y for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 14:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAf3L-0007M8-2w for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 14:51:48 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:41179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAf3K-0007LO-TL for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 14:51:47 -0400 Received: by mail-pf1-x42a.google.com with SMTP id q7so573244pfh.8 for ; Wed, 18 Sep 2019 11:51:46 -0700 (PDT) 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" To: Org Mode --0000000000001ddfdc0592d854ec Content-Type: text/plain; charset="UTF-8" Is there a lisp trick for adding arguments to the function called by `org-map-entries`? I have the following function: (cl-defun org-lms-return-all-assignments (&optional (send-all nil) (also-mail nil) (post-to-lms t) ) "By default mail all subtrees 'READY' to student recipients, unless SEND-ALL is non-nil. In that case, send all marked 'READY' or 'TODO'." (interactive) (message "Mailing all READY subtrees to students") (let ((send-condition (if send-all `(or (string= (org-element-property :todo-keyword item) "READY") (string= (org-element-property :todo-keyword item) "TODO") ) `(string= (org-element-property :todo-keyword item) "READY") ))) (org-map-entries #'ol-send-just-one)) (org-cycle-hide-drawers 'all)) I'd like to relay some of hte functions arguments to the one called internally to do the work. ~(ol-send-just-one~ takes an ~also-mail~ and a ~post-to-lms~ parameter,just like ~org-lms-return-all-assignments~, but I'm not sure how to trick org-map-entries into passing those arguments on. Any hints? Thank you! --0000000000001ddfdc0592d854ec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Is there a lisp trick for adding arguments to the fun= ction called by `org-map-entries`?

I have the= following function:

(cl-defun org-lms-return-all-= assignments (&optional (send-all nil) (also-mail nil) (post-to-lms t) )=
=C2=A0 "By default mail all subtrees 'READY' to student re= cipients, unless SEND-ALL is non-nil.
In that case, send all marked '= ;READY' or 'TODO'."
=C2=A0 (interactive)
=C2=A0 (mes= sage "Mailing all READY subtrees to students")
=C2=A0 (let ((s= end-condition
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if send-all
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`(or (string=3D (org-element-prope= rty :todo-keyword item) "READY")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string=3D (org-element-property :todo-k= eyword item) "TODO") )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0`(string=3D (org-element-property :todo-keyword item) "READY")=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)))
=C2=A0 =C2=A0 (org-map-= entries
=C2=A0 =C2=A0 =C2=A0#'ol-send-just-one))
=C2=A0 (org-cyc= le-hide-drawers 'all))

I'd like to relay s= ome of hte functions arguments to the one called internally to do the work.= =C2=A0 ~(ol-send-just-one~ takes an ~also-mail~ and a ~post-to-lms~ paramet= er,just like ~org-lms-return-all-assignments~, but I'm not sure how to = trick org-map-entries into passing those arguments on. Any hints?=C2=A0 Tha= nk you!

--0000000000001ddfdc0592d854ec--