all messages for Emacs-related lists mirrored at yhetil.org
 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

* Re: [BUG] org-timestamp-change does not respect argument 'n' for minutes
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2014-01-22 10:36 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hi Thorsten,

Thorsten Jolitz <tjolitz@gmail.com> writes:

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

I can't reproduce this.  Minutes are updated correctly.
Can you provide a recipe?

-- 
 Bastien

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

* Re: [BUG] org-timestamp-change does not respect argument 'n' for minutes
  2014-01-22 10:36 ` Bastien
@ 2014-01-22 11:28   ` Thorsten Jolitz
  2014-01-22 13:43     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Jolitz @ 2014-01-22 11:28 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

Hi Bastien,

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> 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.
>
> I can't reproduce this.  Minutes are updated correctly.
> Can you provide a recipe?

I'm on the console:

#+begin_src emacs-lisp
(message "Emacs: %s \n\nOrg: %s" (emacs-version) (org-version))
#+end_src

#+results:
: Emacs: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.6)
:  of 2014-01-18 on mnt-storage-buildroots-staging-x86_64-eric 
: 
: Org: 8.2.5g


1. Put point on the 4 in 19:34

,------------------------------
| ** Cafe <2014-01-23 Do 19:34>
`------------------------------

2. M-: (org-timestamp-up 3)

results in:

,------------------------------
| ** Cafe <2014-01-23 Do 19:35>
`------------------------------

3. cross-check that the other units work by repeating 1 and 2 with
   point on hour, month etc.


-- 
cheers,
Thorsten

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

* Re: [BUG] org-timestamp-change does not respect argument 'n' for minutes
  2014-01-22 11:28   ` Thorsten Jolitz
@ 2014-01-22 13:43     ` Bastien
  2014-01-22 14:32       ` Thorsten Jolitz
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2014-01-22 13:43 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hi Thorsten,

Thorsten Jolitz <tjolitz@gmail.com> writes:

> 2. M-: (org-timestamp-up 3)
>
> results in:
>
> ,------------------------------
> | ** Cafe <2014-01-23 Do 19:35>
> `------------------------------
>
> 3. cross-check that the other units work by repeating 1 and 2 with
>    point on hour, month etc.

Yes, because it depends on `org-time-stamp-rounding-minutes'.

-- 
 Bastien

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

* Re: [BUG] org-timestamp-change does not respect argument 'n' for minutes
  2014-01-22 13:43     ` Bastien
@ 2014-01-22 14:32       ` Thorsten Jolitz
  2014-01-22 15:01         ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Jolitz @ 2014-01-22 14:32 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Thorsten,
>
> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> 2. M-: (org-timestamp-up 3)
>>
>> results in:
>>
>> ,------------------------------
>> | ** Cafe <2014-01-23 Do 19:35>
>> `------------------------------
>>
>> 3. cross-check that the other units work by repeating 1 and 2 with
>>    point on hour, month etc.
>
> Yes, because it depends on `org-time-stamp-rounding-minutes'.

Yes, but:

,---------------------------------------------------------------------------
| org-time-stamp-rounding-minutes is a variable defined in `org.el'.
| Its value is (1 1)
|
| Original value was (0 5)
|
| Documentation:
| Number of minutes to round time stamps to.
| These are two values, the first applies when first creating a time stamp.
| The second applies when changing it with the commands `S-up' and `S-down'.
| When changing the time stamp, this means that it will change in steps
| of N minutes, as given by the second value.
|
| When a setting is 0 or 1, insert the time unmodified.  [...]
`---------------------------------------------------------------------------

If I understand this correctly,

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

should change minutes

 - up 3 units when valus is (1 1)
 - up 15 units when valus is (0 5)

?

But maybe I don't understand this correctly, its not so important
anyway, so if you think it works as intended just forget about this
'noise'.

--
cheers,
Thorsten

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

* Re: [BUG] org-timestamp-change does not respect argument 'n' for minutes
  2014-01-22 14:32       ` Thorsten Jolitz
@ 2014-01-22 15:01         ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2014-01-22 15:01 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> ,-------------------------
> | M-: (org-timestamp-up 3)
> `-------------------------

The "3" here means 3 minutes, not "3 steps up", so the rounding
happens after minutes have been added.

> should change minutes
>
>  - up 3 units when valus is (1 1)
>  - up 15 units when valus is (0 5)
>
> ?
>
> But maybe I don't understand this correctly, its not so important
> anyway, so if you think it works as intended just forget about this
> 'noise'.

Done :)

-- 
 Bastien

^ 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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.