emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to change CREATED property value to inactive in org-expiry
@ 2009-12-26 19:11 Manish
  2009-12-27  9:07 ` David Maus
  2009-12-27  9:08 ` David Maus
  0 siblings, 2 replies; 7+ messages in thread
From: Manish @ 2009-12-26 19:11 UTC (permalink / raw)
  To: Org-Mode

Hello!

I have just spent an hour trying to figure out how to change the
timestamp added as a result of org-expiry-insinuate to inactive with
no success.  It seems to me that I need to change something in
function org-expiry-insert-created but don't know what.  I also do not
understand in which situations does an active timestamp for CREATED
property make sense.

Thanks!
-- 
Manish

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-26 19:11 How to change CREATED property value to inactive in org-expiry Manish
@ 2009-12-27  9:07 ` David Maus
  2009-12-29 11:30   ` Bastien
  2009-12-27  9:08 ` David Maus
  1 sibling, 1 reply; 7+ messages in thread
From: David Maus @ 2009-12-27  9:07 UTC (permalink / raw)
  To: Manish; +Cc: Org-Mode

Hi Manish,

At Sun, 27 Dec 2009 00:41:15 +0530,
Manish wrote:
> I have just spent an hour trying to figure out how to change the
> timestamp added as a result of org-expiry-insinuate to inactive with
> no success.  It seems to me that I need to change something in
> function org-expiry-insert-created but don't know what.  I also do not
> understand in which situations does an active timestamp for CREATED
> property make sense.

I recently started to patch org-expiry.el and enabling inactive
timestamps was the first thing I patched. The modified version is on
the expiry+ branch in a copy of org-mode @github.com:

http://github.com/dmj/org-mode/tree/expiry+

I hope I got the git-things rights this time so fetching and merging
it with a local branch of the original should work.

Next thing on my list is to toggle auto inserting of the creation date
for Todo headlines only.

Regards

 -- David

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com
ICQ....... 241051416

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-26 19:11 How to change CREATED property value to inactive in org-expiry Manish
  2009-12-27  9:07 ` David Maus
@ 2009-12-27  9:08 ` David Maus
  2009-12-27 10:50   ` Manish
  1 sibling, 1 reply; 7+ messages in thread
From: David Maus @ 2009-12-27  9:08 UTC (permalink / raw)
  To: Manish; +Cc: Org-Mode

Ah, forgot: To enable inactive timestamps when using the expiry+
branch simply set the variable `org-expiry-inactive-timestamps' to t.

Regards

 -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com
ICQ....... 241051416

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-27  9:08 ` David Maus
@ 2009-12-27 10:50   ` Manish
  2009-12-28 18:48     ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Manish @ 2009-12-27 10:50 UTC (permalink / raw)
  To: David Maus; +Cc: Org-Mode

Manish>> I have just spent an hour trying to figure out how to change
Manish>> the timestamp added as a result of org-expiry-insinuate to
Manish>> inactive with no success.  It seems to me that I need to
Manish>> change something in function org-expiry-insert-created but
Manish>> don't know what.  I also do not understand in which
Manish>> situations does an active timestamp for CREATED property make
Manish>> sense.

David> I recently started to patch org-expiry.el and enabling inactive
David> timestamps was the first thing I patched. The modified version
David> is on the expiry+ branch in a copy of org-mode @github.com:
David>
David> http://github.com/dmj/org-mode/tree/expiry+
David>
David> I hope I got the git-things rights this time so fetching and
David> merging it with a local branch of the original should work.
David>
David> Next thing on my list is to toggle auto inserting of the
David> creation date for Todo headlines only.
David>
David> To enable inactive timestamps when using the expiry+ branch
David> simply set the variable `org-expiry-inactive-timestamps' to t.

Works as advertised. :)  Hope the patch makes it to org-mode soon.

