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


On Wed, Sep 18, 2019 at 2:52 PM Matt Price <moptop99@gmail.com> 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!