Re: [O] property matching in org-agenda-custom-commands

2019-04-05 Thread Matt Price
Ah, I was being pretty stupid.  Thanks to both Thomas and Nick.

Is it possible to specify "current buffer only" in the definition of a
shortcut, but still produce an agenda, rather than a sparse tree? I find
the agenda in some ways easier to navigate than the sparse tree.

Also (side note) I'm having trouble using the boolean "|" in the pattern
for the property value.  I thought something like one of these would work,
but I'm having some trouble with it:

+GRADE={"0"|"Fail"}
or maybe
+GRADE={0|Fail}

etc.

Thansk as always,
Matt

On Fri, Apr 5, 2019 at 4:17 PM Thomas Plass  wrote:

> Matt,
>
> Matt Price wrote at 13:31 on April 5, 2019:
> :
> : ("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")
> :
> : However, this seems to choke, and the agenda is not generated.
>
> Works as advertised (docstring'ed?), I think.  The 'tags-tree creates
> a sparse tree, not an agenda.  Plain 'tags does.  If that's what
> you're after.
>
> ("F" "Failing Students in Current Buffer Only" tags "+GRADE=\"0\"")
>
> Thomas
>


Re: [O] property matching in org-agenda-custom-commands

2019-04-05 Thread Thomas Plass
Matt,

Matt Price wrote at 13:31 on April 5, 2019:
: 
: ("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")
: 
: However, this seems to choke, and the agenda is not generated.

Works as advertised (docstring'ed?), I think.  The 'tags-tree creates
a sparse tree, not an agenda.  Plain 'tags does.  If that's what
you're after.

("F" "Failing Students in Current Buffer Only" tags "+GRADE=\"0\"")

Thomas



Re: [O] property matching in org-agenda-custom-commands

2019-04-05 Thread Nick Dokos
Matt Price  writes:

> Embarassed that I still don't really know how to use the agenda commands 
> after all this time :-(

Ditto - I need to read the doc for org-agenda-custom-commands every
time I try to use it.

>
> I have a bunch of trees that look in part like this:
> * Asisgnment 1
> ** Student A
> :PROPERTIES:
> :GRADE: 0
> :END:
> I would like to store a search in org-agenda-custom-commands. I generated it 
> initially with ~C-c a < m
> +GRADE="0"~. Now I have tried to store it in org-agenda-custom-commands with 
> this line:
>
> ("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")
>
> However, this seems to choke, and the agenda is not generated. There are no 
> error messages in *Messages*
> so I'm not quite sure what's going on.  Can anyone see obvious mistakes in my 
> syntax?
>
> Thank you!
>

This looks right and it also seems to work correctly for me.

One thing to note is the doc for tags-tree:

,
|   tags-tree   Sparse tree with all tags matches in *current* file.
`

so you need to be visiting the file.

Here's what I did:

I added it to the end of org-agenda-custom-commands with

(add-to-list 'org-agenda-custom-commands
 '("F" "Failing Students in Current Buffer Only" tags-tree 
"+GRADE=\"0\"")
 t)

then added a bunch of entries to an org file:

--8<---cut here---start->8---
* Asisgnment 1
** Student A
:PROPERTIES:
:GRADE: 0
:END:
** Student B
:PROPERTIES:
:GRADE: 1
:END:
** Student C
:PROPERTIES:
:GRADE: 0
:END:
** Student D
:PROPERTIES:
:GRADE: 2
:END:
** Student E
:PROPERTIES:
:GRADE: 0
:END:
** Student F
:PROPERTIES:
:GRADE: 3
:END:
--8<---cut here---end--->8---

Then while visiting this file, I did

C-c a F

I get a sparse tree with the headings for students A, C and E.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[O] property matching in org-agenda-custom-commands

2019-04-05 Thread Matt Price
Embarassed that I still don't really know how to use the agenda commands
after all this time :-(


I have a bunch of trees that look in part like this:
* Asisgnment 1
** Student A
:PROPERTIES:
:GRADE: 0
:END:
I would like to store a search in org-agenda-custom-commands. I generated
it initially with ~C-c a < m +GRADE="0"~. Now I have tried to store it in
org-agenda-custom-commands with this line:

("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")

However, this seems to choke, and the agenda is not generated. There are no
error messages in *Messages* so I'm not quite sure what's going on.  Can
anyone see obvious mistakes in my syntax?

Thank you!


Re: [O] Python source block and :dir header arg

2019-04-05 Thread John Kitchin
I updated to the latest org, and I am not sure if you are seeing a bug. You
might need to fix the space between : and session in your example, and name
the session something. Also, you need to make sure the directory exists.
This example works as expected for me:

#+begin_src python :results output :session t :dir ./run
import os
cwd = os.getcwd()
print("dir: ", cwd)
#+end_src

#+RESULTS:
: dir:  /Users/jkitchin/Box
Sync/kitchingroup/jkitchin/journal/2019/04/05/run

There are still some subtle possible issues, e.g. you cannot change the
:dir after you run this in a session. I am not sure why. Personally I
prefer ipython for sessions.

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, Apr 3, 2019 at 1:31 PM Joao Cortes 
wrote:

> Thanks for checking. Do you know what to do now, assuming It is a bug?
>
>