unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ricardo G. Herdt" <r.herdt@posteo.de>
To: 41621@debbugs.gnu.org
Subject: bug#41621: [PATCH] Add missing documentation (canonicalize-path)
Date: Sat, 30 May 2020 23:07:12 +0200	[thread overview]
Message-ID: <0daa59cddf5e7964da1564897df6ff19@posteo.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

Guile's manual doesn't mention the procedure canonicalize-path. I copied 
it over from libguile/filesys.c, and just added "(absolute)" to the text 
to help users finding it, since this term is more usual in other 
languages. I didn't make this change to filesys.c though.

Regards,

Ricardo G. Herdt

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-doc-Add-missing-canonicalize-path-documentation.patch --]
[-- Type: text/x-diff; name=0001-doc-Add-missing-canonicalize-path-documentation.patch, Size: 1309 bytes --]

From f899d43554f81bf1d20c22e07437a4e49e2bb400 Mon Sep 17 00:00:00 2001
From: "Ricardo G. Herdt" <r.herdt@posteo.de>
Date: Sat, 30 May 2020 22:50:16 +0200
Subject: [PATCH] doc: Add missing canonicalize-path documentation.

The documentation is copied over from libguile/filesys.c. I just added
"(absolute)" to the text to help users finding it, since this term is
more common in other languages.

* doc/ref/posix.texi
---
 doc/ref/posix.texi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index b2be9d707..f34c5222d 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1040,6 +1040,21 @@ If @var{suffix} is provided, and is equal to the end of
 @end lisp
 @end deffn
 
+@deffn {Scheme Procedure} canonicalize-path path
+@deffnx {C Function} scm_canonicalize_path (path)
+Return the canonical (absolute) path of @var{path}.
+A canonical path has no @code{.} or @code{..} components,
+nor any repeated path separators (@code{/}) nor symlinks.
+
+Raises an error if any component of @var{path} does not
+exist.
+
+@lisp
+(canonicalize-path "test.xml")
+@result{} "/tmp/test.xml"
+@end lisp
+@end deffn
+
 @deffn {Scheme Procedure} file-exists? filename
 Return @code{#t} if the file named @var{filename} exists, @code{#f} if
 not.
-- 
2.20.1


             reply	other threads:[~2020-05-30 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 21:07 Ricardo G. Herdt [this message]
2020-06-17 21:32 ` bug#41621: [PATCH] Add missing documentation (canonicalize-path) Ludovic Courtès

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/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0daa59cddf5e7964da1564897df6ff19@posteo.de \
    --to=r.herdt@posteo.de \
    --cc=41621@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.
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).