Re: [Orgmode] question about date-tree
Below is an elisp function which does the required work. I now call this function at the beginning of the month so my journal.org file is pre-populated to make it easier for me to set future todos. You can also call it for any future month/year combination you want. Feel free to add it to orgmode or just let people who want it add to their own system manually. Thanks again for orgmode! ; Elisp code follows: (defun create-dates-for-month-and-year (month year) Create entries in date-tree format in current buffer. This function creates nodes for all days in given the given MONTH and YEAR in the current buffer (if they do not exist already). (let ((day 1) (max-days (if (= 2 month) (if (date-leap-year-p year) 29 28) (nth month (list nil 31 28 31 30 31 30 31 31 30 31 30 31 ) (while (= day max-days) (org-datetree-find-date-create (list month day year)) (setq day (+ 1 day)) ) ) ) On Tue, Jul 20, 2010 at 10:27 AM, Carsten Dominik carsten.domi...@gmail.com wrote: On Jul 19, 2010, at 11:46 PM, Eric S Fraga wrote: On Mon, 19 Jul 2010 08:10:49 -0400, Emin.shopper Martinian.shopper emin.shop...@gmail.com wrote: Dear Experts, I really like the date-tree feature of org-remember and use it to plan my daily agenda. Often I want to plan things in the future and fill out an entry for a couple of weeks hence. It's slightly annoying to try to remember the day of week and date so that it will match the date-tree format. Is there a function/utility/suggestion for prepopulating a month's worth of date-tree daily nodes? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode I know this doesn't actually answer your question but what I do is simply bring up the agenda view and then insert an entry in the right day using i d. This will create a date-tree entry if you've set the right variable, specifically org-agenda-diary-file to point to the date-tree file. Well, this is hard because org-capture places the entry *before* you get a chance to set those dates. - Carsten However, I also would like org-capture to handle this situation... for instance, I would sometimes like todo entries that I define with org-capture to be placed in a date tree structure for either of the scheduled or deadline dates that todo entry is initially defined with. -- Eric S Fraga GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] question about date-tree
Dear Experts, I really like the date-tree feature of org-remember and use it to plan my daily agenda. Often I want to plan things in the future and fill out an entry for a couple of weeks hence. It's slightly annoying to try to remember the day of week and date so that it will match the date-tree format. Is there a function/utility/suggestion for prepopulating a month's worth of date-tree daily nodes? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: How do you control sorting in org agenda?
It turned out my previous attempt at sorting didn't quite work, here is an improved version of the hack for anyone else who wants to add sub-priorities to control sorting of todo items: (defun org-cmp-sub-priority (a b) Compare the titles of string A and B This function can be used in the org-agenda-cmp-user-defined variable and org-agenda-sorting-strategy to compare the sort order of org entries. It looks for something of the from TODO[priority]-num where priority is one of #A, #B, #C indicating an org prioity and num is a sub-priority which org doesn't know about but which controls the sorting order. For example, I have TODO entries like TODO [#A]-01 foo TODO [#A]-02 bar TODO [#A]-03 baz and use this function to make sure they get sorted properly in the todo screen of org-agenda. (let* ((aa (car (last (split-string (substring-no-properties a) TODO .#. (bb (car (last (split-string (substring-no-properties b) TODO .#. (use-a (string-match ^.?-[0-9] aa)) (use-b (string-match ^.?-[0-9] bb)) ) (cond ((and use-a use-b) ;; check if both aa and bb have a priority (cond ((string-lessp aa bb) -1) ;; if so, just compare strings ((string-lessp bb aa) +1) (t nil))) (use-a -1) ;; a has priority but not b (use-b +1) ;; b has priority but not a (t nil)) ;; nobody has priority so don't compare )) (setq org-agenda-cmp-user-defined 'org-cmp-sub-priority) (setq org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) (todo priority-down user-defined-up) (tags priority-down category-keep) (search category-keep))) On Mon, May 17, 2010 at 7:50 AM, Emin.shopper Martinian.shopper emin.shop...@gmail.com wrote: On Thu, May 13, 2010 at 4:59 PM, Bernt Hansen be...@norang.ca wrote: Emin.shopper Martinian.shopper emin.shop...@gmail.com writes: See the variable org-agenda-sorting-strategy. -Bernt Thanks for the pointer. I put the following in my .emacs file and the I change my prioritized items to things like TODO [#A]-01 foo, TODO [#A]-02 bar, etc. and things sort as I wanted. (defun org-cmp-title (a b) Compare the titles of string A and B (cond ((string-lessp a b) -1) ((string-lessp b a) +1) (t nil))) (setq org-agenda-cmp-user-defined 'org-cmp-title) (setq org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) (todo priority-down user-defined-up category-keep) (tags priority-down category-keep) (search category-keep))) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: How do you control sorting in org agenda?
On Thu, May 13, 2010 at 4:59 PM, Bernt Hansen be...@norang.ca wrote: Emin.shopper Martinian.shopper emin.shop...@gmail.com writes: See the variable org-agenda-sorting-strategy. -Bernt Thanks for the pointer. I put the following in my .emacs file and the I change my prioritized items to things like TODO [#A]-01 foo, TODO [#A]-02 bar, etc. and things sort as I wanted. (defun org-cmp-title (a b) Compare the titles of string A and B (cond ((string-lessp a b) -1) ((string-lessp b a) +1) (t nil))) (setq org-agenda-cmp-user-defined 'org-cmp-title) (setq org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) (todo priority-down user-defined-up category-keep) (tags priority-down category-keep) (search category-keep))) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Links break when you archive; what are work arounds?
Dear Experts, I really like org-mode and am starting to use it more and more to track my notes, todos, agenda, etc. One thing I am confused about is that when I make a link to FOO and then archive FOO, the link no longer works. I guess I was hoping that org-mode would be smart enough to adjust links or look in the archive file but maybe that is too complicated. Is there a suggested work-around to preserve links when you archive something? Alternatively, maybe I'm not using archive properly. My general mode of operation is to have a file with my master to do list and another file for my daily plan (with a separate node for each day). In each day's node, I link to the master to-do list. Then when I finish a task in the master list, I archive it (which breaks the link). I would appreciate pointers to better modes of operation. Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] script to transfer schedule from org-mode to Microsoft Outlook
Dear Experts, I find org-mode very useful but also need to sync my calendar with outlook. To do that, I use the attached Org2CSV.py script along with a modified version of the Orgnode.py script from Charles Cave (also attached). Once I have the CSV I can import it into Outlook or Google Calendar. I'm sending in case others find it useful. Best, -Emin Script to take scheduled items in an org-mode file and export to CSV. Once you have the CSV file you can import it into Microsoft Outlook or Google's Calendar. import glob, csv, datetime, sys import Orgnode def MakeCSV(globPattern, output, onlyToday=True, defaultReminder=datetime.timedelta(minutes=5)): Make a CSV file representing all scheduled items. INPUTS: -- globPattern:File name or pattern (e.g., ~/org/*.org) representing files to process. -- output: Name of output csv file to write to. -- onlyToday=True: Whether to only output today's items (if True) or output all items (if False). -- defaultReminder=datetime.timedelta(minutes=5): Offset for reminders. A reminder will be generated this amount prior to each scheduled item with a start time. --- PURPOSE:Create a CSV file from org-mode files so that the schedule can be imported into Microsoft Outlook or Google calendar. today = datetime.date.today().timetuple()[0:3] out = open(output, 'wb') writer = csv.writer(out) writer.writerow([Subject, Start Date, Start Time, End Date, End Time, All day event, Description, Show time as, Location, Reminder Date, Reminder Time, Reminder on/off]) for fileName in glob.glob(globPattern): for n in Orgnode.makelist(fileName): if (n.scheduled and ( not onlyToday or n.scheduled.timetuple()[0:3] == today)): row = [n.headline, n.scheduled, n.starttime, n.scheduled, n.endtime, 'FALSE', n.body, 3, '', '', '', ''] if (row[2]): row[2] = row[2].strftime('%H:%M:00') if (row[4]): row[4] = row[4].strftime('%H:%M:00') if (row[2] and defaultReminder is not None): row[-3] = row[1] row[-2] = (n.starttime-defaultReminder).strftime('%H:%M:00') row[-1] = TRUE writer.writerow(row) def MakeUsage(): 'Return string representing usage information.' return ''' Org2CSV.py --globPatttern=pattern --output=file [--onlyToday=o] where pattern is a wild card pattern for all org-mode files to process, file is the name of an output csv file, and o is either True or False. ''' if __name__ == '__main__': argvDict = dict([item.split('=') for item in sys.argv[1:] if item]) argvDict = dict([(k.lstrip('-'), v) for (k,v) in argvDict.items()]) onlyTodayArg = argvDict.get('onlyToday', True) argvDict['onlyToday'] = False if ( onlyTodayArg is False or onlyTodayArg == 'False') else onlyTodayArg try: MakeCSV(**argvDict) except Exception, e: print 'Unable to make csv file due to exception:\n%s\nUsage:\n%s' % ( str(e), MakeUsage()) The Orgnode module consists of the Orgnode class for representing a headline and associated text from an org-mode file, and routines for constructing data structures of these classes. # Program written by Charles Cave (charles...@optusnet.com.au) # February - March 2009 # Version 2 - June 2009 # Added support for all tags, TODO priority and checking existence of a tag # More information at #http://members.optusnet.com.au/~charles57/GTD import re, sys import datetime def makelist(filename): Read an org-mode file and return a list of Orgnode objects created from this file. ctr = 0 try: f = open(filename, 'r') except IOError: print Unable to open file [%s] % filename print Program terminating. sys.exit(1) todos = dict() # populated from #+SEQ_TODO line todos['TODO'] = '' # default values todos['DONE'] = '' # default values level = 0 heading = bodytext = tag1 = # The first tag enclosed in :: alltags = [] # list of all tags in headline sched_date= '' sched_dict= None deadline_date = '' nodelist = [] propdict = dict() for line in f: ctr += 1 hdng = re.search('^(\*+)\s(.*?)\s*$', line) if hdng: if heading: # we are processing a heading line thisNode = Orgnode(level, heading, bodytext, tag1, alltags) if
[Orgmode] Re: Links break when you archive; what are work arounds?
Thanks, that sounds like a good idea. But how do you use ID links? I see an option for descriptive links and literal links but not id links. I have org-mode version 6.34c, is that too old? Thanks, -Emin On Thu, May 13, 2010 at 10:14 AM, Bernt Hansen be...@norang.ca wrote: Emin.shopper Martinian.shopper emin.shop...@gmail.com writes: Dear Experts, I really like org-mode and am starting to use it more and more to track my notes, todos, agenda, etc. One thing I am confused about is that when I make a link to FOO and then archive FOO, the link no longer works. I guess I was hoping that org-mode would be smart enough to adjust links or look in the archive file but maybe that is too complicated. Is there a suggested work-around to preserve links when you archive something? Alternatively, maybe I'm not using archive properly. My general mode of operation is to have a file with my master to do list and another file for my daily plan (with a separate node for each day). In each day's node, I link to the master to-do list. Then when I finish a task in the master list, I archive it (which breaks the link). I would appreciate pointers to better modes of operation. Thanks, -Emin This works for me when I use id links. I created two tasks ,[ todo.org ] | * Test task | * TODO Test target ` Then linked test task to test target by doing C-c l on '* Test target' and copying the link into the body of '* Test Task' with C-c C-l This gives me this ,[ todo.org ] | * Test link | [[id:c517f8d3-9cf3-4d86-b92d-b544874ef0af][Test target]] | * TODO Test target | :PROPERTIES: | :ID: c517f8d3-9cf3-4d86-b92d-b544874ef0af | :END: ` Then I archive the Test Target ,[ todo.org_archive ] | * TODO Test target | :PROPERTIES: | :ID: c517f8d3-9cf3-4d86-b92d-b544874ef0af | :ARCHIVE_TIME: 2010-05-13 Thu 10:07 | :ARCHIVE_FILE: ~/git/org/todo.org | :ARCHIVE_CATEGORY: todo | :ARCHIVE_TODO: TODO | :ARCHIVE_ITAGS: HOME | :END: ` Now following the link from todo.org still works for me. HTH, Bernt ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Links break when you archive; what are work arounds?
That works great. Thanks! On Thu, May 13, 2010 at 1:15 PM, Bernt Hansen be...@norang.ca wrote: Emin.shopper Martinian.shopper emin.shop...@gmail.com writes: Thanks, that sounds like a good idea. But how do you use ID links? I see an option for descriptive links and literal links but not id links. I have org-mode version 6.34c, is that too old? I'm not sure if that is too old but I don't think so. You need to customize the variable 'org-modules' and enable org-id which generates globally unique ids. This automatically adds the property id entry when you create a link for a task using 'org-id-get-create' -Bernt Thanks, -Emin On Thu, May 13, 2010 at 10:14 AM, Bernt Hansen be...@norang.ca wrote: This works for me when I use id links. I created two tasks ,[ todo.org ] | * Test task | * TODO Test target ` Then linked test task to test target by doing C-c l on '* Test target' and copying the link into the body of '* Test Task' with C-c C-l This gives me this ,[ todo.org ] | * Test link | [[id:c517f8d3-9cf3-4d86-b92d-b544874ef0af][Test target]] | * TODO Test target | :PROPERTIES: | :ID: c517f8d3-9cf3-4d86-b92d-b544874ef0af | :END: ` ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] How do you control sorting in org agenda?
Dear Experts, How do you control sorting in org agenda? For example, if I have two items that have been assigned the same priority level of #A how do I control how they are sorted? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] question on missing scheduled entries in agenda
Thanks, I was not aware that I needed to customize the ical export. Thanks! On Fri, Apr 2, 2010 at 4:03 AM, David Maus dm...@ictsoc.de wrote: Emin.shopper Martinian.shopper wrote: Dear Experts, I have noticed that if I have a nested entry in an org-mode file, it does not get picked up properly in my agenda. For example, if I have something like the stuff shown below in an org-mode file and I create an agenda or export it, I sometimes get an entry for the top level item which includes the bottom level item. For example, if I do C-c C-e c and export this to an icalendar agenda then I get an entry for PLAN even though it is not schedule but I get no entry for quick morning stuff even though it is scheduled. Any thoughts on what I can do so that such scheduled items are handled properly? First let's single out the problem: Is it about iCal export or agenda display? I've tried the example and both entries show up in the agenda (M-x org-agenda RET a). For the iCal export I get: , | BEGIN:VCALENDAR | VERSION:2.0 | X-WR-CALNAME:OrgMode | PRODID:-//David Maus//Emacs with Org-mode//EN | X-WR-TIMEZONE:CEST | CALSCALE:GREGORIAN | BEGIN:VEVENT | UID: TS-b9d39029-8b23-49a4-81ea-968da38c60ad | DTSTART;VALUE=DATE:20100322 | DTEND;VALUE=DATE:20100323 | SUMMARY:PLAN :PLAN:DAILY: | DESCRIPTION: ** quick morning stuff | CATEGORIES:PLAN,DAILY,test | END:VEVENT | END:VCALENDAR ` So indeed: The scheduled subheadline doesn't get an entry but is used as description of the PLAN headline. Did you customize the iCal export properly (M-x customize-group RET org-export-icalendar RET)? If not this behavior is actually okay. There is this variable with the default setting: , | Hide Org Icalendar Use Scheduled: | [ SCHEDULED timestamps in non-TODO entries become events | [ ] SCHEDULED timestamps in TODO entries become events | [X] SCHEDULED in TODO entries become start date | State: STANDARD. | Contexts where iCalendar export should use a scheduling time stamp. More ` So SCHEDULED entries are only exported when they have a TODO keyword. HTH -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: question about org-batch-agend-csv
I may be willing to simply write something to export to an Outlook CSV format myself. Could someone point me to some docs or examples on how to write something to export org contents? Thanks, -Emin On Mon, Mar 22, 2010 at 8:37 AM, Emin.shopper Martinian.shopper emin.shop...@gmail.com wrote: Dear Experts, I have a question about org-batch-agenda-csv. I would like to be able to export my org-agenda to Microsoft outlook. Attempts to do this via ical files failed because outlook can't seem to read those properly. I tried using the export for ical discussed at http://www.mail-archive.com/emacs-orgmode@gnu.org/msg00039.html and also tried putting in a line which just said METHOD: as suggested in that thread but this didn't work. Further research suggested that outlook can read a simple csv file format to import. This led me to think that the org-batch-agenda-csv command could be easily used to produce the csv needed for outlook to import. Unfortunately, this doesn't work because when I do something like emacs -batch -eval (org-batch-agenda-csv \a\) on cygwin I get results like journal,quick morning stuff,scheduled,,plan:daily,2010-3-22,700,Scheduled:,,1099,2010-3-22 where the start time (700) is shown but the end time is not. My questions are: 1. Is there a way to get the start/end times to show up better? 2. Is there a better way to export to outlook? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] question about org-batch-agend-csv
Dear Experts, I have a question about org-batch-agenda-csv. I would like to be able to export my org-agenda to Microsoft outlook. Attempts to do this via ical files failed because outlook can't seem to read those properly. I tried using the export for ical discussed at http://www.mail-archive.com/emacs-orgmode@gnu.org/msg00039.html and also tried putting in a line which just said METHOD: as suggested in that thread but this didn't work. Further research suggested that outlook can read a simple csv file format to import. This led me to think that the org-batch-agenda-csv command could be easily used to produce the csv needed for outlook to import. Unfortunately, this doesn't work because when I do something like emacs -batch -eval (org-batch-agenda-csv \a\) on cygwin I get results like journal,quick morning stuff,scheduled,,plan:daily,2010-3-22,700,Scheduled:,,1099,2010-3-22 where the start time (700) is shown but the end time is not. My questions are: 1. Is there a way to get the start/end times to show up better? 2. Is there a better way to export to outlook? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] question on missing scheduled entries in agenda
Dear Experts, I have noticed that if I have a nested entry in an org-mode file, it does not get picked up properly in my agenda. For example, if I have something like the stuff shown below in an org-mode file and I create an agenda or export it, I sometimes get an entry for the top level item which includes the bottom level item. For example, if I do C-c C-e c and export this to an icalendar agenda then I get an entry for PLAN even though it is not schedule but I get no entry for quick morning stuff even though it is scheduled. Any thoughts on what I can do so that such scheduled items are handled properly? Thanks, -Emin example org-mode contents illustrating problem are shown below * PLAN 2010-03-22 Mon :PLAN:DAILY: ** quick morning stuff SCHEDULED: 2010-03-22 Mon 07:00-07:40 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] question about writing org-remember templates
Dear Experts, Thanks for org-mode. It's great! I have a question about org-remember templates: Is there a way to have the heading (i.e., the 5th argument in an org-remember template) chosen in a more interactive way? For example, I'd like to do something like (TODO ?t * TODO %? %^{topic} \n %i\n ~/org/todo.org Tasks/^{topic}) where the topic the user enters will get used in deciding which heading to put the item under. 1. Is this possible? 2. Is there a simple hack I can do to the latest version of org-mode to do it myself? (Pointers/suggestions to appropriate .el files appreciated) 3. Can I avoid asking the user for topic multiple times and just have the first value entered by the user used in all places? Thanks, -Emin ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode