emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-timestamp-change does not respect argument 'n' for minutes
@ 2014-01-22 10:24 Thorsten Jolitz
  2014-01-22 10:36 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Jolitz @ 2014-01-22 10:24 UTC (permalink / raw)
  To: emacs-orgmode


Bug or feature?

Why is there this special handling of minutes? Evaluating

,---------------------
| (org-timestamp-up 3)
`---------------------

with point on year, month, day, hour works as expected (3 units up), but
not with point on minute. There it's always a 1 unit change due to this
code snippet from org.el:

#+begin_src emacs-lisp
   (defun org-timestamp-change
     (n &optional what updown suppress-tmp-delay)
     ;; n => 3 in this case, what => minute
     [...]
      (when (and updown
                 (eq org-ts-what 'minute)
                 (not current-prefix-arg))
        ;; This looks like s-up and s-down.  Change by one rounding step.
        (setq n (* dm (cond ((> n 0) 1) ((< n 0) -1) (t 0)))) ; Why?
        (when (not (= 0 (setq rem (% (nth 1 time0) dm))))
          (setcar (cdr time0) (+ (nth 1 time0)
                                 (if (> n 0) (- rem) (- dm rem))))))
      [...]
      )
#+end_src

--
cheers,
Thorsten

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

end of thread, other threads:[~2014-01-22 15:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 10:24 [BUG] org-timestamp-change does not respect argument 'n' for minutes Thorsten Jolitz
2014-01-22 10:36 ` Bastien
2014-01-22 11:28   ` Thorsten Jolitz
2014-01-22 13:43     ` Bastien
2014-01-22 14:32       ` Thorsten Jolitz
2014-01-22 15:01         ` Bastien

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