From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Occurance property, or some similar name? Date: Wed, 13 Apr 2011 17:34:32 +0200 Message-ID: References: <87d3ksqujv.fsf@dustycloud.org> <874o63tgg5.fsf@mean.albasani.net> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QA2ij-0000fR-AB for emacs-orgmode@gnu.org; Wed, 13 Apr 2011 12:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QA2ic-0005XY-Ht for emacs-orgmode@gnu.org; Wed, 13 Apr 2011 12:15:09 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:45118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QA2ic-0005VA-13 for emacs-orgmode@gnu.org; Wed, 13 Apr 2011 12:15:02 -0400 Received: by ewy9 with SMTP id 9so240759ewy.0 for ; Wed, 13 Apr 2011 09:15:01 -0700 (PDT) In-Reply-To: <874o63tgg5.fsf@mean.albasani.net> 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: Memnon Anon , Matt Lundin Cc: emacs-orgmode@gnu.org On 12.4.2011, at 22:00, Memnon Anon wrote: > Hi, > Christopher Allan Webber writes: >=20 >> I was once one of the many people who apparently originally >> misunderstood what "SCHEDULED" meant, and used to set it to like, an >> appointment time. >=20 > Well, you can use it that way. > The point is: Scheduled items behave differently to timestamped items. > If you prefer the behaviour scheduling provides you with, go for it. >=20 >> I kind of miss how nice it was back when I misunderstood how events = work >> (escept for all of those non-TODOs staying around forever on my >> agenda..) where I had a dedicated property for this, and pressing >> C-c C-s would always change that property. >=20 > I just did a quick check.=20 > It seems to me that timestamps within a property work. > So, if you prefer, you can set your timestamps in a property like = this: >=20 > * NEXT Task 2 > :LOGBOOK: > :END: > :PROPERTIES: > :DATE: <2011-04-12> > :END: >=20 > If you want a convenient keybinding to set this property, this seems > to work: >=20 > --8<---------------cut here---------------start------------->8--- > (defun my-org-set-date () > "Set DATE Property via org-read-date." > (interactive) > (org-set-property "DATE" (concat "<"(org-read-date)">"))) >=20 > (define-key org-mode-map (kbd "C-c C-S-s") 'my-org-set-date) > --8<---------------cut here---------------end--------------->8--- >=20 > Okay, there is still setting it in the agenda. > There are already functions doing special treatment for e.g. effort. > It should work to grab it and modify it to our needs ... >=20 > --8<---------------cut here---------------start------------->8--- > (defun my-org-agenda-set-date () > "Set the DATE property for the current headline." > (interactive) > (org-agenda-check-no-diary) > (org-agenda-show) ;;; FIXME This is a stupid hack and should not be = needed > (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker) > (org-agenda-error))) > (buffer (marker-buffer hdmarker)) > (pos (marker-position hdmarker)) > (inhibit-read-only t) > newhead) > (org-with-remote-undo buffer > (with-current-buffer buffer > (widen) > (goto-char pos) > (save-excursion > (org-show-context 'agenda)) > (save-excursion > (and (outline-next-heading) > (org-flag-heading nil))) ; show the next heading > (goto-char pos) > (call-interactively 'my-org-set-date) > (end-of-line 1))))) >=20 > (define-key org-agenda-keymap (kbd "C-c C-S-s") = 'my-org-agenda-set-date) > --8<---------------cut here---------------end--------------->8--- That looks like it should work. I did some quick checking - I believe it would be possible to make DEADLINE, SCHEDULED and CLOSED properties instead of having them in the second line. You and Matt have just shown that an arbitrary property (like appointment) can serve as the standard date of an entry. The parser that is looking for CLOSED, SCHEDULED, DEADLINE is lenient and does not mind if there is an additional colon in front of the keyword. So if you have a (currently not allowed) :SCHEDULED: property, it will behave correctly when constructing the agenda. If I am not mistaken, we could introduce (not-trivial, but likely without major headaches) an option like org-planning-use-properties or so. Much will work out of the box. The places where changes are needed are these functions: org-add-planning-info org-entry-put org-entry-get org-entry-properties The main problem would be that it would not be trivial to have mixed entries - user would have to make a decision if they want planning info in the property drawer or not. Things would not work well or require a lot of extra checking with files that as mixed (agenda production would work OK, but changing dates may cause problems. But I guess this could be handled one way or another. As I have explained earlier, to have planning info like tags and the TODO keyword outside of drawers has historic reasons, but it is also good for newcomers. - Carsten >=20 > Did some quick testing, it *seems* to work. > But I have no expertise in elisp (or programming for that matter), so > this is probably "wrong" in one way or the other :). >=20 >> What I'm saying I guess is: >> - Is there a popular property name for when something should be >> happening, in a non-TODO way? I've thought of "OCCURANCE" but = maybe >> that isn't the best (I suspect not) >> - Maybe if we formalize this property, we should make a command for = it? >> Maybe C-c C-S-o? >> - It would be nice to formalize this so we could actually steer = people >> in the right direction in the docs. >=20 > Oh, this was not a "How can I do x?" mail, but a request to formalize > this in org core ....=20 >=20 > Nevermind ;) >=20 > Memnon >=20 >=20