Re: [O] Is it possible to automatically set the timestamp recorded in a CLOSED: annotation to a different time than now?

2012-09-19 Thread Gaizka Villate
Wow!

It works great! Thanks a lot!!

-- Gaizka

El día 19/09/12 11:37 +0200, Bastien escribió: 
 Hi Gaizka,
 
 Gaizka Villate gaiz...@gmail.com writes:
 
  I then adjust it manually to set it to the last clocked-out timestamp
  (which, for me, is the last time I spent working on it).
 
 I introduced `org-use-last-clock-out-time-as-effective-time' which lets
 you do this automatically.  You can test it from the git master branch
 for now, it will be in the next major release.
 
 Thanks for this idea!
 



[O] Is it possible to automatically set the timestamp recorded in a CLOSED: annotation to a different time than now?

2012-09-12 Thread Gaizka Villate
Hi there!

I'd like to accomplish this. If anybody can tell me at least if that's a 
feasible thing to do with org-mode, i'll try to develop it myself :)

I log time spent in my tasks (with org-clock), which I usually leave in STARTED 
state (because maybe there was a bug in my code, and I'd need to spend more 
time with them.

At the end of the week, or maybe the next week I go through all STARTED tasks 
and start closing them.

What happens (and that's a normal behaviour) is that the task gets a CLOSED 
timestamp with right now's date and time.

I then adjust it manually to set it to the last clocked-out timestamp (which, 
for me, is the last time I spent working on it).

Would it possible to customize org-mode to do this? Does it even make sense?

I guess I'd have to change this lines of org-todo:

  (when (and now-done-p org-log-done)
;; It is now done, and it was not done before
(org-add-planning-info 'closed (org-current-effective-time))
(if (and (not dolog) (eq 'note org-log-done))
(org-add-log-setup 'done org-state this 'findpos 'note)))
  (when (and org-state dolog)
;; This is a non-nil state, and we need to log it
(org-add-log-setup 'state org-state this 'findpos dolog)))

To call org-current-effective-time with an extra param that takes last 
timestamped clock's end time and returns it instead of org-current-time.

(defun org-current-effective-time ()
  Return current time adjusted for `org-extend-today-until' variable
  (let* ((ct (org-current-time))
  (dct (decode-time ct))
  (ct1
   (if (and org-use-effective-time
( (nth 2 dct) org-extend-today-until))
   (encode-time 0 59 23 (1- (nth 3 dct)) (nth 4 dct) (nth 5 dct))
 ct)))
ct1))


How could I get last timestamped clock's end time?

Thanks a lot for your help, and thanks even more for org-mode!!

-- Gaizka



[Orgmode] [PATCH] Add 2 customizations to org-annotation-helper: template-shortcut, auto-finalize-remember

2009-08-21 Thread Gaizka Villate
Hi there!

I have added a couple of customization variables to org-annotation-helper:

Add 2 customizations to org-annotation-helper: template-shortcut, 
auto-finalize-remember

- org-annotation-helper-template-shortcut : So you can choose which
  shortcut to use with org-annotation (I already use ?w for work
  template)

- org-annotation-helper-auto-finalize-remember:
  Set to true if you want org-annotation-helper to call 
org-remember-finalize after filling the template.


Maybe somebody is interested in applying the patch.

¡¡Thanks for org-mode!! ¡¡It's awesome!!

-- Gaizka
From 072fdb4c5377b9c0151963f24095bb2949b3be64 Mon Sep 17 00:00:00 2001
From: Gaizka Villate gaiz...@gmail.com
Date: Thu, 20 Aug 2009 16:28:09 +0200
Subject: [PATCH] Add 2 customizations to org-annotation-helper: template-shortcut, auto-finalize-remember

- org-annotation-helper-template-shortcut : So you can choose which
  shortcut to use with org-annotation (I already use ?w for work
  template)

- org-annotation-helper-auto-finalize-remember:
  Set to true if you want org-annotation-helper to call org-remember-finalize after filling the template.
---
 contrib/lisp/org-annotation-helper.el |   23 +--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-annotation-helper.el b/contrib/lisp/org-annotation-helper.el
index c90233f..e71ba2e 100644
--- a/contrib/lisp/org-annotation-helper.el
+++ b/contrib/lisp/org-annotation-helper.el
@@ -265,6 +265,23 @@
 
 (autoload 'url-unhex-string url)
 
+(defgroup org-annotation nil
+  Org annotation helper customization.
+  :tag Org Annotation
+  :group 'org)
+
+(defcustom org-annotation-helper-template-shortcut ?w
+  Character shortcut for the remember template you want to use.
+  :group 'org-annotation
+  :type 'character)
+
+(defcustom org-annotation-helper-auto-finalize-remember nil
+  Set to true if you want org-annotation-helper to call org-remember-finalize
+  after filling the template.
+  I use it that way, so I can create tasks automatically without human interaction
+  :group 'org-annotation
+  :type 'boolean)
+
 (defun bzg/org-annotation-helper (info)
   Process an externally passed remember:// style url.
 
@@ -307,8 +324,10 @@ annotation://   squirrel away a link of the form [[url][title]] that can
 	   (set-mark (point))
 	   (insert region)
(exchange-point-and-mark t) ;; activate region.. not always on by default
-   (org-remember nil ?w)
-   (kill-buffer b)   
+   (org-remember nil org-annotation-helper-template-shortcut)
+   (kill-buffer b)
+			   (if org-annotation-helper-auto-finalize-remember
+   (org-remember-finalize))
)
   ((equal proto annotation)
(message Copied '%s' to the kill-ring. orglink)
-- 
1.6.1.3

___
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