X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdired.c;h=48f9a282cd331046ec397c65af7ddda77f50837d;hb=86055d56f206c256f3a303fdd74ede157d9f5396;hp=3b2d7ff30ef94dc77951ddb19655e82159db1297;hpb=dd8f4c0e5ff27909836e7478df6b17d816a0db28;p=chise%2Fxemacs-chise.git- diff --git a/src/dired.c b/src/dired.c index 3b2d7ff..48f9a28 100644 --- a/src/dired.c +++ b/src/dired.c @@ -110,7 +110,7 @@ If FILES-ONLY is the symbol t, then only the "files" in the directory /* MATCH might be a flawed regular expression. Rather than catching and signalling our own errors, we just call compile_pattern to do the work for us. */ - bufp = compile_pattern (match, 0, 0, 0, ERROR_ME); + bufp = compile_pattern (match, 0, Qnil, 0, ERROR_ME); } /* Now *bufp is the compiled form of MATCH; don't call anything @@ -146,7 +146,7 @@ If FILES-ONLY is the symbol t, then only the "files" in the directory memcpy (statbuf_tail, dp->d_name, len); statbuf_tail[len] = 0; - if (stat (statbuf, &st) == 0 + if (xemacs_stat (statbuf, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) dir_p = 1; @@ -179,18 +179,18 @@ static Lisp_Object file_name_completion (Lisp_Object file, int all_flag, int ver_flag); DEFUN ("file-name-completion", Ffile_name_completion, 2, 2, 0, /* -Complete file name FILE in directory DIRECTORY. -Returns the longest string common to all filenames in DIRECTORY -that start with FILE. -If there is only one and FILE matches it exactly, returns t. -Returns nil if DIRECTORY contains no name starting with FILE. - -Filenames which end with any member of `completion-ignored-extensions' -are not considered as possible completions for FILE unless there is no -other possible completion. `completion-ignored-extensions' is not applied -to the names of directories. +Complete file name PARTIAL-FILENAME in directory DIRECTORY. +Return the longest prefix common to all file names in DIRECTORY +that start with PARTIAL-FILENAME. +If there is only one and PARTIAL-FILENAME matches it exactly, return t. +Return nil if DIRECTORY contains no name starting with PARTIAL-FILENAME. + +File names which end with any member of `completion-ignored-extensions' +are not considered as possible completions for PARTIAL-FILENAME unless +there is no other possible completion. `completion-ignored-extensions' +is not applied to the names of directories. */ - (file, directory)) + (partial_filename, directory)) { /* This function can GC. GC checked 1996.04.06. */ Lisp_Object handler; @@ -199,27 +199,27 @@ to the names of directories. call the corresponding file handler. */ handler = Ffind_file_name_handler (directory, Qfile_name_completion); if (!NILP (handler)) - return call3 (handler, Qfile_name_completion, file, directory); + return call3 (handler, Qfile_name_completion, partial_filename, directory); /* If the file name has special constructs in it, call the corresponding file handler. */ - handler = Ffind_file_name_handler (file, Qfile_name_completion); + handler = Ffind_file_name_handler (partial_filename, Qfile_name_completion); if (!NILP (handler)) - return call3 (handler, Qfile_name_completion, file, directory); + return call3 (handler, Qfile_name_completion, partial_filename, directory); - return file_name_completion (file, directory, 0, 0); + return file_name_completion (partial_filename, directory, 0, 0); } DEFUN ("file-name-all-completions", Ffile_name_all_completions, 2, 2, 0, /* -Return a list of all completions of file name FILE in directory DIRECTORY. -These are all file names in directory DIRECTORY which begin with FILE. +Return a list of all completions of PARTIAL-FILENAME in DIRECTORY. +These are all file names in DIRECTORY which begin with PARTIAL-FILENAME. File names which end with any member of `completion-ignored-extensions' -are not considered as possible completions for FILE unless there is no -other possible completion. `completion-ignored-extensions' is not applied -to the names of directories. +are not considered as possible completions for PARTIAL-FILENAME unless +there is no other possible completion. `completion-ignored-extensions' +is not applied to the names of directories. */ - (file, directory)) + (partial_filename, directory)) { /* This function can GC. GC checked 1997.06.04. */ Lisp_Object handler; @@ -232,10 +232,10 @@ to the names of directories. handler = Ffind_file_name_handler (directory, Qfile_name_all_completions); UNGCPRO; if (!NILP (handler)) - return call3 (handler, Qfile_name_all_completions, file, + return call3 (handler, Qfile_name_all_completions, partial_filename, directory); - return file_name_completion (file, directory, 1, 0); + return file_name_completion (partial_filename, directory, 1, 0); } static int @@ -260,9 +260,9 @@ file_name_completion_stat (Lisp_Object directory, DIRENTRY *dp, in case it is a directory. */ value = lstat (fullname, st_addr); if (S_ISLNK (st_addr->st_mode)) - stat (fullname, st_addr); + xemacs_stat (fullname, st_addr); #else - value = stat (fullname, st_addr); + value = xemacs_stat (fullname, st_addr); #endif return value; } @@ -507,7 +507,8 @@ file_name_completion (Lisp_Object file, Lisp_Object directory, int all_flag, -/* The *pwent() functions do not exist on NT */ +/* The *pwent() functions do not exist on NT. #### The NT equivalent + is NetUserEnum(), and rewriting to use it is not hard.*/ #ifndef WIN32_NATIVE static Lisp_Object user_name_completion (Lisp_Object user, @@ -515,44 +516,45 @@ static Lisp_Object user_name_completion (Lisp_Object user, int *uniq); DEFUN ("user-name-completion", Fuser_name_completion, 1, 1, 0, /* -Complete user name USER. - -Returns the longest string common to all user names that start -with USER. If there is only one and USER matches it exactly, -returns t. Returns nil if there is no user name starting with USER. +Complete user name from PARTIAL-USERNAME. +Return the longest prefix common to all user names starting with +PARTIAL-USERNAME. If there is only one and PARTIAL-USERNAME matches +it exactly, returns t. Return nil if there is no user name starting +with PARTIAL-USERNAME. */ - (user)) + (partial_username)) { - return user_name_completion (user, 0, NULL); + return user_name_completion (partial_username, 0, NULL); } DEFUN ("user-name-completion-1", Fuser_name_completion_1, 1, 1, 0, /* -Complete user name USER. +Complete user name from PARTIAL-USERNAME. This function is identical to `user-name-completion', except that the cons of the completion and an indication of whether the completion was unique is returned. -The car of the returned value is the longest string common to all -user names that start with USER. If there is only one and USER -matches it exactly, the car is t. The car is nil if there is no -user name starting with USER. The cdr of the result is non-nil -if and only if the completion returned in the car was unique. +The car of the returned value is the longest prefix common to all user +names that start with PARTIAL-USERNAME. If there is only one and +PARTIAL-USERNAME matches it exactly, the car is t. The car is nil if +there is no user name starting with PARTIAL-USERNAME. The cdr of the +result is non-nil if and only if the completion returned in the car +was unique. */ - (user)) + (partial_username)) { int uniq; - Lisp_Object completed = user_name_completion (user, 0, &uniq); + Lisp_Object completed = user_name_completion (partial_username, 0, &uniq); return Fcons (completed, uniq ? Qt : Qnil); } DEFUN ("user-name-all-completions", Fuser_name_all_completions, 1, 1, 0, /* -Return a list of all completions of user name USER. -These are all user names which begin with USER. +Return a list of all user name completions from PARTIAL-USERNAME. +These are all the user names which begin with PARTIAL-USERNAME. */ - (user)) + (partial_username)) { - return user_name_completion (user, 1, NULL); + return user_name_completion (partial_username, 1, NULL); } struct user_name @@ -843,7 +845,7 @@ If file does not exist, returns nil. { struct stat sdir; - if (!NILP (directory) && stat ((char *) XSTRING_DATA (directory), &sdir) == 0) + if (!NILP (directory) && xemacs_stat ((char *) XSTRING_DATA (directory), &sdir) == 0) values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; else /* if we can't tell, assume worst */ values[9] = Qt;