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: Tue, 25 May 2021 12:45:58 -0700 Message-ID: References: <6ff4b7d7-03ac-48d1-8d49-de66431d4e5b@www.fastmail.com> <87lf82y9pv.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=4806ea837b2f47bd900a8a504f4c4167 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8153"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Cc: emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 25 21:55:09 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 1lld8u-0001v4-VO for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 21:55:09 +0200 Original-Received: from localhost ([::1]:41688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lld8u-0000Lq-1c for ged-emacs-devel@m.gmane-mx.org; Tue, 25 May 2021 15:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lld0h-0006lD-EV for emacs-devel@gnu.org; Tue, 25 May 2021 15:46:39 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lld0f-00079l-Ni for emacs-devel@gnu.org; Tue, 25 May 2021 15:46:39 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 10A7D5C01B9; Tue, 25 May 2021 15:46:37 -0400 (EDT) Original-Received: from imap1 ([10.202.2.51]) by compute1.internal (MEProxy); Tue, 25 May 2021 15:46:37 -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=hoObPhDaYu2VD2kj4Us9RcT0qKNAdWt gwxjE8ykAw7k=; b=Usxtd5S2YPk38Q/3RBI8B4D5qsGk3rnCL8lmHGbNo4doIsZ 0piADDOH8VMPD7HivNrDMTemSEcWfyHdnT28XdqPKXWLZkXX6PclAWeAH+Bd8gs9 yeP8uT5ssc4I4wmgTVQ3IIlMlqiT/REgDZHjRaMZ6wyo+Lmr2unKmeCt8sPzCzjK G3LVQtdai5ZXvqOugqd2yuQ++Hns1HOPV0TDsbsX/RvBTSCqeEDHmfrr3RO70Gy1 V+FrrHJGHWwI8yCcGyKY4w73uuwR4Ai9Xjx1Gp/VaYPyZuebVOZ1j8Wo6UFdd+Qn TApILTBueO/Cb4e7s/y4R2DeaHoYFUZjeQTMllQ== 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=fm2; bh=hoObPh DaYu2VD2kj4Us9RcT0qKNAdWtgwxjE8ykAw7k=; b=pd/0RpFyRerGssK4Ce61gK dN0IhLKuzdpTlqByiJwmpwwFe2hj7smn8H97YxIEDHeVaqTnifuFIP62JErL5oNr n7R5Fyi3EvbDBjo0qQKymGqlxU36RXQPrVtgKLlCXxMFgf7oIKGK86JFlcMKr0dQ b1xnVGtnTtpoxHm7YUXzdkuSaHhltMU45w2sWZdI42eTbdXZhhKxLAaxS98dnoV9 DIelVQrRnIv+AHBO7vW+pcNot8/DeiKPCcY9a/EwFi0qtRFZlMa7rEM++Gq5JlgZ lti8hA6oUqAweayCnShB71zlub4/5tUr0F3/yYmZkU4QV1ZPBzCG1hRUFWS1k0lA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekuddgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehmtderreerredtnecuhfhrohhmpedfveho lhhinhcuhghoohgusghurhihfdcuoegtohhlihhnsehfohhsshhkvghrshdrtggrqeenuc ggtffrrghtthgvrhhnpefffffgheegfeegvedvtdegueeuhfdufeetgedtheekgedvieef vedvfeegieeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegtohhlihhnsehfohhsshhkvghrshdrtggr X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 814B9130005F; Tue, 25 May 2021 15:46:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87lf82y9pv.fsf@tcd.ie> Received-SPF: none client-ip=66.111.4.28; envelope-from=colin@fosskers.ca; helo=out4-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:269890 Archived-At: --4806ea837b2f47bd900a8a504f4c4167 Content-Type: multipart/alternative; boundary=199cc6294c594510bb4243a789b428d7 --199cc6294c594510bb4243a789b428d7 Content-Type: text/plain Thank you, you're right. I've tested the old and revised code, and the double backslash wasn't neccesary. I've attached the revised patch. On Tue, 25 May 2021, at 11:00, Basil L. Contovounesios wrote: > "Colin Woodbury" > writes: > > > + (let* ((patt "[ \\t\\n\\r.]+") ; Borrowed from `string-trim'. > > Those backslashes need escaping only in string-trim's docstring, not in > the literal regexp string. > > Thanks, > > -- > Basil > --199cc6294c594510bb4243a789b428d7 Content-Type: text/html
Thank you, you're right. I've tested the old and revised code, and the double backslash wasn't neccesary.

I've attached the revised patch.

On Tue, 25 May 2021, at 11:00, Basil L. Contovounesios wrote:
"Colin Woodbury" <colin@fosskers.ca> writes:

> +    (let* ((patt "[ \\t\\n\\r.]+") ; Borrowed from `string-trim'.

Those backslashes need escaping only in string-trim's docstring, not in
the literal regexp string.

Thanks,

-- 
Basil


--199cc6294c594510bb4243a789b428d7-- --4806ea837b2f47bd900a8a504f4c4167 Content-Disposition: attachment;filename="file-name-set-extension.patch" Content-Type: text/x-patch; name="file-name-set-extension.patch" Content-Transfer-Encoding: BASE64 ZGlmZiAtLWdpdCBhL2xpc3AvZmlsZXMuZWwgYi9saXNwL2ZpbGVzLmVsCmluZGV4IDYyZTE3 MDJmZGYuLjE4YTU0YjNlYzcgMTAwNjQ0Ci0tLSBhL2xpc3AvZmlsZXMuZWwKKysrIGIvbGlz cC9maWxlcy5lbApAQCAtNDg4OSw2ICs0ODg5LDIwIEBAIGV4dGVuc2lvbi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