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 15:19:09 +0100 Message-ID: <87mt55ye8y.fsf@web.de> References: <87r0uu9e5v.fsf@web.de> <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> 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="7069"; 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 15:20:21 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 1pUpym-0001de-2N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Feb 2023 15:20:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUpyY-0000HJ-JZ; Wed, 22 Feb 2023 09:20:06 -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 1pUpyU-0000ES-U6 for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:20:02 -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 1pUpyU-00005G-Ba for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUpyU-0003ti-2H for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2023 09:20: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 14:20: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.167707557414932 (code B ref 61460); Wed, 22 Feb 2023 14:20:02 +0000 Original-Received: (at 61460) by debbugs.gnu.org; 22 Feb 2023 14:19:34 +0000 Original-Received: from localhost ([127.0.0.1]:58419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUpy2-0003sm-1D for submit@debbugs.gnu.org; Wed, 22 Feb 2023 09:19:34 -0500 Original-Received: from mout.web.de ([212.227.17.12]:51087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUpxz-0003sW-Rq for 61460@debbugs.gnu.org; Wed, 22 Feb 2023 09:19:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1677075551; i=michael_heerdegen@web.de; bh=weY/kfwn6qCUUFDrZEr0U3GM+N2/kUOam5HqQi8PYpo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=jLFbXUFDlXr3GZXoKpuIAhvqYVfRZU+jMxRGQ/h5AtVbykn6PstMzFqXyELLEmBQv lI+S4Pf5BpPwtAZwEZjpaamIilOF8VKu8+sHhHfNbouZbYDKYguxcp39UhnJgvmlVA IPzJBvrIUHux1gI7Jng97Knr5RUomLkhbqCHPOxeFjpK22HvNojkF34JQMF2a05+/2 1bH9qRTlcLKRxuxSlHSyvuhM5D31bQz+aOx/J3FNKbhwj4hcLQZUViVm+1LRRgUXfB JsfSKZHiPh6HzsxOO7Hbj4PN9AEKKcimSQ8JU+FJtsQ5+YRmX0+zCw/19bsbQ//W5l 5WY3LKxyrl9nA== 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 1MGQGF-1pJ07v3XBd-00H2kf; Wed, 22 Feb 2023 15:19:10 +0100 In-Reply-To: (Ulrich Mueller's message of "Wed, 22 Feb 2023 12:32:30 +0100") X-Provags-ID: V03:K1:Qfu2j8O2R26zdWwkKFuZpF9VvdOtw3wFx9AZy8KfNGT7UJaH7k6 wElofTjhLokrlwhKR689DaGl25VpQc6C2GWcngSJWMbAE/EF+/7xkKL7likUaKlbnMQjs3O JUgtW4mmT90OBtb0e/OIYNSZBhitTmJRRRa8FS7hb4I8l1IQQQWxVwB5y5GazIEFA8UC8eg qMxXtdnlmuPBM21Ss/4hw== UI-OutboundReport: notjunk:1;M01:P0:hgZ146q+ZrA=;1elrrBGyODF53M7CTTwueHt/c+1 eVikcnafvlcfE5ndVhgV0AArpqrVGXDEcM+EMdz0LRfDAEfCmIxYxxLfNJ5pVBpYhxRbtqPJ1 FAZhTL2ZfNK37YS/eMoZjlFbCT+YOhdeIX6wBKL+c2ZmdkM7YM69/udlC8ktJep/nIFvyVpoZ VjmmMDLW/nAMtw4md+liSCav0O/qG7rg3rbpdjUFkBxDm16PT2bP/SA8GHFNkz1X+2ZqeAPiM dSXHazwjuXd07gAM9C8+zXlowKkjidfA8Ms9v7jULsbFh5bDjEqn6y9XcfOIM46t3tXmhjTYd jba78fUcDwcpeLGpHh4X35wGl3+j80tmhPo5FY8ge4LRcyAYmehizmJ8bRHxGBIgsztF5DR/k oQOCnS7Nt79fjDNatzzSNf26OPlNrT1W1LpmJYxO2Nlt6gTcx9zTHAXV2TOmhtwB/f6LDfKSm E8sA3BYI2T4HNrvWXYlxzl8piKq3XtwCMwwbFwMEiFt84G0iyC47VFC/cPuNwvZG4uYJC9LJ8 zezgli7dcVHythx5aemZX0j4OwKmEk2PXcy+/H3/HUtr6Tr3UN16PFI2uxy1R/EU4dnsx+ZTE ixqCGkSDgtrPeO8lzIwjaJNEV8PKmrbQhfsELJUzOC3XXlwXr88McpPUW+3m2Y83B9IdCeM5S GSBBv0s566NcrJRGI182OnDZFDsyMg+LqMY+jUxo1NbVnXA9acjnhz42ufdqqzrj4FkdUZdZz 9eozB55omUfR7gfbpVmBLoeJvWkQG+3Wa5U6BNfYwxJqdjuEj1FUXTyfD+xK7hLWzWSxhQUn 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:256358 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ulrich Mueller writes: > Use something like =E2=80=98(unless (string-empty-p eclipse) " ")=E2=80= =99? WFM. > > > We also need to fix the space handling in calendar-lunar-phases aka M in > > calendar - when no eclipse occurs, the descriptions end with a > > trailing space. > > While at it, maybe replace =E2=80=98(car (last x))=E2=80=99 by =E2=80=98(= nth 3 x)=E2=80=99? I tried to do that (and a bit more): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-also-diary-lunar-phases-report-eclipses.patch Content-Transfer-Encoding: quoted-printable =46rom f0eaa97bbc5e4a6145295a4da14606012737820e 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..b395e08c232 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. --=-=-=--