From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!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, 9 Jul 2018 11:53:44 -0400 Message-ID: <20180709155344.cnpbkeb6dcryld44@E15-2016.optimum.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="seavrebpxjibhl45" X-Trace: blaine.gmane.org 1531151589 3970 195.159.176.226 (9 Jul 2018 15:53:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2018 15:53:09 +0000 (UTC) User-Agent: NeoMutt/20180512 Cc: "Edward M. Reingold" To: 32105@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 09 17:53:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcYTH-0000s4-M5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jul 2018 17:53:03 +0200 Original-Received: from localhost ([::1]:42972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYVO-0008Pd-S9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jul 2018 11:55:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYVF-0008Ns-Rw for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYVC-000236-Q2 for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcYVC-000231-LY for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fcYVC-0005Og-C2 for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:55:02 -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, 09 Jul 2018 15:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Emacs Bug Reporting Original-Received: via spool by submit@debbugs.gnu.org id=B.153115165020681 (code B ref -1); Mon, 09 Jul 2018 15:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jul 2018 15:54:10 +0000 Original-Received: from localhost ([127.0.0.1]:52693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcYUM-0005NV-3o for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:54:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcYUI-0005Mz-SW for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:54:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYUC-000148-Lg for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:54:01 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcYUC-000141-HT for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:54:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYUB-0007rt-5j for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:54:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYUA-00013G-4A for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:53:59 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56439) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcYU6-00011O-6B; Mon, 09 Jul 2018 11:53:54 -0400 Original-Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com (mrgmx103 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MD9uq-1ft6tL3otw-00GbNV; Mon, 09 Jul 2018 17:53:48 +0200 Content-Disposition: inline X-Provags-ID: V03:K1:nLsFmISwt1avRsRKsn27Ff9e6bOXEEONtafFts//l1PtIfnARH3 azFeWUHIbYmCAB9Pq38tnP4p/qMlSlf+SQk2vhElSu4dbR9CrMtStt0OUKKLgCJzpk+mdH1 1ICb6gAi0EGQ6VIsf16QMuU/HEnIPEvPklQmKNYQYmuQrTVZYWVLj1R0o1MriWwdXN2bz1u AF8+E1MVKXdGpe/Z2MWBw== X-UI-Out-Filterresults: notjunk:1;V01:K0:gDiZDz0TvPM=:slKVja9NR51HGqeixYEYci 1YKlHZbSX4wJMPcQw15Qlw3jWBKN4zu2w27jTdSHZ7TI0ZSk0clIwS9yVEVR4PAI5B673KOTt Pcr1/4Ce1LbZRWtNJ8ubBh7iewqWvMCkl8cQYihFfjqLM6DRvtNdRun/d4226As4TsMLk/HHW creDyjDp4FkBv+gOnjs7n2GPx780dMxxThy0dubvzT6lqTfTBH+z7qQlXQPO6C0+3P7bYmsll RhSShEeM/CNxSdwoiw7hiqGT/1ZD0ZWL2erFDrs3Q/CpvM6pxUC+jXWpUgXtw+ocUKFea4yZc rMOuyWeQV78cN+VLZY7ih6Fc06Po9wqAZB69Vmlm1+COOsBa0Zh2i/s99L4bcuyfXB7hBUm7B RZTlKL3Ig6CyDJhGEMWbTYiF7e+zaNBdWBMzQctsCwOs5t7gyHPMsU51WprejN+X8ms9L4xLJ yNOzV/r8O8SEF4AdHOHV4UXBRMVii7PwBuhQAUx5FabVkS11cHaPRv885iBuWBlRrjVvnAKT8 mn4TzM4w1LmMDtBN6Q8RW4gXQH8uVYni37ahWIFmKW6eB14TwO4OhqNrlCrjCJg464/7oTqBP lVyncFc2vxpYQEMFVjza47Z9vD5EnkxkWbE9yMhTaCpD5zhH6jqpSefaugU7/upeSalAFEwv3 lQw0Se+we985IX9PK9NEzLyx+BqnpB79QKwwb9XGQuptEi+ZAbG1EnIe0JY7PuC8JgLBwaiTt 2woOqfEhOKAl06lysANuoe8EUeb5HoZqbp2WkPHM4+Eo43ZjaIsgyIUZXmM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:148382 Archived-At: --seavrebpxjibhl45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. Patch attached. In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-07, modified by Debian built on binet System Description: Devuan GNU/Linux 2.0.0 (ascii) Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs25-NE1ko4/emacs25-25.2+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix -- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --seavrebpxjibhl45 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="calendar-read-date.patch" --- a.el 2018-07-09 11:50:31.882699070 -0400 +++ b.el 2018-07-09 11:51:07.636744090 -0400 @@ -2243,18 +2243,19 @@ If optional NODAY is t, does not ask for day, but just returns \(month 1 year); if NODAY is any other non-nil value the value returned is \(month year)" - (let* ((year (calendar-read + (let* ((today (calendar-current-date)) + (year (calendar-read "Year (>0): " (lambda (x) (> x 0)) - (number-to-string (calendar-extract-year - (calendar-current-date))))) + (number-to-string (calendar-extract-year today)))) (month-array calendar-month-name-array) (completion-ignore-case t) (month (cdr (assoc-string (completing-read "Month name: " (mapcar 'list (append month-array nil)) - nil t) + nil t nil nil + (aref month-array (1- (calendar-extract-month today)))) (calendar-make-alist month-array 1) t))) (last (calendar-last-day-of-month month year))) (if noday @@ -2263,7 +2264,8 @@ (list month year)) (list month (calendar-read (format "Day (1-%d): " last) - (lambda (x) (and (< 0 x) (<= x last)))) + (lambda (x) (and (< 0 x) (<= x last))) + (number-to-string (calendar-extract-day today))) year)))) (defun calendar-interval (mon1 yr1 mon2 yr2) --seavrebpxjibhl45--