From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: showing lists in agenda, and writing org-agenda to a file Date: Mon, 07 Jan 2008 02:44:21 +0000 Message-ID: <87prwefj7e.fsf@bzg.ath.cx> References: <878x35i535.fsf@novell.com> <18305.32180.980606.710374@erics-mac.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JBhyU-0006ye-JV for emacs-orgmode@gnu.org; Sun, 06 Jan 2008 21:44:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JBhyU-0006yD-3y for emacs-orgmode@gnu.org; Sun, 06 Jan 2008 21:44:26 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBhyT-0006xx-V9 for emacs-orgmode@gnu.org; Sun, 06 Jan 2008 21:44:25 -0500 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JBhyT-0007d2-Iw for emacs-orgmode@gnu.org; Sun, 06 Jan 2008 21:44:25 -0500 Received: by ug-out-1314.google.com with SMTP id a2so3531994ugf.48 for ; Sun, 06 Jan 2008 18:44:24 -0800 (PST) In-Reply-To: <18305.32180.980606.710374@erics-mac.local> (Eric Schulte's message of "Sun, 6 Jan 2008 17:17:40 -0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org Hi Eric, "Eric Schulte" writes: > I've started using tools to display my org-agenda as part of my > desktop (geektool http://projects.tynsoe.org/en/geektool/ on my Mac, > and conky http://conky.sourceforge.net/ on my linux box). Great! That looks neat. > In doing so I put together the following little function (below), > which I though I would share in the hope that either someone finds it > useful, or someone has already done this and can share a better method > of accomplishing the same (I'm in the early stages of learning elisp). Here is a slight rewrite of your code: ;; Use (current-column) (defun current-line-length () "Length of a the line at point." (save-excursion (end-of-line) (current-column))) ;; Use (org-write-agenda file) (defun org-agenda-to-file (key file &optional max-line-width) "Write the `org-agenda' view associated with KEY to FILE. MAX-LINE-WIDTH optionally specifies the maximum line width for the text in the resulting file." (interactive) (save-window-excursion (org-agenda nil key) (switch-to-buffer "*Org Agenda*") (org-write-agenda file) (org-agenda-quit)) (if max-width (put-file-content-in-procustes-bed file max-line-length))) ;; Use a separate torture function for this (defun put-file-content-in-procustes-bed (file max-line-width) "Find FILE and cut anything beyond LINE-WIDTH." (save-window-excursion (with-temp-buffer (find-file file) (kill-rectangle (point-min) (progn (point-max) (move-to-column max-line-width t) (point))) (erase-buffer) (yank-rectangle) (write-file file)))) Here is what the associated shell script would look like: --8<---------------cut here---------------start------------->8--- #!/bin/bash /usr/local/bin/emacs-23.0.0 --batch --eval \ "(progn (load-file \"~/elisp/testing/org/org.el\") \ (org-agenda-to-file \"a\" \"~/.desktop-display\" 60))" --8<---------------cut here---------------end--------------->8--- BTW, do you have any screenshot showing geektool/conky in action? > Also, In some cases I would like to display the entire body of a > subtree in my custom org-agenda view. Specifically subtrees where the > body is a checkbox list... It's not possible right now. I wonder if this would be useful. The purpose of the agenda view is to give you a quick overview of your tasks, not to burden souls with details... In agenda mode, you can see the item at point with SPC and you can turn follow mode on -- this will display the subtree at point. Thanks for the code! -- Bastien