From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#32105: 25.2; calendar-read-date should default to today [PATCH INCLUDED] Date: Mon, 24 Jun 2019 22:42:31 +0200 Message-ID: References: <20180709155344.cnpbkeb6dcryld44@E15-2016.optimum.net> <20190624165257.eyivujzaoxebbl2w@E15-2016.optimum.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112905"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 32105@debbugs.gnu.org, "Edward M. Reingold" To: Boruch Baum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 24 22:43:47 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 1hfVoY-000TGp-9T for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 22:43:46 +0200 Original-Received: from localhost ([::1]:54590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVoU-0002Hq-Hd for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 16:43:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37597) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVnt-0002HY-3S for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfVnr-0001ej-0l for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44597) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfVnq-0001ea-TH for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfVnq-00043W-Pc for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 20:43:02 +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.156140896115546 (code B ref 32105); Mon, 24 Jun 2019 20:43:02 +0000 Original-Received: (at 32105) by debbugs.gnu.org; 24 Jun 2019 20:42:41 +0000 Original-Received: from localhost ([127.0.0.1]:58138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVnU-00042f-MB for submit@debbugs.gnu.org; Mon, 24 Jun 2019 16:42:40 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:36310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVnT-00042W-3O for 32105@debbugs.gnu.org; Mon, 24 Jun 2019 16:42:39 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfVnL-0007Y8-PC; Mon, 24 Jun 2019 22:42:34 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVVdZEXHjVZ0OYpMUpl j6xBUWsL3gelAAACPklEQVQ4jVWUsXbrIAyGVQJ7CTc7lc0erLLn+JCdgnn/V6mEHTdXnqJP0i8J CKTORqmX3lLp/MvAAx46w09q0VnXNygmG216K1qboiH1RmRvveAS0KPptMGjc1brLVpLdA/L19rR GCr62TpA782y3fw9qGISEbEc9S6l2O/83UC5WEeWGtMEcB8Jmv0Q2R9pWNdAxL9VATCSyMAdILpo NzDQ7OhBLIkEUELg8Mh+F0c0NZ4XIFX0RD92FHJWNKSpB9B6RQWTgDgyxo5KhhQqInqOPyT6AeLE flSW4qtTHrBDBhsErLvsDriZzMAPYCm1MwM0r91BfYE2xKUUCHiqHfCO2rsGeZxZnGeQgaVbKFxs aARQwBlOJmiizQtlgMEXI6Fj2WY0JRpWYSjm2faBJRg0+2ewCzZHF/aCKTBGyI+cEex1drRHi7FP bGXAti+OS4z4rDlBQF02bZIZmzgSdrB8hxA4gTeR8xtwVxPmKiInWXFk/Jvmuj2HvD79Am6TWia/ y+9gZFB0fjG+Gun3PYP3ydd53UKHA8x/IPn6nF8Zw70DdcHNK7P75xP0VqfV4Lfnyf8SBPQl1KAM vksLSKl6/oLy+jX1AHw+31j4q/P/QC4l8hPj72j3DxBecFJnrVVuxwGmGhZf5T08Xkn8vqxdv65+ 1DvBPA9QwydGruaPM8/jzNmuM+EHV0P5w4DzaBmgxWlBwud+02XIARb8qSxyUf5Y5Ev8hh9Xjg/1 bRTI/C4dfn1iYwn0g8i6fgEmpsN4L1MvjgAAAABJRU5ErkJggg== In-Reply-To: <20190624165257.eyivujzaoxebbl2w@E15-2016.optimum.net> (Boruch Baum's message of "Mon, 24 Jun 2019 12:52:57 -0400") 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:161282 Archived-At: Boruch Baum writes: > 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? Hm... well, calendar-read seems nice, since it validates the numbers... > 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. I think just putting the current year in M-n is fine -- we don't have to mess with the history at all. That is, something conceptually like: (read-from-minibuffer "Year: " nil nil t nil "2019") Then 2019 is in M-n and can be edited, and just hitting RET will also return 2019. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no