[Orgmode] Annotate files in org syntax

2008-01-12 Thread Phil Jackson
Hi,

Thought I might share this with you:



org-annotate-file.el
Description: application/emacs-lisp

Cheers,
Phil
-- 
 Phil Jackson
 http://www.shellarchive.co.uk
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Translator: remind2org

2008-01-12 Thread Detlef Steuer
Hi all,

remind (http://www.roaringpenguin.com/products/remind) is a very
powerful command line calendaring program. Its features superseed
the possibilities of orgmode in the area of date specifying,
so that I want to use it combined with orgmode.

Using the script below I'm able use remind and incorporate its output
in my agenda views.
The default of using 13 months look ahead is easily changed. It just
happens I sometimes like to look a year into the future. :-)

Any comments welcome! Be friendly ;-) , that's my first python program
ever. So it may be stupid as hell and bad python style.

There is no sophisticated logic to get nice orgmode output.
I only cared to get all dates. Nevertheless it does what I need.

Hope someone finds this useful.

detlef

Carsten: Btw. I think the headings "orgmode to XXX" and "XXX to
orgmode" must be exchanged! 


-snip

#!/usr/bin/python
# coding=utf-8
# remind2org.py converts the simple calendar output from remind
# in files suitable for orgmode.
# Two arguments are expected:
# - first argument: filename for remind input file
# - second argument: filename for orgmode output file
# Version: 0.1
# Notice: You must include the outputfile in your org-agenda-files
# 
# Copyright (c) 2008
# Dr. Detlef Steuer <[EMAIL PROTECTED]>
# 12.1.2008

import os, sys

def processremindline(zeile):
fields = zeile.split(' ')
fieldnumber = len(fields)
if fieldnumber < 2: return
scheduled =  fields[0].replace('/','-')
if fields[4] != '*': scheduled = ' '.join([scheduled, fields[5]])
outline = '**'
for number in range(5, fieldnumber):
outline = ' '.join([outline , fields[number]]) 
outline =  ''.join([outline,'   <', scheduled, '>'])
return outline
 
if __name__ == '__main__':
if len(sys.argv) != 3 :
print 'Usage: remind2org remindfile orgfile'
sys.exit()
remindersfilename = sys.argv[1]
orgfilename = sys.argv[2]
remind = '/usr/bin/remind'
remindcmd = ' '.join([remind, '-b1 -ss -C13'])
entries = os.popen('
'.join([remindcmd,remindersfilename])).readlines() entrynumber =
len(entries) orgfile = open(orgfilename,'w')
print >> orgfile, '* Termine aus remind2org'
print >> orgfile, '#+CATEGORY: REMIND'
for i in range(entrynumber):
print >> orgfile , processremindline(entries[i])
orgfile.close()

-snip--



-- 
Wisely, and slow. They stumble that run fast. - Shakespeare



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] REQUEST: orgstruct-mode modeline string?

2008-01-12 Thread Richard KLINDA
Hello, I've noticed that M-x orgstruct-mode doesn't put the string
"OrgStruct" onto the modeline (to give visual feedback about its
activeness).  M-x orgtbl-mode puts "OrgTbl" there, I think
orgstruct-mode should do the same.

Have a nice day, 
Richard


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] sexp timestamp behavior

2008-01-12 Thread David C. Nelson


I've been playing around with org mode and I'm confused about the  
behavior of timestamps that are specified using sexps when displayed  
in the agenda. Specifically, if I schedule a TODO and specify a  
timestamp using a sexp, the TODO is not carried forward if it is past  
due.  It does show on the day it was scheduled, but if the TODO is not  
done, the TODO is not carried forward as the manual says it should.


If I don't use a sexp timestamp, the TODO is carried forward if past  
due as expected.


I can't find anything in the manual that suggests sexp timestamps are  
treated differently. Am I misunderstanding something?


Thanks ...


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] indention spacing

