From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: (format "Hello %1$S%2$s" 'world "!") Date: Sun, 2 Jul 2017 13:25:43 -0400 Message-ID: <3ea9c72e-352e-67d6-1c85-64441d458b4a@gmail.com> References: <061782A1-0A51-49A1-9AA4-706AF8927D01@gmail.com> <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> <617557F2-0316-4504-BE80-E7F29E4EE347@gmail.com> <86E604C6-4A01-42D2-A3CD-D758FC5DD8B1@gmail.com> <6fc86e25-4515-0787-d984-9160bc9c15e7@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1499016401 8432 195.159.176.226 (2 Jul 2017 17:26:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 17:26:41 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 Cc: Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 02 19:26:36 2017 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 1dRidj-0001ju-Pl for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 19:26:31 +0200 Original-Received: from localhost ([::1]:58728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRidp-0005G7-7w for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 13:26:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRid3-0005E8-F2 for emacs-devel@gnu.org; Sun, 02 Jul 2017 13:25:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRid0-0006eF-94 for emacs-devel@gnu.org; Sun, 02 Jul 2017 13:25:49 -0400 Original-Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:36110) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRid0-0006dq-0L for emacs-devel@gnu.org; Sun, 02 Jul 2017 13:25:46 -0400 Original-Received: by mail-qk0-x22a.google.com with SMTP id p21so131785875qke.3 for ; Sun, 02 Jul 2017 10:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eZKtr+/npIqeKsQOZ7fFlD7z1Zr4Go56uUTOmiVnylw=; b=CEZ6RAbUPdECxJ7JJdiX8T9jK9KQOPu2cMfr7Sfb07fpVA0FB7dCErF0OfnLSHHTzz 975VZMSF2Sx+MsrgwIqSa3U7HlwL4DkhItRhLqPkup7sUP7omugz/XG/LiSRHOkBCFZ2 e0EtDQA5aCHSCn3mWEmIaR0HNUndg5yDX9Vyls378+fOLFF0j/PgH5XB3s9Cwd2hCtpa VXn5KoDxpOzEPfxpU4d1+I66Gy7ZcobUi0pWXy3UKaKphReppNy/NwJVfxz4NVZSOSyf vUpSvrxQ4ch5Ted3A1rxxmomogO9k7HsPHWy09oOyg5sjYJW46giqyE1sYp3QKLgoS98 ly2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eZKtr+/npIqeKsQOZ7fFlD7z1Zr4Go56uUTOmiVnylw=; b=hwmokqWImCtGLnBFqNB2T8z4DS7b0sCKcxMAm5jGvmA72f5mywQ0AiseJVeNnOpr5/ Oa0+0B1uVEdILuYAPxusYJ5J7C4uRRhRhSiGhS/iw9OJgGLhHGkGixKam9iPN6dZWSsJ KqwGjT7S9USzq2N9UdSdbq/WyxWM1TFdauOgiTWBtJYtNyRi5Fk4B5XEvqQAg8Xzl5UR SuoZP9Kg45mogTAJI3sjw4XIrZJsRSYkSU3IPCqBE482NLhMqFdPZoYl1SARI0qKfCsp gXSnyfdd/KdikNTo8O6SauWdaLgLA8+cBzWUt0OSWZBhW9vTx2GAjRNWTynVuutsIS2o 22bA== X-Gm-Message-State: AKS2vOzD4f4QUC9gQALskep7qi4CcNHoU6q3Iq2PnbaAjD354xjM/Ijo l6AMAOg0UxHbFIICFw8= X-Received: by 10.55.79.198 with SMTP id d189mr35002680qkb.37.1499016345148; Sun, 02 Jul 2017 10:25:45 -0700 (PDT) Original-Received: from [18.111.28.55] (dhcp-18-111-28-55.dyn.MIT.EDU. [18.111.28.55]) by smtp.gmail.com with ESMTPSA id d16sm10379016qke.5.2017.07.02.10.25.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jul 2017 10:25:44 -0700 (PDT) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22a 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:216117 Archived-At: On 2017-07-02 12:54, Noam Postavsky wrote: > On Sun, Jul 2, 2017 at 12:32 PM, Clément Pit-Claudel > wrote: >>> Why would we need a new function since %n$ would be an error for the old format anyway? >> >> This in itself is a good reason to have a new function. A new function lets you migrate existing code, including plugins, to the new syntax, and load the polyfill in older Emacsen. A new syntax that causes errors in old Emacsen isn't usable by anyone outside of Emacs core, for fear of compatibility problems. > > We can still give a new name I suppose. I think it would be nice, if we also write a polyfill. If we don't intend to write one, then there's probably no point. >> The ones I'm familiar with use $1, {1}, or similar syntax, > > What's the equivalent of %1$d in that syntax? Or is it just strings? {1:d} (this one is Python). >> but I've never seen %1$s :/ > > It's a POSIX extension to C's printf [1,2], also used by Java [3] and perl [4]. > > [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html > [2]: https://en.wikipedia.org/wiki/Printf_format_string > [3]: https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html > [4]: https://perldoc.perl.org/functions/sprintf.html Then I guess it's good enough :) Maybe I just need to get used to that syntax. Clément.