emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [BUG] org-timestamp-change does not respect argument 'n' for minutes


From: Thorsten Jolitz
Subject: [O] [BUG] org-timestamp-change does not respect argument 'n' for minutes
Date: Wed, 22 Jan 2014 11:24:56 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]