From: Damien Cassou <damien@cassou.me>
To: 56809@debbugs.gnu.org
Subject: bug#56809: file-name-with-extension: Improve docstring.
Date: Thu, 28 Jul 2022 08:31:24 +0200 [thread overview]
Message-ID: <87edy5929v.fsf@cassou.me> (raw)
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-files.el-file-name-with-extension-Improve-docst.patch --]
[-- Type: text/patch, Size: 1167 bytes --]
From dccdf3dec9a82d4ce05e9978b762d9538e11bdfd Mon Sep 17 00:00:00 2001
From: Damien Cassou <damien@cassou.me>
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
next reply other threads:[~2022-07-28 6:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 6:31 Damien Cassou [this message]
2022-07-28 7:49 ` bug#56809: file-name-with-extension: Improve docstring Eli Zaretskii
2022-07-28 8:35 ` Damien Cassou
2022-07-28 8:57 ` Eli Zaretskii
2022-07-28 9:32 ` Damien Cassou
2022-07-28 9:40 ` Eli Zaretskii
2022-07-28 12:01 ` Damien Cassou
2022-07-28 13:34 ` Eli Zaretskii
2022-07-28 10:34 ` Visuwesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edy5929v.fsf@cassou.me \
--to=damien@cassou.me \
--cc=56809@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).