From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: showing lists in agenda, and writing org-agenda to a file Date: Sat, 12 Jan 2008 10:46:03 -0800 Message-ID: <18313.2795.692843.87539@erics-mac.local> References: <878x35i535.fsf@novell.com> <18305.32180.980606.710374@erics-mac.local> <87prwefj7e.fsf@bzg.ath.cx> Reply-To: schulte.eric@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JDlNs-0005fC-IO for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 13:47:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JDlNr-0005cU-7X for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 13:47:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDlNr-0005cL-3J for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 13:47:07 -0500 Received: from mxout7.cac.washington.edu ([140.142.32.178]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JDlNq-0001YV-HR for emacs-orgmode@gnu.org; Sat, 12 Jan 2008 13:47:06 -0500 In-Reply-To: <87prwefj7e.fsf@bzg.ath.cx> 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: emacs-orgmode@gnu.org Hi Bastien, Thanks for the code re-write. Here's a link to my org-agenda displayed on my linux laptop's desktop. http://picasaweb.google.com/eric.no.spam.please/Screenshots/photo#5154659714810419410 > > 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... Understandable, my only motivation here was to have the checkbox lists available on my desktop display, but that can be more easily accomplished through modification of the functions below, rather than creating a new agenda view. Thanks! Eric On Monday, January 7, at 02:44, Bastien wrote: > 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