From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daanturo Newsgroups: gmane.emacs.bugs Subject: bug#49316: Add apply-partially's right version Date: Fri, 2 Jul 2021 00:06:35 +0700 Message-ID: References: <2315db79-00cf-b2f0-b5df-93cd53392292@gmail.com> <87czs2faas.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9BFCF884AFB7166958B388F1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20634"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: "Basil L. Contovounesios" To: 49316@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 01 19:07:25 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz09s-0005Gn-FN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 19:07:24 +0200 Original-Received: from localhost ([::1]:54480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz09r-0007Mh-FQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 13:07:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz09W-0007Jk-6E for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 13:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lz09V-0007GU-UT for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 13:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lz09V-0008BG-Jo for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 13:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: daanturo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49316-submit@debbugs.gnu.org id=B49316.162515920631414 (code B ref 49316); Thu, 01 Jul 2021 17:07:01 +0000 Original-Received: (at 49316) by debbugs.gnu.org; 1 Jul 2021 17:06:46 +0000 Original-Received: from localhost ([127.0.0.1]:33629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz09G-0008Ac-5l for submit@debbugs.gnu.org; Thu, 01 Jul 2021 13:06:46 -0400 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:35802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz09E-0008AK-RC for 49316@debbugs.gnu.org; Thu, 01 Jul 2021 13:06:45 -0400 Original-Received: by mail-pg1-f169.google.com with SMTP id v7so6709991pgl.2 for <49316@debbugs.gnu.org>; Thu, 01 Jul 2021 10:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=l9i+5+1Tick/1PfQO/GANiIHXn+Kd9eLfkJtZTfmmwA=; b=smlBoKcb4vIN8+eKwQfkCIvc0jRYUDEsf9RcO4SP7RqoOS0RuKLLe/E48FDsBja65g FsVmaKw/OIegMySlDRtuVplZkww2338wN/V/I9cwX9X/CIXEVJM80qWnObWo4IXRVyfQ G6vt5jLhghtY0fu8eGr9h+mglrk9c+sXIBOiV/5ZhQXoUsEDWx5BH39z+fW8WSaZK9MZ Zb913tRoeuex3j89l4mxM/8roaKKCuT8mTSoR5Sufw54ywbYYBpIBgQMuA65AaQoqJi1 sr2FQsT7wPgZe6XHp+FTkgGU15OkFxUfpS6SyPawx0MVkK6typp/YM+MHizRm4c7pqc4 91/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=l9i+5+1Tick/1PfQO/GANiIHXn+Kd9eLfkJtZTfmmwA=; b=B1UBPOk9jrVnfdzpi26+daCWvFC6Y3jYU6/eh5AZMxs0W+LI0Yr2f8tDzNz3U6nunO ce8PUhWxAeD6NRR/KbXJ6/rEbtiMfmAgMC4QbZVE1NCYuZClEF+0C7a+QCkc2zryhKw2 YrGtcUoadfJpESo+PMOvo4kb40ApoBk3mXrPet/1yHGIfal7PbbHmFJeAVfiDN1N9jVA /D5NIuNzYenzJvcLsVz1hfo/nT2meDDZ9BEHspzwncCH/i3beYP+UCmX8yerqerCDsg1 DAts79zpRiQw3FQ2nYzAWN4TFhbXGrDxStTTuZINoD0r8yo8H2yrqoY+H47hdv6dE69T FS9g== X-Gm-Message-State: AOAM532HJgIlTAeSSNKXQR14c7+bdxw9AE3oeB1VH6EE+avJPLAtspNU bXBH+3FrfiQAvZNHZE5GzEY= X-Google-Smtp-Source: ABdhPJzHKkDhTKmJtKXC0GpSRve4miRUGRE1+ud8LlP21JJ9no5OAmwuMjrps/Ei+H4Q/VohQdvwiQ== X-Received: by 2002:aa7:9252:0:b029:2ae:bde3:621f with SMTP id 18-20020aa792520000b02902aebde3621fmr1007905pfp.18.1625159198873; Thu, 01 Jul 2021 10:06:38 -0700 (PDT) Original-Received: from ?IPv6:2402:800:630f:53b:ee3a:5256:1634:1e03? ([2402:800:630f:53b:ee3a:5256:1634:1e03]) by smtp.gmail.com with ESMTPSA id i8sm524911pfo.154.2021.07.01.10.06.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 10:06:38 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209277 Archived-At: This is a multi-part message in MIME format. --------------9BFCF884AFB7166958B388F1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit --=-=-= Content-Type: text/plain Tags:  49316 + patch Added documentation in doc/lispref/functions.texi and etc/NEWS. (Please ignore my immediately precededing email, I'm sorry for not being used to sending patches by mailing list.) Thank you. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0002-Add-apply-rpartially-documents.patch From b56a83f2765d3dfb1db011acc561bf107c934594 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 23:01:42 +0700 Subject: [PATCH 2/2] Add apply-rpartially documents * doc/lispref/functions.texi (Calling Functions): Add explanation and example usage * etc/NEWS (Lisp Changes in Emacs 28.1): Announce new function --- doc/lispref/functions.texi | 17 +++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 64883bf0f6..80d0c96687 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -845,6 +845,23 @@ built-in function: @end example @end defun +@defun apply-rpartially func &rest args +This function does mostly the same as @code{apply-partially}, but +@var{args} are aligned to the right of @var{func}'s parameters +instead. + +@example +@group +(defalias 'square (apply-rpartially #'expt 2) + "Return argument squared.") +@end group +@group +(square 3) + @result{} 9 +@end group +@end example +@end defun + @cindex functionals It is common for Lisp functions to accept functions as arguments or find them in data structures (especially in hook variables and property diff --git a/etc/NEWS b/etc/NEWS index 605c4d228f..252e6b4d0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,6 +2909,11 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 ++++ +** New function 'apply-rpartially'. +Funcionally equivalent to 'apply-partially' but arguments are aligned +to the right instead. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the -- 2.32.0 --=-=-=-- -- Daanturo. --------------9BFCF884AFB7166958B388F1 Content-Type: text/x-patch; charset=UTF-8; name="0002-Add-apply-rpartially-documents.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Add-apply-rpartially-documents.patch" >From b56a83f2765d3dfb1db011acc561bf107c934594 Mon Sep 17 00:00:00 2001 From: Daanturo Date: Thu, 1 Jul 2021 23:01:42 +0700 Subject: [PATCH 2/2] Add apply-rpartially documents * doc/lispref/functions.texi (Calling Functions): Add explanation and example usage * etc/NEWS (Lisp Changes in Emacs 28.1): Announce new function --- doc/lispref/functions.texi | 17 +++++++++++++++++ etc/NEWS | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 64883bf0f6..80d0c96687 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -845,6 +845,23 @@ built-in function: @end example @end defun +@defun apply-rpartially func &rest args +This function does mostly the same as @code{apply-partially}, but +@var{args} are aligned to the right of @var{func}'s parameters +instead. + +@example +@group +(defalias 'square (apply-rpartially #'expt 2) + "Return argument squared.") +@end group +@group +(square 3) + @result{} 9 +@end group +@end example +@end defun + @cindex functionals It is common for Lisp functions to accept functions as arguments or find them in data structures (especially in hook variables and property diff --git a/etc/NEWS b/etc/NEWS index 605c4d228f..252e6b4d0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,6 +2909,11 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 ++++ +** New function 'apply-rpartially'. +Funcionally equivalent to 'apply-partially' but arguments are aligned +to the right instead. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the -- 2.32.0 --------------9BFCF884AFB7166958B388F1--