From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Syntax for <%%(diary-float )> Date: Wed, 12 Oct 2022 22:37:19 +0300 Message-ID: References: <81D47CAB-50F5-4EF5-88E0-D6A898AF1FFD@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16778"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Cc: help-gnu-emacs@gnu.org To: Renato Pontefice Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 12 21:42:15 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1oihcM-000497-CU for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Oct 2022 21:42:14 +0200 Original-Received: from localhost ([::1]:40768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oihcL-0002PH-6S for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Oct 2022 15:42:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oihbn-0002P7-Fr for help-gnu-emacs@gnu.org; Wed, 12 Oct 2022 15:41:39 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:51755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oihbl-0005Dc-Ct for help-gnu-emacs@gnu.org; Wed, 12 Oct 2022 15:41:38 -0400 Original-Received: from localhost ([::ffff:197.239.4.224]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000BBD14.000000006347186D.00006A69; Wed, 12 Oct 2022 12:41:31 -0700 Mail-Followup-To: Renato Pontefice , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <81D47CAB-50F5-4EF5-88E0-D6A898AF1FFD@gmail.com> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139866 Archived-At: * Renato Pontefice [2022-10-12 21:21]: > It’s a while that I’m searching information about this statement. I > need it on org mode but I ‘m unable to write in in the way I need > it. I need that (in org mode) an Agenda TODO happen: the first > Friday of each mont of all the year. Can someone tell me the exact > syntax if this statement? (diary-float 1 1 1) this gives me void variable date, there is problem. Use C-h f on function to examine it: {C-h f diary-float RET} diary-float is a Lisp closure in ‘diary-lib.el’. (diary-float MONTH DAYNAME N &optional DAY MARK) Diary entry for the Nth DAYNAME after/before MONTH DAY. DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on. If N>0, use the Nth DAYNAME after MONTH DAY. If N<0, use the Nth DAYNAME before MONTH DAY. DAY defaults to 1 if N>0, and MONTH’s last day otherwise. MONTH can be a list of months, an integer, or t (meaning all months). Optional MARK specifies a face or single-character string to use when highlighting the day in the calendar. ------------- I guess there is nothing bad using external tools to get the information you want. The sqlite3 database, will give this result: sqlite> SELECT DATE('2022-11-01', 'start of month', 'weekday 5'); 2022-11-04 It means now we can easily calculate which date is first day of month, by doing the list: (defun my-fridays () (interactive) (insert "\n\n") (let ((years '(2022 2023 2024))) (while years (let ((year (pop years)) (months '("01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12"))) (while months (let* ((month (pop months)) (date (format "%s-%s-01" year month)) (sql (format "SELECT DATE('%s', 'start of month', 'weekday 5')" date))) (insert (caar (sqlite-select rcd-people-sqlite-db sql)) "\n"))))))) (my-fridays) 2022-01-07 2022-02-04 2022-03-04 2022-04-01 2022-05-06 2022-06-03 2022-07-01 2022-08-05 2022-09-02 2022-10-07 2022-11-04 2022-12-02 2023-01-06 2023-02-03 2023-03-03 2023-04-07 2023-05-05 2023-06-02 2023-07-07 2023-08-04 2023-09-01 2023-10-06 2023-11-03 2023-12-01 2024-01-05 2024-02-02 2024-03-01 2024-04-05 2024-05-03 2024-06-07 2024-07-05 2024-08-02 2024-09-06 2024-10-04 2024-11-01 2024-12-06 Now you could use this function to set up events. I do not know how do you set it up. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/