emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bi-monthly steps.
@ 2020-03-12 11:17 Christian Hopps
  2020-03-12 18:15 ` Nick Dokos
  0 siblings, 1 reply; 12+ messages in thread
From: Christian Hopps @ 2020-03-12 11:17 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: chopps

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]



I've the need to display bimonthly clock tables, I was able to add this pretty easy in case the project would find it useful

--- org-clock.el	2020-03-12 06:52:14.000000000 -0400
+++ /Users/chopps/org-clock.el	2020-03-12 06:51:43.000000000 -0400
@@ -2719,6 +2719,7 @@
           (pcase step
             (`day "Daily report: ")
             (`week "Weekly report starting on: ")
+            (`bimonth "Bi-Monthly report starting on: ")
             (`month "Monthly report starting on: ")
             (`year "Annual report starting on: ")
             (_ (user-error "Unknown `:step' specification: %S" step))))
@@ -2768,6 +2769,7 @@
                           (let ((offset (if (= dow week-start) 7
                                           (mod (- week-start dow) 7))))
                             (list 0 0 org-extend-today-until (+ d offset) m y)))
+                         (`bimonth (list 0 0 0 (if (< d 16) 16 1) (if (< d 16) m (1+ m)) y))
                          (`month (list 0 0 0 month-start (1+ m) y))
                          (`year (list 0 0 org-extend-today-until 1 1 (1+ y)))))))
              (table-begin (line-beginning-position 0))

Thanks,
Chris.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: bi-monthly steps.
  2020-03-12 11:17 bi-monthly steps Christian Hopps
@ 2020-03-12 18:15 ` Nick Dokos
  2020-03-12 22:55   ` Christian Hopps
  2020-03-13  4:47   ` Peter Neilson
  0 siblings, 2 replies; 12+ messages in thread
From: Nick Dokos @ 2020-03-12 18:15 UTC (permalink / raw)
  To: emacs-orgmode

"Bi-monthly" is ambiguous: it can mean twice a month or it can mean
once every two months and there is no convincing anybody that their
use of it is wrong :-)

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: bi-monthly steps.
  2020-03-12 18:15 ` Nick Dokos
@ 2020-03-12 22:55   ` Christian Hopps
  2020-03-13  8:01     ` Michal Politowski
  2020-03-13  4:47   ` Peter Neilson
  1 sibling, 1 reply; 12+ messages in thread
From: Christian Hopps @ 2020-03-12 22:55 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Christian Hopps, emacs-orgmode

could use semimonth then :)

> On Mar 12, 2020, at 2:15 PM, Nick Dokos <ndokos@gmail.com> wrote:
> 
> "Bi-monthly" is ambiguous: it can mean twice a month or it can mean
> once every two months and there is no convincing anybody that their
> use of it is wrong :-)
> 
> -- 
> Nick
> 
> "There are only two hard problems in computer science: cache
> invalidation, naming things, and off-by-one errors." -Martin Fowler
> 
> 

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

* Re: bi-monthly steps.
  2020-03-12 18:15 ` Nick Dokos
  2020-03-12 22:55   ` Christian Hopps
@ 2020-03-13  4:47   ` Peter Neilson
  2020-03-13  6:59     ` Eric S Fraga
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Neilson @ 2020-03-13  4:47 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, 12 Mar 2020 14:15:04 -0400, Nick Dokos <ndokos@gmail.com> wrote:

> "Bi-monthly" is ambiguous: it can mean twice a month or it can mean
> once every two months and there is no convincing anybody that their
> use of it is wrong :-)

Exactly true. "Bi-weekly" is nearly as ambiguous, but is rescued by an  
ensuing discussion: "Which two days of the week did you want (the event)  
to occur?" "Um, ah, I mean every two weeks." "Fine then, let's say that."

I think the original question from Christian Hopps presumes the meaning,  
"Every two months."

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

* Re: bi-monthly steps.
  2020-03-13  4:47   ` Peter Neilson
@ 2020-03-13  6:59     ` Eric S Fraga
  2020-03-13  7:14       ` Loris Bennett
  0 siblings, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2020-03-13  6:59 UTC (permalink / raw)
  To: Peter Neilson; +Cc: emacs-orgmode

On Friday, 13 Mar 2020 at 00:47, Peter Neilson wrote:
> I think the original question from Christian Hopps presumes the
> meaning, "Every two months."

Oh, I took it to mean bi-weekly. ;-)

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-412-ge18415

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

* Re: bi-monthly steps.
  2020-03-13  6:59     ` Eric S Fraga
