From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#61460: 30.0.50; Calendar shows eclipse for quarter moon Date: Wed, 22 Feb 2023 17:26:49 +0100 Message-ID: <871qmhfyye.fsf@web.de> References: <87mt5i9cba.fsf@web.de> <875yc4q0ee.fsf@web.de> <87y1p0obe8.fsf@web.de> <87ttzoo6px.fsf@web.de> <87pma8q2w1.fsf@web.de> <87wn4g4v1y.fsf@web.de> <87y1ovecz2.fsf@web.de> <8735739vun.fsf@web.de> <87a61759t5.fsf@web.de> <87y1oq3tm0.fsf@web.de> <87mt55ye8y.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4806"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61460@debbugs.gnu.org To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 22 17:28:30 2023 Return-path: Envelope-to: geb-bug-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 1pUrym-000152-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Feb 2023 17:28:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUryO-0003zj-76; Wed, 22 Feb 2023 11:28:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUryM-0003zG-Ug for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 11:28:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUryM-0005gJ-ME for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 11:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUryM-0007iA-GG for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 11:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Feb 2023 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61460 X-GNU-PR-Package: emacs Original-Received: via spool by 61460-submit@debbugs.gnu.org id=B61460.167708323329579 (code B ref 61460); Wed, 22 Feb 2023 16:28:02 +0000 Original-Received: (at 61460) by debbugs.gnu.org; 22 Feb 2023 16:27:13 +0000 Original-Received: from localhost ([127.0.0.1]:60184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUrxY-0007h0-OK for submit@debbugs.gnu.org; Wed, 22 Feb 2023 11:27:13 -0500 Original-Received: from mout.web.de ([212.227.15.14]:33349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUrxX-0007gm-0r for 61460@debbugs.gnu.org; Wed, 22 Feb 2023 11:27:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1677083210; i=michael_heerdegen@web.de; bh=/xUSa5aWYHqV+miCDen43//7Z920BPPk3cSv3B6s0eQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=kCGc0u5lWnZzdr97LUpTL+ElVeZ6miJ5LOwHrvzWWnQIulq3HdOCPVttnZ3fNeZvS Fzxz7aaIo4R9pKVjkcJzntTvmZfD19nLMAtgkhU7AoQLw9PJt8c7FFQFz8S9BEED3J Gm5EU4FETppb2R5axI5ae216mHMlZctFwvYucR6x4qPtIkEPkaMgM6NrdzpdDI1Rep Wki4UYaOHTTPbUxizIs5HGKU/LjeKuFb0MGMzfQMxlDEyFvr+ngAzS0DFCmnOOkya0 nFZydyFKfMDwzfJUPe54Z1/cx0oBW+L4mSfJtyVo03WmYjLARikh2o6MIBbYWAc0gB kgncCEf0UEURg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([84.59.210.57]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mt8gP-1ogcsd19mD-00tAfS; Wed, 22 Feb 2023 17:26:50 +0100 In-Reply-To: (Ulrich Mueller's message of "Wed, 22 Feb 2023 16:46:21 +0100") X-Provags-ID: V03:K1:GQeiKmb8pP6DI/b5hpmWHqyU9Adg+RNvzxorVLsJXYGXmkFWWpL /5tMqdx5fAC2WwgW4U8hTstjQ+FHIzc2LRi//H/mSzYetSPIa3I4BwVK96Dob4UQCAI0ihT Btm7z8dUONgb6DQuJm8qrs/EgTDiHE095pFT+9IR6qSvVTFIi61JnlsmwEhvCKlgyAjQsLX xyseT8NGccqRFcmg7rvuQ== UI-OutboundReport: notjunk:1;M01:P0:mqLwpOFjMpQ=;O5ChhTad9/KZNSG0ARPLzdlggLH 34qyTjKVCuIvCSvfNzMTqE08lc+jAwQtBrZZpHqSBtzvyQ3LG+4H7a6hawMTCI6FbAMuexsCb 4eHeqD/8FNsFtrhI44ThcOxkIXueL145ddm/vgSt3pSIiWkinLNOOfwZC6jfMA7SHFfUz2V7B nVO3YUH95gWEHQFvD7zXtocqpmD0kVtL1Vp2B9s6/cbt6ly7ub60fXNk4Z+zUnK4++NXt51gR nOdLQB1S7fFARUTt05sr/ksOJN4yvA7f7rKczcrpc0taDI247zZCJSuGyRx8b3ivWKk19VUZy H01FXXDDiFqnfyEN1Asp1mazg6wWt0Zw09XuBClg9024hH4qy+7xmZwrEgwEaovjgRdRFymlA d4sNzlPL5nysR9D7+/xOpQ5GLulWHGBmadslK3JuJ1+XmUajhrQQvuNnefdDVHi5mhGoCZ7iM GgWKJKmvguVSSTou7VPwPB4TCNrWHSJgwvuh717Sriaw3XYC74G8SrBIls0PStDGqbQqpRP5G eX9yGyMng3QxzOu54aVL+TjfDoaBxRzvaVYRRFPf60g1FnMdrfUK8+Bn2X7KTNXbP3Dcy7cRc KUSde7y5fneQPIsqmOSZo8bABzx3pMIY+jMSpEriimOL1atYtBHYzC6AEl98lwWDWtaZ6ZMq+ uXoE+QvWcnkQhTINu02tQQiYKbVim3NLiYyCIeetOsD47KoNAhAvFeLj6I8uoKKlwAXnzYwSs g5jJnb5WtjuazXhJ9ntlOBP2M/hySu+CTpSGjRx00Wdra85/5Sihob9Y4/uSl5udMudXI2Fe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256373 Archived-At: --=-=-= Content-Type: text/plain Ulrich Mueller writes: > >>>>> On Wed, 22 Feb 2023, Michael Heerdegen wrote: > > > + (let ((eclipse (nth 3 x))) > > + (concat (calendar-date-string (car x)) ": " > > + (lunar-phase-name (nth 2 x)) " " > > + (cadr x) (unless (string-empty-p eclipse) " ") > > + eclipse))) > > Fix the indentation? The tabs in this line are the only ones in the > file. Impressive discovery! Updated patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-also-diary-lunar-phases-report-eclipses.patch Content-Transfer-Encoding: quoted-printable =46rom 039668a5a4b27ea7e841592b9be42e50af1abe74 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Wed, 22 Feb 2023 14:56:07 +0100 Subject: [PATCH] Make also 'diary-lunar-phases' report eclipses * lisp/calendar/lunar.el (diary-lunar-phases): Report eclipses. (calendar-lunar-phases): Tweak. =2D-- lisp/calendar/lunar.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 4f8f34d954f..5b22043102d 100644 =2D-- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -245,10 +245,11 @@ calendar-lunar-phases (insert (mapconcat (lambda (x) - (format "%s: %s %s %s" (calendar-date-string (car x)) - (lunar-phase-name (nth 2 x)) - (cadr x) - (car (last x)))) + (let ((eclipse (nth 3 x))) + (concat (calendar-date-string (car x)) ": " + (lunar-phase-name (nth 2 x)) " " + (cadr x) (unless (string-empty-p eclipse) " ") + eclipse))) (lunar-phase-list m1 y1) "\n"))) (message "Computing phases of the moon...done")))) @@ -283,9 +284,13 @@ diary-lunar-phases (while (calendar-date-compare phase (list date)) (setq index (1+ index) phase (lunar-phase index))) - (if (calendar-date-equal (car phase) date) - (cons mark (concat (lunar-phase-name (nth 2 phase)) " " - (cadr phase)))))) + (and (calendar-date-equal (car phase) date) + (cons mark + (let ((eclipse (nth 3 phase))) + (concat (lunar-phase-name (nth 2 phase)) " " + (cadr phase) + (unless (string-empty-p eclipse) " ") + eclipse)))))) ;; For the Chinese calendar the calculations for the new moon need to be = more ;; accurate than those above, so we use more terms in the approximation. =2D- 2.30.2 --=-=-= Content-Type: text/plain Michael. --=-=-=--