From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Heads-up: Emacs 26.1 RC1 Date: Tue, 27 Mar 2018 02:01:43 +0200 Message-ID: <87tvt2fkt4.fsf@web.de> References: <83605snjjt.fsf@gnu.org> <87muz3ixwi.fsf@web.de> <83in9rmdo7.fsf@gnu.org> <83woxyeki9.fsf@gnu.org> <87o9jaob5x.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1522108798 12453 195.159.176.226 (26 Mar 2018 23:59:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 23:59:58 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) Cc: johnw@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 27 01:59:54 2018 Return-path: Envelope-to: ged-emacs-devel@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 1f0c1o-00038i-BB for ged-emacs-devel@m.gmane.org; Tue, 27 Mar 2018 01:59:52 +0200 Original-Received: from localhost ([::1]:59616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0c3r-0004in-V7 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 20:01:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0c3k-0004iS-Hh for emacs-devel@gnu.org; Mon, 26 Mar 2018 20:01:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0c3j-00009w-Bx for emacs-devel@gnu.org; Mon, 26 Mar 2018 20:01:52 -0400 Original-Received: from mout.web.de ([212.227.17.11]:57397) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0c3e-0008VA-98; Mon, 26 Mar 2018 20:01:46 -0400 Original-Received: from drachen.dragon ([88.75.99.135]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MhDkj-1fDcbW3A13-00MP3o; Tue, 27 Mar 2018 02:01:43 +0200 In-Reply-To: <87o9jaob5x.fsf@web.de> (Michael Heerdegen's message of "Mon, 26 Mar 2018 22:05:14 +0200") X-Provags-ID: V03:K0:3iObSjQ0BBhYpXdfbJtyGCW7CqaMV/LvTxFoBRY3nJbDn9QMx4P IW9wdYkEW6MRzfl8WjOF2EA8b2w94cWbDT4CJa+0mqtvxGsH7aZfxruiay58EsS6PmsAU+L LJrR4zkApQTq7rZgy9IuUZRzg1VIKktIKvywIiJpB4TcmikSrNlNnfELo2qmFUG5HYElaWK a7+S95y4Yo9Q6anPKkOuA== X-UI-Out-Filterresults: notjunk:1;V01:K0:+JFO5WPKN/Y=:99p7U/WnI6siYe2cA+RPAg VqIViOECegKc5JbMsxEgarwcUjA0U4V2faCvOP2v/ZoyNfWpK6/WwHaS3nq/wEFrcYPvoqiuO 7C7sC0S/kDGbNxj/dMAEF0Vt0gV8Z4wJTrza2DI0YGQ/h+tLLN/tLwVMGe0SMlt5ZYKO9Tp30 cKIJj65JeC/P+5ZQfQpeHe8K+Up7xQLSx4np8b9nKT9PMsyoclEdtyE4BMScLpHCyI2bOfulk K/cyEk/2n4b6W5YvHf+KGgd5GnKKiLgBsKQExgEYZsZbLrE7Me0g43UouBZJsCZ3m43BaHFL0 2E0aLGc80bxlr8zI29aLbHGuTXVIeRmpH4lzVd/x7sG9l+KtM7ecVma7hwq5BIqtFFA3xkOYr SDx7VYV4zBHv4j2e+GiRRkRfW+T639wFy3KPBcUFFo8nxVA2Lzl6EiUcjOwLgre9ZkiN2hlZR Y/Y1tz9Eg6kOZ9lgI6bIOZVhjBvfOwCwwDJiWGhmpK1x1EsW5p3vLDay+Su2xQ1sOK64IpExf 3As8Jqp7vbCtxPfpFFLqwz0wDdY82oNgJFc+y/zfOtypvY0e2eGsS2GgIgvpgeFTfuJXv0aWH FSBJZG1PB+n9DdmhadYSVWoLTQab36hcitlGUlXE5ff6LlzBBTxYC1+nPufJ8LJ7JkL6VleeP ALdTazmvsrXX8ato0Sul1EonSrGEJZa2857XOrE/3mcgo2RqCAD0dC4WM2vo7j8SLebDIRSR/ Ax7tfIR3xi+6l1O7aFL8i61TK5GxCMrWZJGE0YsqNC4jFA0zy5Sqxn+V+8BuU3Rfb0u9BvNb X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224080 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > I'll work on it in the next hours. Sorry about the procrastination. Here is the updated patch. Does it look ok? Thanks, Michael. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-De-obsolete-if-let-and-when-let.patch >From 441fe201ea129709ac9807b9b6b30caa45bbd293 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Sat, 10 Mar 2018 16:39:41 +0100 Subject: [PATCH] De-obsolete `if-let' and `when-let' For the following release it is planned to make `if-let*' and `when-let*' aliases for `if-let' and `when-let'. For now we revert declaring `if-let' and `when-let' obsolete and tweak the docstrings. * lisp/emacs-lisp/subr-x.el (if-let*, when-let*): Make docstrings refer to those of `if-let' and `when-let'. (if-let, when-let): De-obsolete. Rewrite documentation. --- etc/NEWS | 8 ++------ lisp/emacs-lisp/subr-x.el | 46 ++++++++++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index f5da6870b7..4adedfce1a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1305,12 +1305,8 @@ current buffer or the self-insertion takes place within a comment. ** The alist 'ucs-names' is now a hash table. --- -** 'if-let' and 'when-let' are subsumed by 'if-let*' and 'when-let*'. -The incumbent 'if-let' and 'when-let' are now marked obsolete. -'if-let*' and 'when-let*' do not accept the single tuple special case. -New macro 'and-let*' is an implementation of the Scheme SRFI-2 syntax -of the same name. 'if-let*' and 'when-let*' now accept the same -binding syntax as 'and-let*'. +** 'if-let' and 'when-let' now support binding lists as defined by the +SRFI-2 (Scheme Request for Implementation 2). --- ** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 21dba377bf..7fab9083e8 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -123,15 +123,8 @@ internal--build-bindings (defmacro if-let* (varlist then &rest else) "Bind variables according to VARLIST and eval THEN or ELSE. -Each binding is evaluated in turn, and evaluation stops if a -binding value is nil. If all are non-nil, the value of THEN is -returned, or the last form in ELSE is returned. - -Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds -SYMBOL to the value of VALUEFORM. An element can additionally -be of the form (VALUEFORM), which is evaluated and checked for -nil; i.e. SYMBOL can be omitted if only the test result is of -interest." +This is like `if-let' but doesn't handle a VARLIST of the form +\(SYMBOL SOMETHING) specially." (declare (indent 2) (debug ((&rest [&or symbolp (symbolp form) (form)]) form body))) @@ -144,11 +137,8 @@ if-let* (defmacro when-let* (varlist &rest body) "Bind variables according to VARLIST and conditionally eval BODY. -Each binding is evaluated in turn, and evaluation stops if a -binding value is nil. If all are non-nil, the value of the last -form in BODY is returned. - -VARLIST is the same as in `if-let*'." +This is like `when-let' but doesn't handle a VARLIST of the form +\(SYMBOL SOMETHING) specially." (declare (indent 1) (debug if-let*)) (list 'if-let* varlist (macroexp-progn body))) @@ -168,12 +158,25 @@ and-let* (defmacro if-let (spec then &rest else) "Bind variables according to SPEC and eval THEN or ELSE. -Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)." +Each binding is evaluated in turn, and evaluation stops if a +binding value is nil. If all are non-nil, the value of THEN is +returned, or the last form in ELSE is returned. + +Each element of SPEC is a list (SYMBOL VALUEFORM) which binds +SYMBOL to the value of VALUEFORM. An element can additionally be +of the form (VALUEFORM), which is evaluated and checked for nil; +i.e. SYMBOL can be omitted if only the test result is of +interest. It can also be of the form SYMBOL, then the binding of +SYMBOL is checked for nil. + +As a special case, a SPEC of the form \(SYMBOL SOMETHING) is +interpreted like \((SYMBOL SOMETHING)). This exists for backward +compatibility with the old syntax that accepted only one +binding." (declare (indent 2) (debug ([&or (&rest [&or symbolp (symbolp form) (form)]) (symbolp form)] - form body)) - (obsolete "use `if-let*' instead." "26.1")) + form body))) (when (and (<= (length spec) 2) (not (listp (car spec)))) ;; Adjust the single binding case @@ -182,9 +185,12 @@ if-let (defmacro when-let (spec &rest body) "Bind variables according to SPEC and conditionally eval BODY. -Like `when-let*' except SPEC can have the form (SYMBOL VALUEFORM)." - (declare (indent 1) (debug if-let) - (obsolete "use `when-let*' instead." "26.1")) +Each binding is evaluated in turn, and evaluation stops if a +binding value is nil. If all are non-nil, the value of the last +form in BODY is returned. + +The variable list SPEC is the same as in `if-let'." + (declare (indent 1) (debug if-let)) (list 'if-let spec (macroexp-progn body))) (defsubst hash-table-empty-p (hash-table) -- 2.16.2 --=-=-=--