From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ulrich =?UTF-8?Q?M=C3=BCller?= Newsgroups: gmane.emacs.bugs Subject: bug#61460: 30.0.50; Calendar shows eclipse for quarter moon Date: Fri, 17 Feb 2023 08:03:47 +0100 Message-ID: References: <87sffab61y.fsf@web.de> <87cz6eb10y.fsf@web.de> <87r0uu9e5v.fsf@web.de> <87mt5i9cba.fsf@web.de> <875yc4q0ee.fsf@web.de> <87y1p0obe8.fsf@web.de> <87ttzoo6px.fsf@web.de> <87pma8q2w1.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30370"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: Eli Zaretskii , 61460@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 17 08:06:12 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 1pSuos-0007lK-Rn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Feb 2023 08:06:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSuoc-0001T6-7T; Fri, 17 Feb 2023 02:05:54 -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 1pSunv-0001QG-Kv for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 02:05:11 -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 1pSunm-0008WB-PS for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 02:05:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSunm-0002ER-47 for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 02:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ulrich =?UTF-8?Q?M=C3=BCller?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2023 07:05: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.16766174438445 (code B ref 61460); Fri, 17 Feb 2023 07:05:02 +0000 Original-Received: (at 61460) by debbugs.gnu.org; 17 Feb 2023 07:04:03 +0000 Original-Received: from localhost ([127.0.0.1]:38322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSumo-0002C8-Vl for submit@debbugs.gnu.org; Fri, 17 Feb 2023 02:04:03 -0500 Original-Received: from woodpecker.gentoo.org ([140.211.166.183]:39678 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSumn-0002BW-2y for 61460@debbugs.gnu.org; Fri, 17 Feb 2023 02:04:02 -0500 In-Reply-To: <87pma8q2w1.fsf@web.de> (Michael Heerdegen's message of "Fri, 17 Feb 2023 06:25:50 +0100") 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:255857 Archived-At: >>>>> On Fri, 17 Feb 2023, Michael Heerdegen wrote: > I have some more cosmetic changes: > [...] > (node-dist (funcall (lambda (x) (min x (- 180 x))) > (mod moon-lat 180)))) I didn't go for this one, because IMHO it is too clever and would worsen readability of the code. (Also, there is precedent for successive rebinding in function lunar-phase.) > In particular, the name of the global function should start with > "lunar-". Does that look ok? Thank you. Updated patch below. >From 4a3abeac5c6614c9b0b346767627f978b2dd138a Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Ulrich=3D20M=3DC3=3DBCller?=3D Date: Thu, 16 Feb 2023 20:09:22 +0100 Subject: [PATCH] ; Adjust limit for eclipse in calendar/lunar.el, rename function * lisp/calendar/lunar.el (lunar-check-for-eclipse): Renamed from 'eclipse-check'; thanks to Michael Heerdegen for the suggestion. Slightly adjust the upper limit for the distance from the node to the value found in literature. (bug#61460) --- lisp/calendar/lunar.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 1f827ca34b0..fe8129ec511 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -94,7 +94,7 @@ remainder mod 4 gives the phase: 0 new moon, 1 first quar= ter, 2 full moon, (* -0.0016528 time time) (* -0.00000239 time time time)) 360.0)) - (eclipse (eclipse-check moon-lat phase)) + (eclipse (lunar-check-for-eclipse moon-lat phase)) (adjustment (if (memq phase '(0 2)) (+ (* (- 0.1734 (* 0.000393 time)) @@ -154,19 +154,18 @@ remainder mod 4 gives the phase: 0 new moon, 1 first = quarter, 2 full moon, =20 ;; from "Astronomy with your Personal Computer", Subroutine Eclipse ;; Line 7000 Peter Duffett-Smith Cambridge University Press 1990 -(defun eclipse-check (moon-lat phase) +(defun lunar-check-for-eclipse (moon-lat phase) (let* ((node-dist (mod moon-lat 180)) ;; Absolute angular distance from the ascending or descending ;; node, whichever is nearer. (node-dist (min node-dist (- 180 node-dist))) - (phase-name (cond ((=3D phase 0) "Solar") - ((=3D phase 2) "Lunar") - (t "")))) - (cond - ((string=3D phase-name "") "") - ((< node-dist 13.9) (concat "** " phase-name " Eclipse **")) - ((< node-dist 21.2) (concat "** " phase-name " Eclipse possible **")) - (t "")))) + (type (cond ((=3D phase 0) "Solar") + ((=3D phase 2) "Lunar")))) + (cond ((not type) "") + ;; Limits 13.9=C2=B0 and 21.0=C2=B0 from Meeus (1991), page 350. + ((< node-dist 13.9) (concat "** " type " Eclipse **")) + ((< node-dist 21.0) (concat "** " type " Eclipse possible **")) + (t "")))) =20 (defconst lunar-cycles-per-year 12.3685 ; 365.25/29.530588853 "Mean number of lunar cycles per 365.25 day year.") --=20 2.39.2