2008-01-12 Thread Eric Holbrook
I'm trying to find a way to increase the indentation between levels of
hierarchy in org-mode. In other words, i'd like to have indentation of
3 or 4 spaces instead of the standard 1 space. I'm color blind, and
the colors don't help my eyes pick out levels of hierarchy very
well. If i could do this, then i could do org-hide-leading-stars and
get rid of that line noise, too.

Where i see this:

* THERMAL
** Potential Bugs
*** Counting Difference, Rob v. Tahsin
Rob will file bug on self.
*** Multiple Drivers
** Known Bugs
*** Bandwidth issue

I'd like to see something like this:

  THERMAL
  Potential Bugs
  Counting Difference, Rob v. Tahsin
  Rob will file bug on self.
  Multiple Drivers
  Known Bugs
  Bandwidth issue

thanks,
Eric


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] showing lists in agenda, and writing org-agenda to a file

2008-01-12 Thread Eric Schulte
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" <[EMAIL PROTECTED]> 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


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] RFC: interactive tag query adjustment

2008-01-12 Thread Christopher League


Hi again, last month I proposed an idea for interactively manipulating  
the current query in a tags agenda match (C-c a m, org-tags-view).   
Attached here is a patch against 5.18a that implements this idea.   
It's pretty slick, if I may be so bold!


In a tags match buffer, the prompt will now say, for example:

Headlines with TAGS match: office
Press `C-u r' to enter new search string; use `/;\=' to adjust  
interactively


The extra keys are / (and), ; (or), \ (not), = (clear).  Any one of  
them will bring up another window, much like fast tag selection.  You  
can press one key to select the tag or TODO keyword, and that will be  
added to or removed from the query string accordingly.


So, starting with the query "office", I can hit the keys ";p/N-f" to  
transform it to "office|phone-focus/NEXT", assuming my tags and TODO  
keywords are assigned those keys already.  Like fast tag selection, it  
supports single-key (the default), multi-key (waits for RET), and  
expert (no separate window) modes.


Enjoy.. comments & critiques welcome.
Chris

