emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Handling errors in command line exporting of agenda?


From: Nick Dokos
Subject: Re: [O] Handling errors in command line exporting of agenda?
Date: Mon, 08 Aug 2011 16:37:38 -0400

John Hendy <address@hidden> wrote:

> On Mon, Aug 8, 2011 at 1:59 PM, suvayu ali <address@hidden> wrote:
> > Hi John,
> >
> > On Mon, Aug 8, 2011 at 8:53 PM, John Hendy <address@hidden> wrote:
> >>> If you can use wildcards to specify your files, it might be possible by
> >>> just one extra call to --eval. Something like this might work:
> >>>
> >>> emacs --batch -l ~/.emacs --eval '(find-file-read-only "<wildcard>" t)' \
> >>>      --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt
> >>>
> >>
> >> Hmm. That might work. Everything I pull from is in ~/org... could the
> >> wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance.
> >
> > As far as I know, emacs accepts any wildcard that is valid in the shell.
> > Since all your files are in ~/org, I would say try "~/org/*.org". The
> > '~/org/' limits it to files within your org directory and the '*.org'[1]
> > limits it to all files with a .org extension.

Not true - if you want wildcards expanded, you have to do it yourself.
E.g. C-h f file-expand-wildcards

,----
| file-expand-wildcards is a compiled Lisp function in `files.el'.
| 
| (file-expand-wildcards PATTERN &optional FULL)
| 
| Expand wildcard pattern PATTERN.
| This returns a list of file names which match the pattern.
| 
| If PATTERN is written as an absolute file name,
| the values are absolute also.
| 
| If PATTERN is written as a relative file name, it is interpreted
| relative to the current default directory, `default-directory'.
| The file names returned are normally also relative to the current
| default directory.  However, if FULL is non-nil, they are absolute.
`----

Nick

> >
> 
> Bummer, this is not working:
> 
> ,---
> | emacs -batch -l ~/.emacs -eval '(find-file-read-only "~/org/*.org" t)' \
> | -eval '(org-batch-agenda "e")' > ~/org/aux/agenda-export.txt
> `---
> 
> Do you see anything wrong with that? I guess I wonder what that first
> part will do as perhaps the org-batch-agenda command is not
> necessarily going to follow suit with the read-only command. As in,
> does the first eval command affect anything that the org-batch-agenda
> command is going to do? Is it trying to do the equivalent of opening
> up all *.org files in read-only buffers and then run the agenda
> export?
> 
> 
> Thanks,
> John
> > I hope this helps. :)
> >
> > Footnotes:
> >
> > [1] The asterisk (*) stands for zero or more characters. You can find
> >    more details in `man bash` under the heading "Pattern Matching".
> >
> > --
> > Suvayu
> >
> > Open source is the future. It sets us free.
> >
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]