unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Ulrich Mueller <ulm@gentoo.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	Eli Zaretskii <eliz@gnu.org>,
	61460@debbugs.gnu.org
Subject: bug#61460: 30.0.50; Calendar shows eclipse for quarter moon
Date: Wed, 22 Feb 2023 10:45:22 +0100	[thread overview]
Message-ID: <mvmsfeyqbil.fsf@suse.de> (raw)
In-Reply-To: <ufsayqdl5@gentoo.org> (Ulrich Mueller's message of "Wed, 22 Feb 2023 10:00:38 +0100")

On Feb 22 2023, Ulrich Mueller wrote:

>>>>>> On Tue, 21 Feb 2023, Michael Heerdegen wrote:
>
>>> That remark made me think about whether we want a `diary-eclipses' - or
>>> teach `diary-lunar-phases' to report eclipses (at the moment the latter
>>> doesn't report eclipses, I just tried).
>
>> Seems getting the latter is quite simple:
>
>> -        (cons mark (concat (lunar-phase-name (nth 2 phase)) " "
>> -                           (cadr phase))))))
>> +        (cons mark
>> +              (let ((eclipse (nth 3 phase)))
>> +                (concat (lunar-phase-name (nth 2 phase)) " "
>> +                        (cadr phase)
>> +                        (if (string-empty-p eclipse)
>> +                            ""
>> +                          (concat " " eclipse))))))))
>
> It is probably a matter of personal taste, but I dislike the nested
> concats. This seems simpler (not tested, though):
>
> -        (cons mark (concat (lunar-phase-name (nth 2 phase)) " "
> -                           (cadr phase))))))
> +        (cons mark
> +              (let ((eclipse (nth 3 phase)))
> +                (concat (lunar-phase-name (nth 2 phase)) " "
> +                        (cadr phase)
> +                        (if (string-empty-p eclipse) "" " ")
> +                        eclipse))))))

concat also accepts lists, so nil is pefectly fine as an argument.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





  reply	other threads:[~2023-02-22  9:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 19:57 bug#61460: 30.0.50; Calendar shows eclipse for quarter moon Ulrich Mueller
2023-02-12 20:07 ` Ulrich Müller
2023-02-12 20:19   ` Eli Zaretskii
2023-02-12 21:13     ` Ulrich Mueller
2023-02-13  3:24       ` Eli Zaretskii
2023-02-13  3:25   ` Michael Heerdegen
2023-02-13  4:52     ` Michael Heerdegen
2023-02-13  5:13     ` Michael Heerdegen
2023-02-13  6:01       ` Michael Heerdegen
2023-02-13  7:28       ` Ulrich Mueller
2023-02-13  8:13         ` Michael Heerdegen
2023-02-13  8:52           ` Michael Heerdegen
2023-02-13  9:34             ` Ulrich Mueller
2023-02-13 10:04               ` Michael Heerdegen
2023-02-13 13:03                 ` Eli Zaretskii
2023-02-13 13:30                   ` Ulrich Mueller
2023-02-13 14:05                     ` Eli Zaretskii
2023-02-14  5:30               ` Michael Heerdegen
2023-02-14  7:59                 ` Ulrich Mueller
2023-02-14  9:15                   ` Michael Heerdegen
2023-02-14 10:22                     ` Ulrich Müller
2023-02-14 10:56                       ` Michael Heerdegen
2023-02-16 20:26                         ` Ulrich Müller
2023-02-17  5:25                           ` Michael Heerdegen
2023-02-17  7:03                             ` Ulrich Müller
2023-02-17  7:20                               ` Michael Heerdegen
2023-02-18  5:53                                 ` Michael Heerdegen
2023-02-18  8:56                                   ` Ulrich Mueller
2023-02-18  9:16                                     ` Michael Heerdegen
2023-02-21 15:15                                       ` Michael Heerdegen
2023-02-22  9:00                                         ` Ulrich Mueller
2023-02-22  9:45                                           ` Andreas Schwab [this message]
2023-02-22 10:03                                           ` Michael Heerdegen
2023-02-22 11:32                                             ` Ulrich Mueller
2023-02-22 14:19                                               ` Michael Heerdegen
2023-02-22 15:46                                                 ` Ulrich Mueller
2023-02-22 16:26                                                   ` Michael Heerdegen
2023-02-25 16:13                                                     ` Michael Heerdegen
2023-02-14 13:31                       ` Eli Zaretskii
2023-02-14 10:49                     ` Ulrich Mueller
2023-02-13  6:21     ` Ulrich Mueller
2023-02-13  7:08       ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvmsfeyqbil.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=61460@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).