@ 2020-03-13  7:14       ` Loris Bennett
  2020-03-13  9:51         ` semimonthly steps [Re: bi-monthly steps.] Christian Hopps
  0 siblings, 1 reply; 12+ messages in thread
From: Loris Bennett @ 2020-03-13  7:14 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday, 13 Mar 2020 at 00:47, Peter Neilson wrote:
>> I think the original question from Christian Hopps presumes the
>> meaning, "Every two months."
>
> Oh, I took it to mean bi-weekly. ;-)

Exactly.  So "bi-monthly" just means "twice a week".  I'm sure we can all
agree on that :-)

-- 
This signature is currently under construction.

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

* Re: bi-monthly steps.
  2020-03-12 22:55   ` Christian Hopps
@ 2020-03-13  8:01     ` Michal Politowski
  2020-03-13 12:14       ` Peter Neilson
  0 siblings, 1 reply; 12+ messages in thread
From: Michal Politowski @ 2020-03-13  8:01 UTC (permalink / raw)
  To: emacs-orgmode

Fortnightly :)
Such a useful word.

On Thu, 12 Mar 2020 18:55:16 -0400, Christian Hopps wrote:
> could use semimonth then :)
> 
> > On Mar 12, 2020, at 2:15 PM, Nick Dokos <ndokos@gmail.com> wrote:
> > 
> > "Bi-monthly" is ambiguous: it can mean twice a month or it can mean
> > once every two months and there is no convincing anybody that their
> > use of it is wrong :-)
> > 
> > -- 
> > Nick
> > 
> > "There are only two hard problems in computer science: cache
> > invalidation, naming things, and off-by-one errors." -Martin Fowler

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.

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

* semimonthly steps [Re: bi-monthly steps.]
  2020-03-13  7:14       ` Loris Bennett
@ 2020-03-13  9:51         ` Christian Hopps
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Hopps @ 2020-03-13  9:51 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: chopps

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]


FWIW the code was actually unambiguous. :)

I meant "semimonthly" or twice a month (i.e., like some people get paid: 1-15th, 16th-endofmonth).

Thanks,
Chris.

Loris Bennett <loris.bennett@fu-berlin.de> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> On Friday, 13 Mar 2020 at 00:47, Peter Neilson wrote:
>>> I think the original question from Christian Hopps presumes the
>>> meaning, "Every two months."
>>
>> Oh, I took it to mean bi-weekly. ;-)
>
> Exactly.  So "bi-monthly" just means "twice a week".  I'm sure we can all
> agree on that :-)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: bi-monthly steps.
  2020-03-13  8:01     ` Michal Politowski
@ 2020-03-13 12:14       ` Peter Neilson
  2020-03-26 11:33         ` Christian Hopps
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Neilson @ 2020-03-13 12:14 UTC (permalink / raw)
  To: emacs-orgmode

On Fri, 13 Mar 2020 04:01:43 -0400, Michal Politowski <mpol@meep.pl> wrote:

> Fortnightly :)
> Such a useful word.

There are 24 semi-months in a year. There are roughly 26 fortnights.

American English seem to allow the adverb semimonthly but generally avoids  
the
British term fortnightly.

There ought to be an unnecessary book English Made Difficult as a  
companion piece to Carl E. Linderholm's book Mathematics Made Difficult.

