From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Colin Woodbury" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] lisp/files.el: Add `file-name-set-extension` Date: Thu, 10 Jun 2021 07:40:00 -0700 Message-ID: <03440815-be36-42c3-ae57-cc4d7ffd7a0e@www.fastmail.com> References: <6ff4b7d7-03ac-48d1-8d49-de66431d4e5b@www.fastmail.com> <87lf82y9pv.fsf@tcd.ie> <3780a7f9-19f4-4216-baa9-ce00b3dbace9@www.fastmail.com> <6ba4668c-9b39-40e0-a155-f7e583fd33b6@www.fastmail.com> <87czteeyoc.fsf@igel.home> <9a92de1b-e313-468d-aa1f-7f969ed73688@www.fastmail.com> <87h7ipcs3j.fsf@igel.home> <392FB601-CF1D-482F-B373-B443C4131412@gmail.com> <26B660D9-AC76-4AFC-9FFD-2F5D4DCA16C1@acm.org> <87k0n2uppk.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=16476e29378347f998f53e46b49e0d73 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4640"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Cc: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= , Philipp , emacs-devel@gnu.org To: "Michael Albinus" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 10 16:41:28 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lrLs7-00013s-VB for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 16:41:28 +0200 Original-Received: from localhost ([::1]:48322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrLs6-0006eX-St for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 10:41:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrLrL-0005rU-2N for emacs-devel@gnu.org; Thu, 10 Jun 2021 10:40:39 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrLrI-0005zD-RP for emacs-devel@gnu.org; Thu, 10 Jun 2021 10:40:38 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0BC725C0163; Thu, 10 Jun 2021 10:40:36 -0400 (EDT) Original-Received: from imap1 ([10.202.2.51]) by compute1.internal (MEProxy); Thu, 10 Jun 2021 10:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fosskers.ca; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=nR1uq6NGNCVeQjMxdeG7Vpyd2rxDkl7 OkwU9khw0i9Q=; b=iiVMg/LOCmcBT7fjb+D4w/ef/l/TYLWC2yYj4RH9vVOftN+ ubU30JYavI+uEcmcz6Y5GWBXNpZ3P8uXcnaqE2pOeJjB00apTzWrzRzyu8Q+BvQZ sYQEiX+x6aRhFD9wjWdJCdwsdMRWe/Hu0Rc9SFotkKupvoyEKa/AGZL1Xg6M+b0j fBYGYwEyfvnc+FcpBi7UKZADiWrJ7IMQZ7Pri+DekUG8Y/KYBlG7GyYqONyVvXzd IMzNy8o1/OXplzdf7fhEEyzHixrjWEUcIKdyN9sivUchIZdVKEiK3WXGijpxXiUQ n+RrebXV3ThL5/BqvkpfLEhqR0mpZr1+3hIdmbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=nR1uq6 NGNCVeQjMxdeG7Vpyd2rxDkl7OkwU9khw0i9Q=; b=qbuNm73brw2t8I9+xuQFrt INnBDFJ3ib6tiCUYLa/EJ1RVjx2zordpLMtOkQV65Yqdiwzhsb+bbN133Q2F35sa kDPE//T5tJ1Dsg/5jWu7qUcFVurdUEGYmmc9ruKpqsieetHbblmkzydiKtVodgIK D2jHuU2sboynOLFBt97Xvmit/vKo+ZOTlfvysweSHzv1CUcuXnc1TPgJN7/HtB/K FtGwTeWxOW4ch4iJyt6mUNm3Pv6z7Jp6pyX4jhwr63UAn78CIOAQpPMSS5VJrKqq EdXnOueQY6GmVCgvuyOOCE66Lq72yP+bGHEDrYY9N/CXrIqWcLzMu2usfltZPiqA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedufedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesmhdtreerreertdenucfhrhhomhepfdevohhl ihhnucghohhouggsuhhrhidfuceotgholhhinhesfhhoshhskhgvrhhsrdgtrgeqnecugg ftrfgrthhtvghrnhepffffgfehgeefgeevvddtgeeuuefhudefteegtdehkeegvdeifeev vdefgeeileejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheptgholhhinhesfhhoshhskhgvrhhsrdgtrg X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id A6B981300064; Thu, 10 Jun 2021 10:40:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87k0n2uppk.fsf@gmx.de> Received-SPF: none client-ip=66.111.4.25; envelope-from=colin@fosskers.ca; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270644 Archived-At: --16476e29378347f998f53e46b49e0d73 Content-Type: multipart/alternative; boundary=156fb8af6fc643cfb20bc4cb247c4696 --156fb8af6fc643cfb20bc4cb247c4696 Content-Type: text/plain Good catch Michael, thank you, I had completely forgotten about Windows. I've updated the patch. Cheers, Colin On Thu, 10 Jun 2021, at 00:46, Michael Albinus wrote: > "Colin Woodbury" > writes: > > > Hi all, > > Hi Colin, > > > + ((equal ?/ (string-to-char (substring file -1))) (error "Filename is a directory: %s" filename)) > > This shall be (directory-name-p file) . You cannot assume that ?/ is > always the directory separator, for example on MS Windows. > > Best regards, Michael. > --156fb8af6fc643cfb20bc4cb247c4696 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Good catch Mich= ael, thank you, I had completely forgotten about Windows.  I've upd= ated the patch.

Cheers,
Colin=

On Thu, 10 Jun 2021, at 00:46, Michael Alb= inus wrote:
"Colin Woodbury" <colin@fossk= ers.ca> writes:

> Hi all,

Hi Colin,

> + = ;         ((equal ?/ (string-to-= char (substring file -1))) (error "Filename is a directory: %s" filename= ))

This shall be (directory-name-p file) . = You cannot assume that ?/ is
always the directory separato= r, for example on MS Windows.

Best regards,= Michael.


--156fb8af6fc643cfb20bc4cb247c4696-- --16476e29378347f998f53e46b49e0d73 Content-Disposition: attachment;filename="file-name-with-extension.patch" Content-Type: text/x-patch; name="file-name-with-extension.patch" Content-Transfer-Encoding: BASE64 ZGlmZiAtLWdpdCBhL2xpc3AvZmlsZXMuZWwgYi9saXNwL2ZpbGVzLmVsCmluZGV4IDI0NTBk YWY1YmYuLjVmYjliOWRjZGMgMTAwNjQ0Ci0tLSBhL2xpc3AvZmlsZXMuZWwKKysrIGIvbGlz cC9maWxlcy5lbApAQCAtNDg5Miw2ICs0ODkyLDIwIEBAIGV4dGVuc2lvbiwgdGhlIHZhbHVl IGlzIFwiXCIuIgogICAgICAgICAoaWYgcGVyaW9kCiAgICAgICAgICAgICAiIikpKSkpCiAK KyhkZWZ1biBmaWxlLW5hbWUtd2l0aC1leHRlbnNpb24gKGZpbGVuYW1lIGV4dGVuc2lvbikK KyAgIlNldCB0aGUgRVhURU5TSU9OIG9mIGEgRklMRU5BTUUuCitDb25zb2xpZGF0ZXMgbGVh ZGluZy90cmFpbGluZyBkb3RzIHNvIHRoYXQgZWl0aGVyIGBmb28nIG9yIGAuZm9vJworY2Fu IGJlIHBhc3NlZCBhcyBhbiBFWFRFTlNJT04uCisKK1NlZSBhbHNvIGBmaWxlLW5hbWUtc2Fu cy1leHRlbnNpb24nLiIKKyAgKGxldCogKChwYXR0ICJbIC5dKyIpCisgICAgICAgICAoZmls ZSAoc3RyaW5nLXRyaW0tcmlnaHQgZmlsZW5hbWUgcGF0dCkpCisgICAgICAgICAoZXh0biAo c3RyaW5nLXRyaW0tbGVmdCBleHRlbnNpb24gcGF0dCkpKQorICAgIChjb25kICgoc3RyaW5n LWVtcHR5LXAgZmlsZSkgKGVycm9yICJNYWxmb3JtZWQgZmlsZW5hbWU6ICVzIiBmaW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