From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: (format "Hello %1$S%2$s" 'world "!") Date: Sun, 2 Jul 2017 12:54:59 -0400 Message-ID: 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: quoted-printable X-Trace: blaine.gmane.org 1499014511 9182 195.159.176.226 (2 Jul 2017 16:55:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 16:55:11 +0000 (UTC) Cc: Emacs developers To: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 02 18:55:05 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 1dRi9I-00020D-Td for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 18:55:05 +0200 Original-Received: from localhost ([::1]:58649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRi9M-0006mF-NG for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 12:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRi9G-0006lc-Dz for emacs-devel@gnu.org; Sun, 02 Jul 2017 12:55:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRi9F-0002nF-CF for emacs-devel@gnu.org; Sun, 02 Jul 2017 12:55:02 -0400 Original-Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:35168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRi9F-0002mW-7v for emacs-devel@gnu.org; Sun, 02 Jul 2017 12:55:01 -0400 Original-Received: by mail-oi0-x236.google.com with SMTP id 191so41894343oii.2 for ; Sun, 02 Jul 2017 09:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=i8MUGJfBq9iXbt/ZRTSx7vkngXIWWY9yM/mpyVEvVHM=; b=FlCDP392xqFNZFjYtLoISCOY7SS0kAscUlgMDtN1Z9vGrQSDEsXx+sRASuZJIuKH1a Q3BSAv3EF+tNQ4bdhKazhfFYtWx7iYMqjgshA1bj6FOYIHE1agH04/oX5z79ClcSuWLz 2GjbBHuf8ubq6KlTzlGodLvghcCfnWYrAJrO0JbGzp9/NwmZQO7gdkQ5+F6xeiVmNI8i IWHFH3YHvFljxlJhg/t3DWnv1DdCCWTSuW1n0NWE6SdnKnBUgc6ZAtdz7iruiUmVJ60H pF4pZza5AeNHbVHQ4SMCOdHNG8hntpviIrg3aGXqngclxuss5FThIYqkEKPSHgEKInxz Ctvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=i8MUGJfBq9iXbt/ZRTSx7vkngXIWWY9yM/mpyVEvVHM=; b=iPwd7r/s7mUbghN94NiyZLWynCbRGLA/uv3Pyi57RMVIO2WsnHN3M6/6fwj/BHgSlg E+smZGbehiYzLsxx4ECRywu+ZsaS8Yrxm5vXxrIvmm1e0YNbxA+wf0xwpo2lw/CyjA+8 /QqHsvv7zNMkrfBoN0+0dheAP4q+gAf5K3dK2Q8zU8KLvM/ZlcoeyNJ8TaIjdu2gNHcs +VPgOnEmaLEJEOz4JEcD9sDy/21QSwgHXMdQHXkYs7+dv8Nfv4+kuGPb+EjRxQRWIjvd GsbZZPaBjmRk2Loq/hQdUP81pZ+JuVQDaaU577o9TRbbVY0/6XvWXdnoCYjScg3wNCGB 6ydw== X-Gm-Message-State: AKS2vOznfSmb8GUGIBRRCtpeHfNwo6HQNKXqZL4lOYegL3BqphOjnEHp pHppY/JbeZ6RHupDAZ+/IquYB6cdRA== X-Received: by 10.202.177.5 with SMTP id a5mr19452562oif.172.1499014500485; Sun, 02 Jul 2017 09:55:00 -0700 (PDT) Original-Received: by 10.74.113.91 with HTTP; Sun, 2 Jul 2017 09:54:59 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: _miKZzI3IwqULGe7UUa0qD5oZSo X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::236 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:216115 Archived-At: On Sun, Jul 2, 2017 at 12:32 PM, Cl=C3=A9ment 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 l= ets you migrate existing code, including plugins, to the new syntax, and lo= ad the polyfill in older Emacsen. A new syntax that causes errors in old E= macsen isn't usable by anyone outside of Emacs core, for fear of compatibil= ity problems. We can still give a new name I suppose. > 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? > 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