>
> On Thu, 12 Mar 2020 18:55:16 -0400, Christian Hopps wrote:
>> could use semimonth then :)
>>
>> > On Mar 12, 2020, at 2:15 PM, Nick Dokos <ndokos@gmail.com> wrote:
>> >
>> > "Bi-monthly" is ambiguous: it can mean twice a month or it can mean
>> > once every two months and there is no convincing anybody that their
>> > use of it is wrong :-)
>> >
>> > --
>> > Nick
>> >
>> > "There are only two hard problems in computer science: cache
>> > invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: bi-monthly steps.
  2020-03-13 12:14       ` Peter Neilson
@ 2020-03-26 11:33         ` Christian Hopps
  2020-03-27  1:12           ` Kyle Meyer
  0 siblings, 1 reply; 12+ messages in thread
From: Christian Hopps @ 2020-03-26 11:33 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Christian Hopps

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

I've attached an updated patch using "semimonth".

Thanks,
Chris.


[-- Attachment #2: 0001-org-clock.el-add-semimonth-step-for-clocktables.patch --]
[-- Type: application/octet-stream, Size: 1760 bytes --]

From 479646d44e11c923b8f64be417e785a175133d13 Mon Sep 17 00:00:00 2001
From: Christian Hopps <chopps@gmail.com>
Date: Fri, 20 Mar 2020 06:58:29 -0400
Subject: [PATCH] org-clock.el: add semimonth step for clocktables

* lisp/org-clock.el (org-clocktable-steps): add a semimonth step for
producing clock tables.

Originally proposed "bimonth" as name; however, bimonthly is
ambiguous, as it can mean 2 different things, semimonthly or every 2
months.
---
 lisp/org-clock.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 345fd9b5a..c902635f9 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2784,6 +2784,7 @@ a number of clock tables."
           (pcase step
             (`day "Daily report: ")
             (`week "Weekly report starting on: ")
+            (`semimonth "Semimonthly report starting on: ")
             (`month "Monthly report starting on: ")
             (`year "Annual report starting on: ")
             (_ (user-error "Unknown `:step' specification: %S" step))))
@@ -2833,6 +2834,9 @@ a number of clock tables."
                           (let ((offset (if (= dow week-start) 7
                                           (mod (- week-start dow) 7))))
                             (list 0 0 org-extend-today-until (+ d offset) m y)))
+                         (`semimonth (list 0 0 0
+                                           (if (< d 16) 16 1)
+                                           (if (< d 16) m (1+ m)) y))
                          (`month (list 0 0 0 month-start (1+ m) y))
                          (`year (list 0 0 org-extend-today-until 1 1 (1+ y)))))))
              (table-begin (line-beginning-position 0))
-- 
2.25.0


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

* Re: bi-monthly steps.
  2020-03-26 11:33         ` Christian Hopps
@ 2020-03-27  1:12           ` Kyle Meyer
  2020-03-27  8:26             ` Christian Hopps
  0 siblings, 1 reply; 12+ messages in thread
From: Kyle Meyer @ 2020-03-27  1:12 UTC (permalink / raw)
  To: Christian Hopps; +Cc: emacs-orgmode

Christian Hopps <chopps@chopps.org> writes:

> I've attached an updated patch using "semimonth".

Applied in 8a99404c8, along with a follow-up commit that adds a test,
updates the manual, and add a NEWS entry.

Thanks.

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

* Re: bi-monthly steps.
  2020-03-27  1:12           ` Kyle Meyer
@ 2020-03-27  8:26             ` Christian Hopps
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Hopps @ 2020-03-27  8:26 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Christian Hopps, emacs-orgmode

Thanks, and thanks for adding the test and doc updates!

Chris.

> On Mar 26, 2020, at 9:12 PM, Kyle Meyer <kyle@kyleam.com> wrote:
> 
> Christian Hopps <chopps@chopps.org> writes:
> 
>> I've attached an updated patch using "semimonth".
> 
> Applied in 8a99404c8, along with a follow-up commit that adds a test,
> updates the manual, and add a NEWS entry.
> 
> Thanks.
> 

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

end of thread, other threads:[~2020-03-27  8:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-12 11:17 bi-monthly steps Christian Hopps
2020-03-12 18:15 ` Nick Dokos
2020-03-12 22:55   ` Christian Hopps
2020-03-13  8:01     ` Michal Politowski
2020-03-13 12:14       ` Peter Neilson
2020-03-26 11:33         ` Christian Hopps
2020-03-27  1:12           ` Kyle Meyer
2020-03-27  8:26             ` Christian Hopps
2020-03-13  4:47   ` Peter Neilson
2020-03-13  6:59     ` Eric S Fraga
2020-03-13  7:14       ` Loris Bennett
2020-03-13  9:51         ` semimonthly steps [Re: bi-monthly steps.] Christian Hopps

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