From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Handling errors in command line exporting of agenda? Date: Mon, 8 Aug 2011 13:53:28 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqUxD-0002XS-HK for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:53:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqUxC-0001TC-IB for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:53:35 -0400 Received: from mail-ey0-f171.google.com ([209.85.215.171]:57438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqUxC-0001Sc-DE for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:53:34 -0400 Received: by eyg24 with SMTP id 24so5442500eyg.30 for ; Mon, 08 Aug 2011 11:53:28 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: suvayu ali Cc: emacs-orgmode On Mon, Aug 8, 2011 at 1:28 PM, suvayu ali wr= ote: > Hi John, > > On Mon, Aug 8, 2011 at 8:12 PM, John Hendy wrote: >>> Do you run into the same problem if you one the file before hand in >>> read only mode? Something like this before the agenda command might >>> work. >>> >>> (find-file-read-only "FILENAME") >> >> How would I do this via the command line? Also, it's pulling from >> about 10 project files, so I'm not sure if I'd have to do this for >> every file or how that works since the org-batch-agenda command seems >> to be pulling from all of them. Perhaps there's some way to trigger >> emacs to think, "Everything is read-only from here out"? > > 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 "" t)' \ > =C2=A0 =C2=A0 =C2=A0--eval '(org-batch-agenda "w")' > ~/org/aux/agenda-ex= port.txt > Hmm. That might work. Everything I pull from is in ~/org... could the wildcard simply be "~/*.org"? Forgive my emacs wildcard ignorance. I did some filename regexp magic *once* and it took me like two hours to learn the syntax just to turn camera directory names from 10#_MMDD to YYYY-MM-DD... Thanks again, John > > >> find-file-read-only is an interactive compiled Lisp function in >> `files.el'. >> >> It is bound to C-x C-r. >> >> (find-file-read-only FILENAME &optional WILDCARDS) >> >> Edit file FILENAME but don't allow changes. >> Like C-x C-f, but marks buffer as read-only. >> Use C-x C-q to permit editing. > > Hope this helps. > > -- > Suvayu > > Open source is the future. It sets us free. >