Thank you.
Best regards
-- 
Manish

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-27 10:50   ` Manish
@ 2009-12-28 18:48     ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-12-28 18:48 UTC (permalink / raw)
  To: Manish; +Cc: Org-Mode


On Dec 27, 2009, at 11:50 AM, Manish wrote:

> Manish>> I have just spent an hour trying to figure out how to change
> Manish>> the timestamp added as a result of org-expiry-insinuate to
> Manish>> inactive with no success.  It seems to me that I need to
> Manish>> change something in function org-expiry-insert-created but
> Manish>> don't know what.  I also do not understand in which
> Manish>> situations does an active timestamp for CREATED property make
> Manish>> sense.
>
> David> I recently started to patch org-expiry.el and enabling inactive
> David> timestamps was the first thing I patched. The modified version
> David> is on the expiry+ branch in a copy of org-mode @github.com:
> David>
> David> http://github.com/dmj/org-mode/tree/expiry+
> David>
> David> I hope I got the git-things rights this time so fetching and
> David> merging it with a local branch of the original should work.
> David>
> David> Next thing on my list is to toggle auto inserting of the
> David> creation date for Todo headlines only.
> David>
> David> To enable inactive timestamps when using the expiry+ branch
> David> simply set the variable `org-expiry-inactive-timestamps' to t.
>
> Works as advertised. :)  Hope the patch makes it to org-mode soon.

Hi,

Please contact Bastien about this.

- Carsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-27  9:07 ` David Maus
@ 2009-12-29 11:30   ` Bastien
  2009-12-31  9:54     ` David Maus
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2009-12-29 11:30 UTC (permalink / raw)
  To: David Maus; +Cc: Org-Mode

Hi David,

David Maus <maus.david@gmail.com> writes:

> I recently started to patch org-expiry.el and enabling inactive
> timestamps was the first thing I patched. The modified version is on
> the expiry+ branch in a copy of org-mode @github.com:
>
> http://github.com/dmj/org-mode/tree/expiry+

Looks nice - please send me the patch and I'll review it for inclusion.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to change CREATED property value to inactive in org-expiry
  2009-12-29 11:30   ` Bastien
@ 2009-12-31  9:54     ` David Maus
  0 siblings, 0 replies; 7+ messages in thread
From: David Maus @ 2009-12-31  9:54 UTC (permalink / raw)
  To: Bastien; +Cc: Org-Mode


[-- Attachment #1.1.1: Type: text/plain, Size: 540 bytes --]

Hi Bastien,

I attached the two patches:

  - 0001: Use `org-time-string-to-time' to convert timestamps to time objects

  - 0002: Allow inactive timestamps

I am currently pondering whether or not it could be useful to limit
the creation of the created timestamp to todo headlines only. At least
for me a created timestamp does not make sense for a headline that is,
say, part of a document's outline.

Regards

 -- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com
ICQ....... 241051416


