From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Cassou Newsgroups: gmane.emacs.bugs Subject: bug#56809: file-name-with-extension: Improve docstring. Date: Thu, 28 Jul 2022 08:31:24 +0200 Message-ID: <87edy5929v.fsf@cassou.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31198"; mail-complaints-to="usenet@ciao.gmane.io" To: 56809@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 28 08:44:02 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oGxFa-0007wp-E1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 08:44:02 +0200 Original-Received: from localhost ([::1]:57804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGxFY-0007ed-V5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 02:44:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGx3z-00089d-0s for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 02:32:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGx3y-0007ar-OU for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 02:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGx3y-0001YG-ER for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 02:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jul 2022 06:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16589899085938 (code B ref -1); Thu, 28 Jul 2022 06:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jul 2022 06:31:48 +0000 Original-Received: from localhost ([127.0.0.1]:57445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGx3k-0001Xi-3a for submit@debbugs.gnu.org; Thu, 28 Jul 2022 02:31:48 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGx3f-0001XU-G2 for submit@debbugs.gnu.org; Thu, 28 Jul 2022 02:31:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGx3e-0007xx-MX for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 02:31:43 -0400 Original-Received: from mail.choca.pics ([80.67.172.235]:58580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGx3c-0007ZB-3X for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 02:31:41 -0400 Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 34B4818192DC8 for ; Thu, 28 Jul 2022 08:31:26 +0200 (CEST) Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id 4rmDXGW01Q6X for ; Thu, 28 Jul 2022 08:31:25 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 6DC4B18192DCC for ; Thu, 28 Jul 2022 08:31:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at choca.pics Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id Smws9_NjZEmh for ; Thu, 28 Jul 2022 08:31:25 +0200 (CEST) Original-Received: from localhost (240-68-190-109.dsl.ovh.fr [109.190.68.240]) by mail.choca.pics (Postfix) with ESMTPSA id 1A74E18192DC8 for ; Thu, 28 Jul 2022 08:31:25 +0200 (CEST) Received-SPF: pass client-ip=80.67.172.235; envelope-from=damien@cassou.me; helo=mail.choca.pics X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238073 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hi, I found the docstring of file-name-with-extension very confusing so I wrote another one. Best -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-files.el-file-name-with-extension-Improve-docst.patch >From dccdf3dec9a82d4ce05e9978b762d9538e11bdfd Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Thu, 28 Jul 2022 08:27:45 +0200 Subject: [PATCH] ; * lisp/files.el (file-name-with-extension): Improve docstring. --- lisp/files.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 37ed796a68..39b8586a94 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5119,13 +5119,13 @@ file-name-extension ""))))) (defun file-name-with-extension (filename extension) - "Set the EXTENSION of a FILENAME. + "Return a string resulting from the concatenation of FILENAME and EXTENSION. The extension (in a file name) is the part that begins with the last \".\". -Trims a leading dot from the EXTENSION so that either \"foo\" or -\".foo\" can be given. +If EXTENSION doesn't start with a \".\", one is inserted anyway +between FILENAME and EXTENSION. -Errors if the FILENAME or EXTENSION are empty, or if the given +Signal an error if FILENAME or EXTENSION are empty, or if the given FILENAME has the format of a directory. See also `file-name-sans-extension'." -- 2.36.0 --=-=-=--