emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ffa41ad: Don't require default-directory to end wit


From: Dmitry Gutov
Subject: [Emacs-diffs] master ffa41ad: Don't require default-directory to end with a slash
Date: Thu, 29 Oct 2015 01:02:02 +0000

branch: master
commit ffa41ad2a02dbd1202d71a08bac34831f25662d0
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Don't require default-directory to end with a slash
    
    * 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   |    2 +-
 etc/NEWS                 |    5 +++++
 lisp/url/url-handlers.el |    2 +-
 src/buffer.c             |    2 +-
 src/fileio.c             |    4 ++--
 5 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 65a97a4..6083433 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -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
diff --git a/etc/NEWS b/etc/NEWS
index 47a4bae..512b491 100644
--- 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'.
+
 
 * Lisp Changes in Emacs 25.1
 
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index 845195e..a5d9f37 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -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)))
diff --git a/src/buffer.c b/src/buffer.c
index 380a7af..91e42dc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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),
diff --git a/src/fileio.c b/src/fileio.c
index 428093b..6cda1e3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]