[-- Attachment #1.1.2: 0001-Use-org-time-string-to-time-to-convert-timestamp-to-.patch --]
[-- Type: application/octet-stream, Size: 1306 bytes --]

From 4b85f7907fe91e3594191ef17e84cebd10073b74 Mon Sep 17 00:00:00 2001
From: David Maus <maus.david@gmail.com>
Date: Sat, 26 Dec 2009 22:14:34 +0100
Subject: [PATCH 1/2] Use `org-time-string-to-time' to convert timestamp to time object.

---
 contrib/lisp/org-expiry.el |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el
index 2a6998a..41fb91c 100644
--- a/contrib/lisp/org-expiry.el
+++ b/contrib/lisp/org-expiry.el
@@ -286,8 +286,7 @@ update the date."
 	 d-time d-hour)
     (when (or (null d) arg)
       ;; update if no date or non-nil prefix argument
-      ;; FIXME Use `org-time-string-to-time' 
-      (setq d-time (if d (apply 'encode-time (org-parse-time-string d))
+      (setq d-time (if d (org-time-string-to-time d)
 		     (current-time)))
       (setq d-hour (format-time-string "%H:%M" d-time))
       (save-excursion
@@ -306,7 +305,7 @@ and insert today's date."
   (interactive "P")
   (let* ((d (org-entry-get (point) org-expiry-expiry-property-name))
 	 d-time d-hour)
-    (setq d-time (if d (apply 'encode-time (org-parse-time-string d))
+    (setq d-time (if d (org-time-string-to-time d)
 		   (current-time)))
     (setq d-hour (format-time-string "%H:%M" d-time))
     (save-excursion
-- 
1.6.5


[-- Attachment #1.1.3: 0002-Allow-inactive-timestamps-for-created-and-expired-ti.patch --]
[-- Type: application/octet-stream, Size: 3270 bytes --]

From 227625cd27bce8a7e9847df0f3773f6d41356314 Mon Sep 17 00:00:00 2001
From: David Maus <maus.david@gmail.com>
Date: Sun, 27 Dec 2009 09:45:03 +0100
Subject: [PATCH 2/2] Allow inactive timestamps for created and expired timestamps.

Add customization variable `org-expiry-inactive-timestamps'. If set to
to, org-expiry creation and expiration date as inactive timestamps.

This may be useful as entries with active timestamps are shown in the
agenda and hence may clutter up the agenda view.
---
 contrib/lisp/org-expiry.el |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el
index 41fb91c..3be8adb 100644
--- a/contrib/lisp/org-expiry.el
+++ b/contrib/lisp/org-expiry.el
@@ -81,6 +81,11 @@
   :tag "Org Expiry"
   :group 'org)
 
+(defcustom org-expiry-inactive-timestamps nil
+  "Insert inactive timestamps of created and expired time."
+  :type 'boolean
+  :group 'org-expiry)
+
 (defcustom org-expiry-created-property-name "CREATED"
   "The name of the property for setting the creation date."
   :type 'string
@@ -283,20 +288,24 @@ to today's date.  With two `C-u' prefixes, prompt the user for to
 update the date."
   (interactive "P")
   (let* ((d (org-entry-get (point) org-expiry-created-property-name))
-	 d-time d-hour)
+	 d-time d-hour timestr)
     (when (or (null d) arg)
       ;; update if no date or non-nil prefix argument
       (setq d-time (if d (org-time-string-to-time d)
 		     (current-time)))
       (setq d-hour (format-time-string "%H:%M" d-time))
+      (setq timestr
+	    ;; two C-u prefixes will call org-read-date
+	    (if (equal arg '(16))
+		(concat "<" (org-read-date
+			     nil nil nil nil d-time d-hour) ">")
+	      (format-time-string (cdr org-time-stamp-formats))))
+      ;; maybe transform to inactive timestamp
+      (if org-expiry-inactive-timestamps
+	  (setq timestr (concat "[" (substring timestr 1 -1) "]")))
       (save-excursion
 	(org-entry-put
-	 (point) org-expiry-created-property-name
-	 ;; two C-u prefixes will call org-read-date
-	 (if (equal arg '(16))
-	     (concat "<" (org-read-date
-			  nil nil nil nil d-time d-hour) ">")
-	   (format-time-string (cdr org-time-stamp-formats))))))))
+	 (point) org-expiry-created-property-name timestr)))))
 
 (defun org-expiry-insert-expiry (&optional today)
   "Insert a property with the expiry date.
@@ -308,12 +317,16 @@ and insert today's date."
     (setq d-time (if d (org-time-string-to-time d)
 		   (current-time)))
     (setq d-hour (format-time-string "%H:%M" d-time))
+    (setq timestr (if today
+		      (format-time-string (cdr org-time-stamp-formats))
+		    (concat "<" (org-read-date
+				 nil nil nil nil d-time d-hour) ">")))
+    ;; maybe transform to inactive timestamp
+    (if org-expiry-inactive-timestamps
+	(setq timestr (concat "[" (substring timestr 1 -1) "]")))
     (save-excursion
       (org-entry-put
-       (point) org-expiry-expiry-property-name
-       (if today (format-time-string (cdr org-time-stamp-formats))
-	 (concat "<" (org-read-date
-		      nil nil nil nil d-time d-hour) ">"))))))
+       (point) org-expiry-expiry-property-name timestr))))
 
 ;;; Functions to process expired entries:
 
-- 
1.6.5


[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-12-31  9:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-26 19:11 How to change CREATED property value to inactive in org-expiry Manish
2009-12-27  9:07 ` David Maus
2009-12-29 11:30   ` Bastien
2009-12-31  9:54     ` David Maus
2009-12-27  9:08 ` David Maus
2009-12-27 10:50   ` Manish
2009-12-28 18:48     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).