From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org-map-entries but with arguments? Date: Wed, 18 Sep 2019 19:28:07 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002d8a710592dc31c9" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34107) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAjN5-0002MV-Ep for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 19:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAjN3-0006No-Gc for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 19:28:27 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:40229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAjN1-0006Ly-Bz for emacs-orgmode@gnu.org; Wed, 18 Sep 2019 19:28:23 -0400 Received: by mail-wm1-x32d.google.com with SMTP id b24so1790292wmj.5 for ; Wed, 18 Sep 2019 16:28:20 -0700 (PDT) In-Reply-To: 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: Matt Price Cc: Org Mode --0000000000002d8a710592dc31c9 Content-Type: text/plain; charset="UTF-8" I guess this information should be accessible in the entry where the function is called, e.g. by a property (that may be inherited or set in the file). then in your function just get the property values and do what you want. Alternatively, you can probably do this with global (or maybe lexically let) variables. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Wed, Sep 18, 2019 at 2:52 PM Matt Price wrote: > 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! > > --0000000000002d8a710592dc31c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I guess this information should be accessible in the entry= where the function is called, e.g. by a property (that may be inherited or= set in the file). then in your function just get the property values and d= o what you want. Alternatively, you can probably do this with global (or ma= ybe lexically let) variables.

John

-----------------------------------
= Professor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemica= l Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-= 268-7803


--0000000000002d8a710592dc31c9--