emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-timestamp-change changes minutes in multiples of rounding time
@ 2010-06-22 11:10 Puneeth
  2010-06-22 12:22 ` Puneeth
  2010-06-22 13:33 ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: Puneeth @ 2010-06-22 11:10 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

Hi,

(org-timestamp-change n 'minutes) changes timestamp only by 5 minutes
(when my org-time-stamp-rounding-minutes is (0 5)) for any non-zero
value of n.

I think the timestamp should change by an integer multiple of 5. Do
you think this is correct behaviour?

A patch for the same has been attached.

Thanks,
Puneeth

[-- Attachment #2: org-timestamp-change.patch --]
[-- Type: application/octet-stream, Size: 589 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index e25194c..b4d2bd7 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14981,7 +14981,8 @@ in the timestamp determines what will be changed."
       (setq time0 (org-parse-time-string ts))
       (when (and (eq org-ts-what 'minute)
 		 (eq current-prefix-arg nil))
-	(setq n (* dm (cond ((> n 0) 1) ((< n 0) -1) (t 0))))
+	(setq n (* dm (cond ((> n 0) (max (/ n dm) 1)) 
+			    ((< n 0) (min (/ n dm) -1)) (t 0))))
 	(when (not (= 0 (setq rem (% (nth 1 time0) dm))))
 	  (setcar (cdr time0) (+ (nth 1 time0)
 				 (if (> n 0) (- rem) (- dm rem))))))

[-- Attachment #3: 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] 6+ messages in thread

end of thread, other threads:[~2010-06-22 14:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 11:10 [PATCH] org-timestamp-change changes minutes in multiples of rounding time Puneeth
2010-06-22 12:22 ` Puneeth
2010-06-22 13:33 ` Carsten Dominik
2010-06-22 13:48   ` Puneeth
2010-06-22 14:17     ` Carsten Dominik
2010-06-22 14:46       ` Puneeth

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).