From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.bugs Subject: bug#32105: 25.2; calendar-read-date should default to today [PATCH INCLUDED] Date: Mon, 24 Jun 2019 12:52:57 -0400 Message-ID: <20190624165257.eyivujzaoxebbl2w@E15-2016.optimum.net> References: <20180709155344.cnpbkeb6dcryld44@E15-2016.optimum.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="194429"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: 32105@debbugs.gnu.org, "Edward M. Reingold" To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 24 18:54:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfSEN-000oOw-NK for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 18:54:11 +0200 Original-Received: from localhost ([::1]:53136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfSEM-0005wp-Hw for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 12:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38108) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfSEF-0005uT-J8 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:54:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfSEE-00075M-DX for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfSED-00074M-S8 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfSED-00016Z-OH for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 12:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boruch Baum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 16:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 32105-submit@debbugs.gnu.org id=B32105.15613951974183 (code B ref 32105); Mon, 24 Jun 2019 16:54:01 +0000 Original-Received: (at 32105) by debbugs.gnu.org; 24 Jun 2019 16:53:17 +0000 Original-Received: from localhost ([127.0.0.1]:57831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSDV-00015P-AY for submit@debbugs.gnu.org; Mon, 24 Jun 2019 12:53:17 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:52175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSDT-00015B-3A for 32105@debbugs.gnu.org; Mon, 24 Jun 2019 12:53:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561395184; bh=2Gc+2IeppigoeCDFyNqZDcfNp7Vr38yT/VEYBB5vMp4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=IddyN2zJnY0FTNVixqIPKLq77JTLkd/fVdVRS5yU+R71dgeOPZJVBdblbMhh5odk7 zhmoCSOV1/2dk1FVKjc8hlw6xd8eizBtzZQw4dZuSMz1fCSpxokOiQaKVgPp5eghWE VNLijxEjMWXAqPYgwEG3u3eKuA4UXAh2MD7ylwhk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from E15-2016.optimum.net ([72.80.59.205]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0M0bo2-1iZsWU1J2E-00urQd; Mon, 24 Jun 2019 18:53:04 +0200 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:SsStZarzP0+SQv/4DITSi6zw5l95Of44QavcegePYPu3s0CIsNy qG0KT3Fn5fRFI40hAkqjfuD1m/Vy/KEepzCVUGdfz745UrwjGmQfyC4IhvseZyfaOAxR8/I 21uhKLS49nDt7+sEMoC1wAr6gypiXTAZHUm0niU7jayHJN5SOpabxx2Zb9aZEjSGtCSb3RI 9VMK2CT20k0HF3xsXthRQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Er5T91h5VzU=:vZdPeSjUfPLrxh8C45UHSe sVZvwQ943CqRHhI91PMdWuY0QPjUhCa1AeziFTgLIkJPRyJ/iE+FBI0uzyf9hACJC2TerlR8q PKxezkiHu8KluL9ufkJOYrN0Smipy9+bJs6bYxGliWs3ivzGrGw5LzJI5SxrVrWXrHfjelG/C QLd+ZN3TABQ+e1pukbcnbsskM9QK+MPv8aB8P47WVjk6/kbRzTPj7pavOFyhNWeMpBJ2EsI54 34KvPbv7+LDOzEjCs9pVvWx8NRRLvIqyK/erNSb87UBuFe37TLdlRFms51ne2dGvfXQH4eKpy 8KLYf8bx3hPJq7U0r88macZkVHvN3/kY4OIOcQ9agq4s8H4cKWv+5JHz4KpLf2OJ4t574AHvV EKdM+rO+UG5Ew5N7x80Oc6yq3CpcfYhWvaJd82LxnozMk5Q6RQCiQ4r69JrFIrhzzcW9mQNKU AE3OUaCTQeDstQNiUy+YrkeNRiskRbH4hKnr0OXMXhTzYFH+ZWtjTBOy/aTJX7FH1yCxYFq4d MVV0efsy+Ilo2vaGvzWYwIRJ+Ei64G91hnTqNnfwjOjNvCyIUclyrx/evRtpDpyqNc7N9ReID nomNMmoxI42TeL/Nm0gf7CTosVNfW+P9rf1Flrlq+sVlhYNVmptQINZK73kURjbv25K/bpGTR x22fISOtZzJRRgK2SeoYqUrh5hK4563dl4a6OYuh1L6qij8GCnclhTTv4y++fZtwFnveeeOyB 2HVEWFzh183xDcf3W9B/4sda0UtNdeHa5OruFh00QoGFWH8UuEI498Z6UmaP7fRyJPssARtG X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161250 Archived-At: On 2019-06-24 17:24, Lars Ingebrigtsen wrote: > Boruch Baum writes: > > > The behavior of function `calendar-read-date' is inconsistent in that > > its default is provide the current year, but not the current month or > > day of the month. > > I agree; if we get a default year, then everything should get defaults. > > However: The Emacs standard for prompting these days is to put the > default into `M-n', isn't it? The current `calendar-read-date' > requires you to delete the default "2019" if you want another year... Yes, that's an inconvenience. > So perhaps that should also be changed, and today's date for all three > questions should be in `M-n'? Agreed. The function is inconsistent in that it uses function `calendar-read' for the year and day values, but `completing-read' for the month value. Should `calendar-read' behave like `completing-read'? Maybe it should have additional optional arguments for everything required by `completing-read', and then just call `completing-read'? Or just not use `calendar-read' at all, and deprecate it? If you `completing-read' -type behavior for entry of the year field, how many history entries are you going to give the user? You could use `history-length', like so: (let* ((n-year (calendar-extract-year (calendar-current-date))) (a-year (- n-year (/ history-length 2))) (z-year (+ n-year (/ history-length 2)))) (number-sequence a-year z-year)) This has a disadvantage that for certain use-cases future years might not make sense. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0