Re: [O] org-map-entries but with arguments?

2019-09-18 Thread John Kitchin
You can get an alist of all the properties in an entry with org-entry-properties, and then you can let-alist these, or do something else. Here is an example that might be related. * test :PROPERTIES: :some-random-property: True :END: #+BEGIN_SRC emacs-lisp :results code

Re: [O] org-map-entries but with arguments?

2019-09-18 Thread Adam Porter
Matt Price writes: > OK, this is pretty cool, thank you. I took John's excellent > suggestion of using a headline property to store the appropriate > actions, but it makes sense to switch to org-ql if I can master the > syntax (which seems awfully powerful). One questions: does >

Re: [O] org-map-entries but with arguments?

2019-09-18 Thread Matt Price
Sorry, replied to Adam directly by accident. On Wed, Sep 18, 2019 at 8:32 PM Matt Price wrote: > > > On Wed, Sep 18, 2019 at 5:31 PM Adam Porter wrote: > >> Matt Price writes: >> >> > Is there a lisp trick for adding arguments to the function called by >> > `org-map-entries`? >> > >> > I have

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread Adam Porter
John Kitchin writes: > I am not sure why you have to loop over everything in a let statement > though. you can use something like > https://github.com/nicferrier/emacs-kv to get all the keys an loop > over those to do what you want, or you can just use cl-loop to do > that. Recent Emacs

Re: [O] org-map-entries but with arguments?

2019-09-18 Thread John Kitchin
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

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread John Kitchin
I played with a similar idea of converting a plist to something you can call to access values at https://kitchingroup.cheme.cmu.edu/blog/2017/04/16/A-callable-plist-data-structure-for-Emacs/. It did end up as a macro, but no eval required. It never made it past that post, but it might have an

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread Adam Porter
Joost Kremers writes: > On Wed, Sep 18 2019, Matt Price wrote: >> Is thre away to do that kind of destructuring bind -- which >> binds *everything* in the plist, without knowing the symbol names in >> advance? that would be really great. > > let-alist perhaps? Well, let-alist is for alists, not

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread Adam Porter
Matt Price writes: > This is fun, thanks John. I really like the plist version put would > also like to loop through the variables in a let statement somehow. > > I think what I'm missing is the equivalent of a javascript implicit > destructuring construct: > > let { } = object; > > which will

Re: [O] org-map-entries but with arguments?

2019-09-18 Thread Adam Porter
Matt Price writes: > 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 ( (send-all nil) (also-mail > nil) (post-to-lms t) ) > "By default mail all subtrees 'READY' to

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread Joost Kremers
On Wed, Sep 18 2019, Matt Price wrote: Is thre away to do that kind of destructuring bind -- which binds *everything* in the plist, without knowing the symbol names in advance? that would be really great. let-alist perhaps? -- Joost Kremers Life has its moments

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread Matt Price
This is fun, thanks John. I really like the plist version put would also like to loop through the variables in a let statement somehow. I think what I'm missing is the equivalent of a javascript implicit destructuring construct: let { } = object; which will define new variables prop1, prop2...

Re: [O] Bug: Org commit d07d8ff41 breaks square-brace links in recent Emacs. [9.2.6 (release_9.2.6-538-g23113f @ /home/kfogel/src/org-mode/lisp/)]

2019-09-18 Thread Karl Fogel
On 18 Sep 2019, Marco Wahl wrote: >Karl Fogel writes: >> Hi. It appears that commit d07d8ff4163 in Org Mode causes >> square-brace-enclosed links to display incorrectly. >> >> The buggy behavior is simple to describe: if you write a link like this >> >> [[URL][LINK-TEXT]] >> >> then URL will

Re: [O] Best practice for providing an Org-based application?

2019-09-18 Thread Thorsten Jolitz
Neil Jerram writes: Hi, > Is there a best practice or recommended approach for preparing and > providing an Org-based application so that others could make use of it? > > I've been using Org for a few years to keep track of the membership and > 'fixing' for my choir - where 'fixing' means

[O] org-map-entries but with arguments?

2019-09-18 Thread Matt Price
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 ( (send-all nil) (also-mail nil) (post-to-lms t) ) "By default mail all subtrees 'READY' to student recipients, unless SEND-ALL is

[O] Tables: Exclude headings in Row Number?

2019-09-18 Thread Nathan Neff
Hello all, I have a table like this: | ID | || | 2 | | 3 | and I want to know how many rows there are w/o the ID heading and w/o the horizontal separator. I found the org-table-toggle-coordinate-overlays which displays an overlay showing the row number:

Re: [O] lisp: scoping vars in repetitive defuns

2019-09-18 Thread John Kitchin
You don't really need a macro for this I think. I see it leads to pretty clean looking code, but as you noted at the expense of edebuggable functions. I don't think you need the lexical-let in your macro though. With empty arguments I am not sure it does anything. Here are some other approaches

Re: [O] Bug: Org commit d07d8ff41 breaks square-brace links in recent Emacs. [9.2.6 (release_9.2.6-538-g23113f @ /home/kfogel/src/org-mode/lisp/)]

2019-09-18 Thread Marco Wahl
Hi. Karl Fogel writes: > Hi. It appears that commit d07d8ff4163 in Org Mode causes > square-brace-enclosed links to display incorrectly. > > The buggy behavior is simple to describe: if you write a link like this > > [[URL][LINK-TEXT]] > > then URL will be displayed instead of LINK-TEXT