From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] lisp/files.el: Add `file-name-set-extension` Date: Fri, 4 Jun 2021 15:08:05 +0200 Message-ID: <392FB601-CF1D-482F-B373-B443C4131412@gmail.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> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33688"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andreas Schwab , emacs-devel@gnu.org To: Colin Woodbury Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 04 15:09:29 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 1lp9Zo-0008bx-RZ for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 15:09:28 +0200 Original-Received: from localhost ([::1]:50334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp9Zn-0002NC-Uq for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 09:09:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp9YZ-0000qY-Fa for emacs-devel@gnu.org; Fri, 04 Jun 2021 09:08:11 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lp9YX-0005Sz-TR for emacs-devel@gnu.org; Fri, 04 Jun 2021 09:08:11 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id f17so5347891wmf.2 for ; Fri, 04 Jun 2021 06:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=87k3SfzSof9TMdEm7/Cv+VIuVqRBCOM4nshyPS2yHQU=; b=tBJb2eF58mWC6cjwOq0IodIaIkm95QItVdLfFrROqkh/aDXB5GA41ptidPeZBXwIQg cgO3m7Zehp49J7xVZVFrTELJZ97eKWI+8clKwcYE8+0vM+qELqPlgKs+fFrbY28e6Ers YNI8pX09NZFf2qaiNkyVvPpa7XHPqRYDsFUid5Ofoe0G4fAGwua1lvVx+iL0g/W9olM5 u9PninDWhVB2fG+NFAFLukk/PLpoNWsI2RJsnmruExQ9b5EBhSlZZQFyCWohXJBz9Y17 /hSy4XHvDGcVYzEil4fojssT2J8y8HKZmbsf9KbTYIa8onuortlYpyXntPqQewucrH5c F1hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=87k3SfzSof9TMdEm7/Cv+VIuVqRBCOM4nshyPS2yHQU=; b=dRmX78M6f/Z6xf+5vhD7w/FewANA2VPdhHCtP592Srob4l6qojqU84twccdc1gj6Gt Rnm/Nwzbtg09wlMaDMHC7cptVna9ov6wxbXr3onq64PftlNWD3+FAI46Q8JNo9EZt8dc qdA8F/zQFKlZd9rXs6pgQ6bfmx/SuK0DZPeyI+78NvXkg9kK0ZLwSbo6LskrXpWs8TpA 44+iwahvIyM/cTbgKXrypDljNReHRaFvsqbGN6aaz1+7L001EBNtXBP+NdZnEAV7XuWY 4ucouArQVNpi0T+HgEzWsz7QdnKvNZjkhdVanPS0C18Oz1zWvvlnz4+07qfArqZnQGVR MZrw== X-Gm-Message-State: AOAM531ao4D5SktZ1WiRu48z+tavJYWpB2dxNLFGlL9wrSW5IzIMelkK HCp2AafNm2Da8gls7Vn4DTQ= X-Google-Smtp-Source: ABdhPJzfJh+VI6iO8CM+KBpTAv8TrG4sJ0k4H4Djtz5RySVn4uRNCgFXtEtg3GrfJDzrOUgXPF72sg== X-Received: by 2002:a05:600c:255:: with SMTP id 21mr3674772wmj.46.1622812087288; Fri, 04 Jun 2021 06:08:07 -0700 (PDT) Original-Received: from smtpclient.apple ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id o6sm7531312wre.73.2021.06.04.06.08.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jun 2021 06:08:06 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.80.0.2.43) Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=p.stephani2@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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:270385 Archived-At: > Am 31.05.2021 um 03:16 schrieb Colin Woodbury : >=20 > Hi Andreas (et al.), >=20 > After asking around, it seems like letting `string-trim` fail = naturally is indeed the canonical thing to do here, especially since = with `toggle-debug-on-error` we're able to get the full call-stack if we = need it. I've altered the patch (see attached) accordingly. Thanks for = your patience. >=20 > Cheers, > Colin >=20 > On Wed, 26 May 2021, at 10:39, Andreas Schwab wrote: >> That's exactly what should happen. >>=20 >> Andreas. >>=20 >> --=20 >> Andreas Schwab, schwab@linux-m68k.org >> GPG Key fingerprint =3D 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA = AEC1 >> "And now for something completely different." >>=20 >=20 > Some general comments: - Please add unit tests, especially testing corner cases such as empty = strings, directory names, filenames starting with a dot, etc. - I'd rename the function to something that doesn't contain "set". = "set" gives the impression that the function modifies the filename in = place, which it doesn't do. Likewise, change the docstring to clarify = that a new string is returned.=