emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Puneeth <punchagan@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] org-timestamp-change changes minutes in multiples of rounding time
Date: Tue, 22 Jun 2010 16:40:52 +0530	[thread overview]
Message-ID: <AANLkTinLwPi_kLCjXFRWnklui10Si4ppuKh-F7JAX_fw@mail.gmail.com> (raw)

[-- 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

             reply	other threads:[~2010-06-22 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 11:10 Puneeth [this message]
2010-06-22 12:22 ` [PATCH] org-timestamp-change changes minutes in multiples of rounding time 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinLwPi_kLCjXFRWnklui10Si4ppuKh-F7JAX_fw@mail.gmail.com \
    --to=punchagan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).