unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56809: file-name-with-extension: Improve docstring.
@ 2022-07-28  6:31 Damien Cassou
  2022-07-28  7:49 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Damien Cassou @ 2022-07-28  6:31 UTC (permalink / raw)
  To: 56809

[-- 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-07-28 13:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28  6:31 bug#56809: file-name-with-extension: Improve docstring Damien Cassou
2022-07-28  7:49 ` 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

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).