]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't require default-directory to end with a slash
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 29 Oct 2015 01:00:50 +0000 (03:00 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 29 Oct 2015 01:01:45 +0000 (03:01 +0200)
* doc/lispref/files.texi (Magic File Names): Document the change
in unhandled-file-name-directory.

* lisp/url/url-handlers.el
(url-handler-unhandled-file-name-directory): Update accordingly.

* src/buffer.c (default-directory): Update the docsting.

* src/fileio.c (unhandled-file-name-directory): Default to calling
`file-name-as-directory'
(http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg02294.html).

doc/lispref/files.texi
etc/NEWS
lisp/url/url-handlers.el
src/buffer.c
src/fileio.c

index 65a97a4669911afa4156a8cd79fc99bf1087e13f..6083433842361d39ca3779773269799a193e745f 100644 (file)
@@ -3082,7 +3082,7 @@ making connections when they don't exist.
 
 @defun unhandled-file-name-directory filename
 This function returns the name of a directory that is not magic.  It
-uses the directory part of @var{filename} if that is not magic.  For a
+turns @var{filename} into a directory name if that is not magic.  For a
 magic file name, it invokes the file name handler, which therefore
 decides what value to return.  If @var{filename} is not accessible
 from a local process, then the file name handler should indicate it by
index 47a4bae17c2fe91cf7795e1b89f1d98a336014b8..512b491b5f8f89bc9ddca9fbdc179aa2525fecd0 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1034,6 +1034,11 @@ The new behavior is compatible with Common Lisp and with XEmacs.
 This change does not affect Lisp code intended to be portable to
 Emacs 24.2 and earlier, which did not support unary ‘/’.
 
++++
+** The `default-directory' value doesn't have to end slash.  To make
+that happen, `unhandled-file-name-directory' now defaults to calling
+`file-name-as-directory'.
+
 \f
 * Lisp Changes in Emacs 25.1
 
index 845195e7d4c56970f303eba76864fbbe29e7af25..a5d9f37b5ee8580aa25758467142ab8e257c7847 100644 (file)
@@ -223,7 +223,7 @@ the arguments that would have been passed to OPERATION."
         ;; which really stands for "/".
         ;; FIXME: maybe we should check that the host part is "" or "localhost"
         ;; or some name that represents the local host?
-        (or (file-name-directory (url-filename url)) "/")
+        (or (file-name-as-directory (url-filename url)) "/")
       ;; All other URLs are not expected to be directly accessible from
       ;; a local process.
       nil)))
index 380a7af33c16f1542b3896fb57716b43dac6a266..91e42dca2bf34166e42f3b6104211078d60a9155 100644 (file)
@@ -5739,7 +5739,7 @@ visual lines rather than logical lines.  See the documentation of
 
   DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
                     Qstringp,
-                    doc: /* Name of default directory of current buffer.  Should end with slash.
+                    doc: /* Name of default directory of current buffer.
 To interactively change the default directory, use command `cd'.  */);
 
   DEFVAR_PER_BUFFER ("auto-fill-function", &BVAR (current_buffer, auto_fill_function),
index 428093bdc4bfabbf2a75776e608af69a2e5e7198..6cda1e39eed0a6ec2a468fa0db345369dd79c723 100644 (file)
@@ -450,7 +450,7 @@ DEFUN ("unhandled-file-name-directory", Funhandled_file_name_directory,
 A `directly usable' directory name is one that may be used without the
 intervention of any file handler.
 If FILENAME is a directly usable file itself, return
-(file-name-directory FILENAME).
+(file-name-as-directory FILENAME).
 If FILENAME refers to a file which is not accessible from a local process,
 then this should return nil.
 The `call-process' and `start-process' functions use this function to
@@ -469,7 +469,7 @@ get a current directory to run processes in.  */)
       return STRINGP (handled_name) ? handled_name : Qnil;
     }
 
-  return Ffile_name_directory (filename);
+  return Ffile_name_as_directory (filename);
 }
 
 /* Maximum number of bytes that DST will be longer than SRC