--- org-vendor/org.el   2008-01-06 10:30:26.0 -0500
+++ org/org.el  2008-01-12 17:19:15.0 -0500
@@ -15078,7 +15078,8 @@
 (let ((org-last-tags-completion-table
   (org-global-tags-completion-table)))
   (setq match (completing-read
-  "Match: " 'org-tags-completion-function nil nil nil
+  "Match: " 'org-tags-completion-function nil nil
+   org-agenda-query-string
   'org-tags-history
 
   ;; Parse the string and create a lisp form
@@ -18812,6 +18813,7 @@
 (defvar org-agenda-follow-mode nil)
 (defvar org-agenda-show-log nil)
 (defvar org-agenda-redo-command nil)
+(defvar org-agenda-query-string nil)
 (defvar org-agenda-mode-hook nil)
 (defvar org-agenda-type nil)
 (defvar org-agenda-force-single-file nil)
@@ -18947,6 +18949,10 @@
 (org-defkey org-agenda-mode-map [(right)] 'org-agenda-later)
 (org-defkey org-agenda-mode-map [(left)] 'org-agenda-earlier)
 (org-defkey org-agenda-mode-map "\C-c\C-x\C-c" 'org-agenda-columns)
+(org-defkey org-agenda-mode-map "=" 'org-agenda-query-clear-cmd)
+(org-defkey org-agenda-mode-map "/" 'org-agenda-query-and-cmd)
+(org-defkey org-agenda-mode-map ";" 'org-agenda-query-or-cmd)
+(org-defkey org-agenda-mode-map "\\" 'org-agenda-query-not-cmd)
 
 (defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
   "Local keymap for agenda entries from Org-mode.")
@@ -20423,9 +20429,10 @@
 (setq matcher (org-make-tags-matcher match)
  match (car matcher) matcher (cdr matcher))
 (org-prepare-agenda (concat "TAGS " match))
+(setq org-agenda-query-string match)
 (setq org-agenda-redo-command
  (list 'org-tags-view (list 'quote todo-only)
-   (list 'if 'current-prefix-arg nil match)))
+   (list 'if 'current-prefix-arg nil 'org-agenda-query-string)))
 (setq files (org-agenda-files)
  rtnall nil)
 (while (setq file (pop files))
@@ -20461,7 +20468,7 @@
   (add-text-properties pos (1- (point)) (list 'face 'org-warning))
   (setq pos (point))
   (unless org-agenda-multi
-   (insert "Press `C-u r' to search again with new search string\n"))
+   (insert "Press `C-u r' to enter new search string; use `/;\\=' to 
adjust interactively\n"))
   (add-text-properties pos (1- (point)) (list 'face 
'org-agenda-structure)))
 (when rtnall
   (insert (org-finalize-agenda-entries rtnall) "\n"))
@@ -20471,6 +20478,275 @@
 (org-finalize-agenda)
 (setq buffer-read-only t)))
 
+;;; Agenda interactive query manipulation
+
+(defcustom org-agenda-query-selection-single-key t
+  "Non-nil means, query manipulation exits after first change.
+When nil, you have to press RET to exit it.
+During query selection, you can toggle this flag with `C-c'.
+This variable can also have the value `expert'.  In this case, the window
+displaying the tags menu is not even shown, until you press C-c again."
+  :group 'org-agenda
+  :type '(choice
+ (const :tag "No" nil)
+ (const :tag "Yes" t)
+ (const :tag "Expert" expert)))
+
+(defun org-agenda-query-selection (current op table &optional todo-table)
+  "Fast query manipulation with single keys.
+CURRENT is the current query string, OP is the initial
+operator (one of \"+|-=\"), TABLE is an alist of tags and
+corresponding keys, possibly with grouping information.
+TODO-TABLE is a similar table with TODO keywords, should these
+have keys assigned to them.  If the keys are nil, a-z are
+automatically assigned.  Returns the new query string, or nil to
+not change the current one."
+  (let* ((fulltable (append table todo-table))
+(maxlen (apply 'max (mapcar
+ (lambda (x)
+   (if (stringp (car x)) (string-width (car x)) 0))
+ fulltable)))
+(fwidth (+ maxlen 3 1 3))
+(ncol (/ (- (window-width) 4) fwidth)

Re: [Orgmode] indention spacing

2008-01-12 Thread Eddward DeVilla
There is an option that you can put in the orgfile on a per-buffer
basis and an option in customize that can bump the indent to 2.  I
don't believe there is more than than.  I run with an indent of 2.  It
work well.  The the buffer you can put '#+STARTUP: odd'.  You can look
at section "14.5 A cleaner outline view" in the manual for more info.
It don't remember the name of the customize option, but you can
probably browse those options pretty easily in the Org menu.

Edd

On Jan 10, 2008 11:51 AM, Eric Holbrook <[EMAIL PROTECTED]> wrote:
> I'm trying to find a way to increase the indentation between levels of
> hierarchy in org-mode. In other words, i'd like to have indentation of
> 3 or 4 spaces instead of the standard 1 space. I'm color blind, and
> the colors don't help my eyes pick out levels of hierarchy very
> well. If i could do this, then i could do org-hide-leading-stars and
> get rid of that line noise, too.
>
> Where i see this:
>
> * THERMAL
> ** Potential Bugs
> *** Counting Difference, Rob v. Tahsin
> Rob will file bug on self.
> *** Multiple Drivers
> ** Known Bugs
> *** Bandwidth issue
>
> I'd like to see something like this:
>
>   THERMAL
>   Potential Bugs
>   Counting Difference, Rob v. Tahsin
>   Rob will file bug on self.
>   Multiple Drivers
>   Known Bugs
>   Bandwidth issue
>
> thanks,
> Eric
>
>
> ___
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode