From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yHdgN65JXGF5hgEAgWs5BA (envelope-from ) for ; Tue, 05 Oct 2021 14:48:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OIn8Mq5JXGFOKgAAB5/wlQ (envelope-from ) for ; Tue, 05 Oct 2021 12:48:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6E1F01EFC1 for ; Tue, 5 Oct 2021 14:48:46 +0200 (CEST) Received: from localhost ([::1]:45656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXjsD-000331-FK for larch@yhetil.org; Tue, 05 Oct 2021 08:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXet3-0001k3-8o for emacs-orgmode@gnu.org; Tue, 05 Oct 2021 03:29:17 -0400 Received: from htip.helberg.nl ([37.97.160.162]:49996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXet1-0006nA-HZ for emacs-orgmode@gnu.org; Tue, 05 Oct 2021 03:29:17 -0400 Received: from htip.helberg.nl (localhost [127.0.0.1]) by htip.helberg.nl (Postfix) with ESMTPS id 9C1CB680C66 for ; Tue, 5 Oct 2021 09:29:02 +0200 (CEST) Received: from www.helberg.nl (82-217-8-79.cable.dynamic.v4.ziggo.nl [82.217.8.79]) by htip.helberg.nl (Postfix) with ESMTPSA id 728D66804DE for ; Tue, 5 Oct 2021 09:29:02 +0200 (CEST) User-agent: mu4e 1.5.11; emacs 27.1 From: Joost Helberg To: emacs-orgmode@gnu.org Subject: [PATCH] make quarter work as parameter for :step in clocktable Date: Tue, 05 Oct 2021 09:26:39 +0200 Message-ID: <874k9w0w1t.fsf@cistus.nl> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=37.97.160.162; envelope-from=joost@cistus.nl; helo=htip.helberg.nl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 05 Oct 2021 08:44:01 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633438126; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=gyXkKwRlFR5K9lB2niT9XU4FcNrJFY1sfRizuhXhIIo=; b=VmDSmX6AZ1LbzFTTjf87rkCg1yy852NgdqGcC9ucOCORpYJe3Ct0TvnaewF2y2JCxKRXE+ MuPpEr5npT8T6dJ6PhdXXBKDPqhV0zIWUphPZn0/Y9GSlQ5jIC1kmPHf901eo+zmOWiglx zy4TfIE4dCk9YjV2kGEZQIewqXeVbCDfORsw0vmYDQxe5qgUSC5DYHah6iGzsdPYBRwn9t cQ1FWNdcCpejSi7mIZFVO5sLporQTEKXqfmW6CRlkzB61y1PLt+nXzheekC3mJFWESB2J7 7z3NyDmc7QZfkGJj4pjYCXJpxuHAJlLuxXDRkL2yyUUOKIdtAqjWxP49Udk7TA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633438126; a=rsa-sha256; cv=none; b=sgkxoGNBxbVVdY79etglGnrCNwBnDT2kbIiCGsYvpLvmBLvioKNiBizeyEBrpWdhKrWZWx JHTprLbE57n1ETkAaVP3sxVMQ4fw6kvJv2WlYsc8bth7P3ZRwmOY9soyKek5OAQ8Bow5K9 L4/aJ4fSD926SlxvyRJGGZwZE7ZR2hj6ao489hKOOO2eUg/mYLjzauJDD+VAnJIh8xLuQu MSR+QQyAbwSESxUhQahmzHbduMoz1usyIdq/G3hilm29c1KycSUgm6eQQPXdMXA7hSEKKb ghvNUKb8TeSN2dOv1GHhkyJX/XjC/jEnQZ0yIYDap0cv8yi18/l7ztAaA2zzRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 6E1F01EFC1 X-Spam-Score: -2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: tq/1UAUwujhH Hi, many years ago a colleague and myself wrote a patch for quarters into org-mode/clocktable for blocks, today I noticed that :step should allow 'quarter' as an argument too. Here's the tiny patch to allow that: --- doc/org-manual.org | 2 +- lisp/org-clock.el | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index b25da7889..133d880c7 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -6738,7 +6738,7 @@ be selected: - =:step= :: - Set to =day=, =week=, =semimonth=, =month=, or =year= to split the + Set to =day=, =week=, =semimonth=, =month=, =quarter=, or =year= to split the table into chunks. To use this, either =:block=, or =:tstart= and =:tend= are required. diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 143ed4f12..4628d4b5f 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2822,6 +2822,7 @@ a number of clock tables." (`semimonth "Semimonthly report starting on: ") (`month "Monthly report starting on: ") (`year "Annual report starting on: ") + (`quarter "Quarterly report starting on: ") (_ (user-error "Unknown `:step' specification: %S" step)))) (week-start (or (plist-get params :wstart) 1)) (month-start (or (plist-get params :mstart) 1)) @@ -2873,7 +2874,8 @@ a number of clock tables." (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))))))) + (`year (list 0 0 org-extend-today-until 1 1 (1+ y))) + (`quarter (list 0 0 0 month-start (+ 3 m) y)))))) (table-begin (line-beginning-position 0)) (step-time ;; Write clock table between START and NEXT. -- 2.25.1 -- Cistus