From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: Handling errors in command line exporting of agenda? Date: Mon, 8 Aug 2011 20:28:48 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqUZa-0003ks-BD for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:29:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqUZZ-0004iO-Gu for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:29:10 -0400 Received: from mail-ey0-f171.google.com ([209.85.215.171]:59375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqUZZ-0004iE-Cc for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 14:29:09 -0400 Received: by eyg24 with SMTP id 24so5412856eyg.30 for ; Mon, 08 Aug 2011 11:29:08 -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: John Hendy Cc: emacs-orgmode 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)' \ --eval '(org-batch-agenda "w")' > ~/org/aux/agenda-export.txt > 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.