emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-map-entries but with arguments?
Date: Wed, 18 Sep 2019 19:28:07 -0400	[thread overview]
Message-ID: <CAJ51ETqmob+_+iK_Mx2LYXkd7j3WkbLbNT4QYh+6ES2CdwTc0Q@mail.gmail.com> (raw)
In-Reply-To: <CAN_Dec91uOOHW7OOtHzB09t7zoryRnSZLgBRikSvWcwLCB4NyQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]

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 <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!
>
>

[-- Attachment #2: Type: text/html, Size: 2604 bytes --]

      parent reply	other threads:[~2019-09-18 23:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 18:51 org-map-entries but with arguments? Matt Price
2019-09-18 21:30 ` Adam Porter
     [not found]   ` <CAN_Dec8gBJ9+A+tvhDzGVwcMV7NmMRj=UMfLQyrDr51NtAabgA@mail.gmail.com>
2019-09-19  1:10     ` Matt Price
2019-09-19  1:34       ` Adam Porter
2019-09-19  1:42       ` John Kitchin
2019-09-19 13:31         ` Matt Price
2019-09-18 23:28 ` John Kitchin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51ETqmob+_+iK_Mx2LYXkd7j3WkbLbNT4QYh+6ES2CdwTc0Q@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).