emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-timestamp-{down,up} with numeric argument on time range modifies length [9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]
@ 2021-08-21 21:46 Jorge P. de Morais Neto
  2021-08-22  0:59 ` Tim Cross
  0 siblings, 1 reply; 3+ messages in thread
From: Jorge P. de Morais Neto @ 2021-08-21 21:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Correctly-handle-org-log-note-clock-out-non-interact.patch --]
[-- Type: text/x-diff, Size: 1126 bytes --]

From 7dc855ae1d7992eaacc2cab13a39c6000e4e66bf Mon Sep 17 00:00:00 2001
Message-Id: <7dc855ae1d7992eaacc2cab13a39c6000e4e66bf.1622468529.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Mon, 31 May 2021 21:39:51 +0800
Subject: [PATCH] Correctly handle org-log-note-clock-out non-interactively

* org-clock.el (org-clock-out): Delay log popup to
after-command-hook to avoid messing up non-interactive calls.
`org-add-log-setup' without 'note argument would raise interactive
note buffer immediately, so we do pass the 'note argument.
---
 org-clock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-clock.el b/org-clock.el
index 3b7d97639..0328bddd3 100644
--- a/org-clock.el
+++ b/org-clock.el
@@ -1691,7 +1691,7 @@ (defun org-clock-out (&optional switch-to-state fail-quietly at-time)
 				(line-beginning-position 2)))
 		(org-log-note-clock-out
 		 (org-add-log-setup
-		  'clock-out nil nil nil
+		  'clock-out nil nil 'note
 		  (concat "# Task: " (org-get-heading t) "\n\n"))))
 	  (when org-clock-mode-line-timer
 	    (cancel-timer org-clock-mode-line-timer)
-- 
2.26.3


[-- Attachment #2: Type: text/plain, Size: 1755 bytes --]

Hello everyone!  The manual says:


‘S-<UP>’ (‘org-timestamp-up’)
‘S-<DOWN>’ (‘org-timestamp-down’)
     On the beginning or enclosing bracket of a timestamp, change its
     type.  Within a timestamp, change the item under point.  Point can
     be on a year, month, day, hour or minute.  When the timestamp
     contains a time range like ‘15:30-16:30’, modifying the first time
     also shifts the second, shifting the time block with constant
     length. [...]

However, on the timestamp [2021-08-21 sáb 10:00-12:00], with point right
after the first colon, typing C-u 42 S-<up> results in
[2021-08-21 sáb 10:42-12:05].  The problem also occurs with S-<down>.

This occurs on GNU Emacs 28.0.50 installed with
~guix package --with-branch=emacs-next=master -i emacs-next~
(upgraded last Thursday morning), invoked as ~emacs -q~.  Note that on
my Guix-installed Emacs, an ~emacs -q~ does load the emacs-org Guix
package (version 9.4.6).  Note also that my Org Mode has been patched
with Ihor Radchenko's patch to org-clock.el (attached), but it clearly
can't influence this problem.

Regards

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
Package: Org mode version 9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)
-- 
- Disinformation flourishes because many people care about injustice
  but very few check the facts.  Ask me about <https://stallmansupport.org>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Free Software Supporter: https://www.fsf.org/free-software-supporter
- If an email of mine arrives at your spam box, please notify me.

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

* Re: Bug: org-timestamp-{down,up} with numeric argument on time range modifies length [9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]
  2021-08-21 21:46 Bug: org-timestamp-{down,up} with numeric argument on time range modifies length [9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)] Jorge P. de Morais Neto
@ 2021-08-22  0:59 ` Tim Cross
  2023-09-19 12:42   ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Cross @ 2021-08-22  0:59 UTC (permalink / raw)
  To: emacs-orgmode


Confirm.

I am able to confirm this bug using Emacs 27.2 and org 9.4.6 from ELPA.

It seems that when changing the first time interval with a C-u argument
to set the amount of change, the units are not applied to the second
time in the interval, it always changes by 5. So

[2021-08-22 Sun 10:00-11:00] with S-<up> gives
[2021-08-22 Sun 10:05-11:05]

but 

[2021-08-22 Sun 10:00-11:00] with C-u 42 S-<up> gives
[2021-08-22 Sun 10:42-11:05]

and

[2021-08-22 Sun 10:00-11:00] with C-u 42 S-<down> gives
[2021-08-22 Sun 10:18-11:55]

the size of the change units does not need to be 42. Problem exists with
any unit > 5.

Note that this issue seems to only be applied to minutes. The hours
change looks to be correct.

"Jorge P. de Morais Neto" <jorge+list@disroot.org> writes:

> [1. text/x-diff; 0001-Correctly-handle-org-log-note-clock-out-non-interact.patch]...
>
> Hello everyone!  The manual says:
>
>
> ‘S-<UP>’ (‘org-timestamp-up’)
> ‘S-<DOWN>’ (‘org-timestamp-down’)
>      On the beginning or enclosing bracket of a timestamp, change its
>      type.  Within a timestamp, change the item under point.  Point can
>      be on a year, month, day, hour or minute.  When the timestamp
>      contains a time range like ‘15:30-16:30’, modifying the first time
>      also shifts the second, shifting the time block with constant
>      length. [...]
>
> However, on the timestamp [2021-08-21 sáb 10:00-12:00], with point right
> after the first colon, typing C-u 42 S-<up> results in
> [2021-08-21 sáb 10:42-12:05].  The problem also occurs with S-<down>.
>
> This occurs on GNU Emacs 28.0.50 installed with
> ~guix package --with-branch=emacs-next=master -i emacs-next~
> (upgraded last Thursday morning), invoked as ~emacs -q~.  Note that on
> my Guix-installed Emacs, an ~emacs -q~ does load the emacs-org Guix
> package (version 9.4.6).  Note also that my Org Mode has been patched
> with Ihor Radchenko's patch to org-clock.el (attached), but it clearly
> can't influence this problem.
>
> Regards
>
> Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
> Package: Org mode version 9.4.6 (9.4.6-gab9f2a @
> /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)



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

* Re: Bug: org-timestamp-{down,up} with numeric argument on time range modifies length [9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]
  2021-08-22  0:59 ` Tim Cross
@ 2023-09-19 12:42   ` Ihor Radchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2023-09-19 12:42 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> [2021-08-22 Sun 10:00-11:00] with C-u 42 S-<up> gives
> [2021-08-22 Sun 10:42-11:05]

Fixed, on main.
That code is a headache to read...
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6c917e890

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2023-09-19 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-21 21:46 Bug: org-timestamp-{down,up} with numeric argument on time range modifies length [9.4.6 (9.4.6-gab9f2a @ /gnu/store/yg6kjzigqyfzbkzj99xmwmv3nssvhvnq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)] Jorge P. de Morais Neto
2021-08-22  0:59 ` Tim Cross
2023-09-19 12:42   ` Ihor Radchenko

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