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: Fri, 17 Feb 2023 06:25:50 +0100 Message-ID: <87pma8q2w1.fsf@web.de> 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> 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="36262"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 61460@debbugs.gnu.org To: Ulrich =?UTF-8?Q?M=C3=BCller?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 17 06:27:18 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 1pStHC-0009KN-3K for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Feb 2023 06:27:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pStGz-0003tt-3g; Fri, 17 Feb 2023 00:27:05 -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 1pStGx-0003pv-MA for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 00:27: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 1pStGw-0004WR-Hx for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 00:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pStGw-0007gP-Dd for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 00:27: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: Fri, 17 Feb 2023 05:27: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.167661157529476 (code B ref 61460); Fri, 17 Feb 2023 05:27:02 +0000 Original-Received: (at 61460) by debbugs.gnu.org; 17 Feb 2023 05:26:15 +0000 Original-Received: from localhost ([127.0.0.1]:38220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pStGA-0007fM-K7 for submit@debbugs.gnu.org; Fri, 17 Feb 2023 00:26:14 -0500 Original-Received: from mout.web.de ([212.227.17.11]:57055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pStG8-0007f5-2q for 61460@debbugs.gnu.org; Fri, 17 Feb 2023 00:26:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1676611552; i=michael_heerdegen@web.de; bh=V9tDvS4qPr1dtBw1oKSKZVyIzBJh1g9iOWjEjdkwMcE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=IcUwC5vGx/heP6cYeGS1CX79R8a9fe35bu3jKZUX3RouDmaqFo0SqRIXQbKf1f6Mv qAg4IxRyYc0MiWoN3xbUj5oFYsgnQbS/sAXXvGnPJk9gETsvEmpHmGVcdMCPzzAuf4 +9z+bGfz3c9OnOnnME05S7l1qXugASmPbULdt2viqqWaus7/1evdr4ogmN04mfyeHe V+fHANoS66LSg9rhU7tQdwip/Cpk/sP/3CcEdPtKh/LulrCU062pr9nFazG7m992d3 RPhtdGI8jf2yJQ/lBTZ9YmrlKEzWLYCYBvEgPsOclZ0m/c8uZvPCVuH4MMtEzm6D0T tsEmvnFDjmzMQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([84.59.210.57]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N947J-1oW1Ch0SEZ-015yVI; Fri, 17 Feb 2023 06:25:52 +0100 In-Reply-To: ("Ulrich =?UTF-8?Q?M=C3=BCller?="'s message of "Thu, 16 Feb 2023 21:26:24 +0100") X-Provags-ID: V03:K1:OUoj21DKiU63s+rq8oalN8gC9xdv97K3EdeW6XCEqJxiD22rpcp DOxGCLB5JuJq6/wONCbHBgkbmF73gA6s5STx9QZBkNK4IW318kmS6jXZjDjSLHIRb8lFgBw hv1H675rPq5kFStBWRVyyLTweOEpRgmJLKW2CsyBqbnDq02po4GiIKx7/VdkKjHfLh5plvI ovC6Aonsi6uW4OQ7iuJ6A== UI-OutboundReport: notjunk:1;M01:P0:E8uE1gGsBCw=;Tf7xgo4y+K+Dk6822kbfaKfyDZ9 wXpemtElMBCFXUeML7NmDcgnoDyg6065vvOiEhHZpBXzL8MoIRlRzwCTkOPP3gGlJFGXyKmgP pduTbtPb+dxRGxlzhtNHqPhIaHBhmRvzPBVwiywG7jxUDMjyigt91tqh+i1LzL7VuskmRyaV1 wt4S3vhyVAPyPCOUoRByT3lLY07perTb4zyze+NcIsOT3tNPdKvTyAYQMRgpsbCJwZYTTA75k 3IQkN/W7MlXYaHucnLkYDRqjuQySw2vTErefRLK7fy0fCr8dp9BOQIDQOILI/Cd1I6ligYbNp 28123nFmKeBJfqFzObAB21touHg61xSdHJoUeYeAybeZrJF3t4n2MRTyjPVIwOR8Yl9+ejUfd 8B7JKJZhNWJJikCxgZlAk57hXIw6Zva3jTLRdwlFMlkhv+cQZdwG5bayxaxgZezVaUwwvv6sy cFNhwkWxZgl/pkGgbQqY27+kFUvAmp74ngrbhFPLLZyfvAtKlJxK709rXfSh9MzDhiOikON2t JKt5qPoHai/nAQk556Mk1kUbj6ZyOU5cKyxE0ZTBjOepvjpN0H0Y8mEm+n1DxAYsLY99B7ZW9 bto5AliHA9E1YMLGodAD8YzSL5FVWS9T5vuKLSTruV/MAXLjkIX72GnaKrITl/0/hJq0pW1XG RGQWKuaMoqmN2uYaaitCIG9RrV17ym8cYW/rvUmNqBbxzvt9VR6FZR9wjjR8EYqsgolWhPSdE 6KkOOz3VvwpD4qQQqGroTu+MJmPQIjtBhm5K9YS68wGQntZw99kZZvL76WhoNq3w5KPdi5Kn 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:255851 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ulrich M=C3=BCller writes: > Pushed to master, including your suggestion (I went for "node-dist"). Thank you very much. > [...] > tl;dr I suggest that we leave the values as-is, except for a small > adjustment from 21.2 to 21.0, as in the patch included below. If there > aren't any nobjections, I'm going to push this to master. Fine by me. > @Michael: Can this bug be closed then? I have some more cosmetic changes: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=lun.diff Content-Transfer-Encoding: quoted-printable diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 1f827ca34b0..ebf9abc9d60 100644 =2D-- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -94,7 +94,7 @@ lunar-phase (* -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,18 +154,18 @@ lunar-phase ;; from "Astronomy with your Personal Computer", Subroutine Eclipse ;; Line 7000 Peter Duffett-Smith Cambridge University Press 1990 -(defun eclipse-check (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 "")))) +(defun lunar-check-for-eclipse (moon-lat phase) + (let ((type (cond ((=3D phase 0) "Solar") + ((=3D phase 2) "Lunar") + (t nil))) + ;; Absolute angular distance from the ascending or descending + ;; node, whichever is nearer. + (node-dist (funcall (lambda (x) (min x (- 180 x))) + (mod moon-lat 180)))) (cond - ((string=3D phase-name "") "") - ((< node-dist 13.9) (concat "** " phase-name " Eclipse **")) - ((< node-dist 21.2) (concat "** " phase-name " Eclipse possible **")= ) + ((not type) "") + ((< node-dist 13.9) (concat "** " type " Eclipse **")) + ((< node-dist 21.2) (concat "** " type " Eclipse possible **")) (t "")))) (defconst lunar-cycles-per-year 12.3685 ; 365.25/29.530588853 --=-=-= Content-Type: text/plain In particular, the name of the global function should start with "lunar-". Does that look ok? Thanks, Michael --=-=-=--