diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 986fb22c75b..e1aa2de523c 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2445,7 +2445,7 @@ You can use this function for directory names and for file names, because it recognizes abbreviations even as part of the name. @end defun -@defun file-parent-directory filename +@defun file-name-parent-directory filename This function returns the directory name of the parent directory of @var{filename}. If @var{filename} is at the root directory of the filesystem, it returns @code{nil}. A relative @var{filename} is diff --git a/etc/NEWS b/etc/NEWS index 0d69e87907e..ff97c2350f2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -482,7 +482,7 @@ user option 'global-text-scale-adjust-resizes-frames' controls whether the frames are resized when the font size is changed. +++ -** New function 'file-parent-directory'. +** New function 'file-name-parent-directory'. Get the parent directory of a file. ** New config variable 'syntax-wholeline-max' to reduce the cost of long lines. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index fe4f2ae3acf..d07d1019b4d 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -355,11 +355,11 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), (abbreviate-file-name :no-eval (abbreviate-file-name "/home/some-user") :eg-result "~some-user") - (file-parent-directory - :eval (file-parent-directory "/foo/bar") - :eval (file-parent-directory "/foo/") - :eval (file-parent-directory "foo/bar") - :eval (file-parent-directory "foo")) + (file-name-parent-directory + :eval (file-name-parent-directory "/foo/bar") + :eval (file-name-parent-directory "/foo/") + :eval (file-name-parent-directory "foo/bar") + :eval (file-name-parent-directory "foo")) "Quoted File Names" (file-name-quote :args (name) diff --git a/lisp/files.el b/lisp/files.el index 7fde8720fa7..1e1ec6127de 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5173,7 +5173,7 @@ On most systems, this will be true: (setq filename nil)))) components)) -(defun file-parent-directory (filename) +(defun file-name-parent-directory (filename) "Return the directory name of the parent directory of FILENAME. If FILENAME is at the root of the filesystem, return nil. If FILENAME is relative, it is interpreted to be relative