From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?G=C4=B3s_Hillenius?= Newsgroups: gmane.emacs.devel Subject: diary-lib.el how about adding diary-schedule Date: Fri, 20 Aug 2021 11:57:31 +0200 Organization: Using Emacs' Org Mode Message-ID: <87tujkfng4.fsf@hillenius.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34251"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:HkiKYZK8JiM7JSL6IcH4hk0PcEc= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 20 12:01:17 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH1Kv-0008f2-7D for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 12:01:17 +0200 Original-Received: from localhost ([::1]:33836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH1Ku-0001jb-6c for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 06:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH1Ju-0000dk-UP for emacs-devel@gnu.org; Fri, 20 Aug 2021 06:00:14 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:51652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH1Jm-0004db-Ah for emacs-devel@gnu.org; Fri, 20 Aug 2021 06:00:14 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mH1Jh-0006yV-SY for emacs-devel@gnu.org; Fri, 20 Aug 2021 12:00:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ OpenPGP: id=340F F9A4 8F6C 18FD D032 0C33 ABA1 CB30 E997 A3AF X-Operating-System: Debian GNU/Linux Sid Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272704 Archived-At: Hello On the emacs wikiš I found a useful bit of code that allows adding an weekly appointment in the diary file between two dates. Something that I can't do with diary-block or diary-cyclic. The code on the wiki seems out of date, so I reworked it a tiny bit. Example: %%(diary-schedule 15 7 2020 30 6 2021 3) 14:00 some weekly meeting (defun diary-schedule (m1 d1 y1 m2 d2 y2 dayname) "Schedule diary entry. Entry applies if date is between, or on one of, two dates on DAYNAME. The order of the input parameters changes according to `calendar-date-style' \(e.g. to D1, M1, Y1, D2, M2, Y2 in the European style)." (let ((date1 (calendar-absolute-from-gregorian (diary-make-date m1 d1 y1)) ) (date2 (calendar-absolute-from-gregorian (diary-make-date m2 d2 y2))) (d (calendar-absolute-from-gregorian date))) (if (and (<= date1 d) (<= d date2) (= (calendar-day-of-week date) dayname)) entry))) Would it be useful to add this to diary-lib.el? 1) https://www.emacswiki.org/emacs/DiaryMode