Merge from trunk.
This commit is contained in:
commit
1235f93957
24 changed files with 623 additions and 593 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
|
||||
* configure.ac: Do not check for dirent.h or closdir.
|
||||
|
||||
2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
|
||||
|
|
|
@ -118,7 +118,6 @@ HAVE_CFMAKERAW
|
|||
HAVE_CFSETSPEED
|
||||
HAVE_CLOCK_GETTIME
|
||||
HAVE_CLOCK_SETTIME
|
||||
HAVE_CLOSEDIR
|
||||
HAVE_COFF_H
|
||||
HAVE_COM_ERR_H
|
||||
HAVE_COPYSIGN
|
||||
|
@ -143,7 +142,6 @@ HAVE_DES_H
|
|||
HAVE_DEV_PTMX
|
||||
HAVE_DIALOGS
|
||||
HAVE_DIFFTIME
|
||||
HAVE_DIRENT_H
|
||||
HAVE_DUP2
|
||||
HAVE_ENDGRENT
|
||||
HAVE_ENDPWENT
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
|
||||
* CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove.
|
||||
* notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming.
|
||||
|
||||
2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
|
||||
|
|
|
@ -380,7 +380,7 @@ Makefile.in does now.
|
|||
src/gmalloc.c
|
||||
- contains numerous copyrights from the GNU C library. Leave them alone.
|
||||
|
||||
src/ndir.h
|
||||
nt/inc/dirent.h
|
||||
- see comments below. This file is OK to be released with Emacs
|
||||
22, but we may want to revisit it afterwards.
|
||||
|
||||
|
@ -429,7 +429,7 @@ admin/check-doc-strings
|
|||
File says it's in the public domain, but that might not make it so.
|
||||
|
||||
etc/e/eterm-color.ti
|
||||
src/ndir.h
|
||||
nt/inc/dirent.h
|
||||
On legal advice from Matt Norwood, the following comment was added
|
||||
to these files in Feb/Mar 2007:
|
||||
|
||||
|
|
|
@ -1285,7 +1285,7 @@ AC_CHECK_HEADERS_ONCE(
|
|||
linux/version.h sys/systeminfo.h
|
||||
fcntl.h coff.h pty.h
|
||||
sys/vlimit.h sys/resource.h
|
||||
sys/utsname.h pwd.h utmp.h dirent.h util.h)
|
||||
sys/utsname.h pwd.h utmp.h util.h)
|
||||
|
||||
AC_MSG_CHECKING(if personality LINUX32 can be set)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
|
||||
|
@ -2899,7 +2899,7 @@ AC_SUBST(BLESSMAIL_TARGET)
|
|||
|
||||
|
||||
AC_CHECK_FUNCS(gethostname \
|
||||
closedir getrusage get_current_dir_name \
|
||||
getrusage get_current_dir_name \
|
||||
lrand48 \
|
||||
fpathconf select getpagesize setlocale \
|
||||
utimes getrlimit setrlimit getcwd shutdown getaddrinfo \
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Calc now uses the Gregorian calendar for all dates,
|
||||
and uses January 1, 1 AD as its day number 1.
|
||||
Calc now uses the Gregorian calendar for all dates (Bug#12633).
|
||||
It also uses January 1, 1 AD as its day number 1.
|
||||
* calc.texi (Date Forms): Document this.
|
||||
|
||||
2012-11-16 Glenn Morris <rgm@gnu.org>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
2012-11-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: Document Calc changes for Gregorian calendar.
|
||||
* NEWS: Document Calc changes for Gregorian calendar (Bug#12633).
|
||||
|
||||
2012-10-26 Nicolas Goaziou <n.goaziou@gmail.com>
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
movemail: treat EACCES etc. failures as permanent
|
||||
* movemail.c (main): Treat any link failure other than EEXIST as a
|
||||
permanent failure, not just EPERM. EACCES, for example.
|
||||
|
||||
2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
|
||||
|
|
|
@ -328,11 +328,8 @@ main (int argc, char **argv)
|
|||
|
||||
tem = link (tempname, lockname);
|
||||
|
||||
#ifdef EPERM
|
||||
if (tem < 0 && errno == EPERM)
|
||||
fatal ("Unable to create hard link between %s and %s",
|
||||
tempname, lockname);
|
||||
#endif
|
||||
if (tem < 0 && errno != EEXIST)
|
||||
pfatal_with_name (lockname);
|
||||
|
||||
unlink (tempname);
|
||||
if (tem >= 0)
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
2012-11-23 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* find-cmd.el (find-constituents): Add executable, ipath,
|
||||
readable, samefile, writable, daystart, regextype (Bug#12856).
|
||||
|
||||
2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emacs-lisp/ert.el, emacs-lisp/ert-x.el: Use cl-lib and lexical-binding.
|
||||
|
||||
2012-11-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* calc/calc.el (calc-gregorian-switch): Move to after calc-refresh
|
||||
|
@ -5,8 +14,8 @@
|
|||
(calc-gregorian-switch): In menu, put dates before regions.
|
||||
This is easier to follow, lines up better in the menu, and lets us
|
||||
coalesce regions that switch at the same time. Give country
|
||||
names, not "Vatican", as that's better for non-expert users. Use
|
||||
names that are stable between the date of switch and now, e.g.,
|
||||
names, not "Vatican", as that's better for non-expert users.
|
||||
Use names that are stable between the date of switch and now, e.g.,
|
||||
Bohemia and Moravia (which existed then and now) and not
|
||||
Czechoslovakia (which didn't exist then and doesn't exist now).
|
||||
What is now the U.S. mostly did not switch at the same time as
|
||||
|
@ -201,8 +210,10 @@
|
|||
|
||||
2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Calc by default uses the Gregorian calendar for all dates (Bug#12633).
|
||||
It also uses January 1, 1 AD as its day number 1.
|
||||
* calc/calc-forms.el (math-julian-date-beginning)
|
||||
(math-julian-date-beginning-int): Implement [new date numbering].
|
||||
(math-julian-date-beginning-int): Implement this.
|
||||
|
||||
2012-11-17 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; ert-x.el --- Staging area for experimental extensions to ERT
|
||||
;;; ert-x.el --- Staging area for experimental extensions to ERT -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -28,8 +28,7 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile
|
||||
(require 'cl))
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
(require 'ert)
|
||||
|
||||
|
||||
|
@ -90,8 +89,8 @@ ERT--THUNK with that buffer as current."
|
|||
(kill-buffer ert--buffer)
|
||||
(remhash ert--buffer ert--test-buffers))))
|
||||
|
||||
(defmacro* ert-with-test-buffer ((&key ((:name name-form)))
|
||||
&body body)
|
||||
(cl-defmacro ert-with-test-buffer ((&key ((:name name-form)))
|
||||
&body body)
|
||||
"Create a test buffer and run BODY in that buffer.
|
||||
|
||||
To be used in ERT tests. If BODY finishes successfully, the test
|
||||
|
@ -116,10 +115,10 @@ the name of the test and the result of NAME-FORM."
|
|||
"Kill all test buffers that are still live."
|
||||
(interactive)
|
||||
(let ((count 0))
|
||||
(maphash (lambda (buffer dummy)
|
||||
(maphash (lambda (buffer _dummy)
|
||||
(when (or (not (buffer-live-p buffer))
|
||||
(kill-buffer buffer))
|
||||
(incf count)))
|
||||
(cl-incf count)))
|
||||
ert--test-buffers)
|
||||
(message "%s out of %s test buffers killed"
|
||||
count (hash-table-count ert--test-buffers)))
|
||||
|
@ -149,9 +148,9 @@ the rest are arguments to the command.
|
|||
|
||||
NOTE: Since the command is not called by `call-interactively'
|
||||
test for `called-interactively' in the command will fail."
|
||||
(assert (listp command) t)
|
||||
(assert (commandp (car command)) t)
|
||||
(assert (not unread-command-events) t)
|
||||
(cl-assert (listp command) t)
|
||||
(cl-assert (commandp (car command)) t)
|
||||
(cl-assert (not unread-command-events) t)
|
||||
(let (return-value)
|
||||
;; For the order of things here see command_loop_1 in keyboard.c.
|
||||
;;
|
||||
|
@ -175,7 +174,7 @@ test for `called-interactively' in the command will fail."
|
|||
(when (boundp 'last-repeatable-command)
|
||||
(setq last-repeatable-command real-last-command))
|
||||
(when (and deactivate-mark transient-mark-mode) (deactivate-mark))
|
||||
(assert (not unread-command-events) t)
|
||||
(cl-assert (not unread-command-events) t)
|
||||
return-value))
|
||||
|
||||
(defun ert-run-idle-timers ()
|
||||
|
@ -198,7 +197,7 @@ rather than the entire match."
|
|||
(with-temp-buffer
|
||||
(insert s)
|
||||
(dolist (x regexps)
|
||||
(destructuring-bind (regexp subexp) (if (listp x) x `(,x nil))
|
||||
(cl-destructuring-bind (regexp subexp) (if (listp x) x `(,x nil))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward regexp nil t)
|
||||
(replace-match "" t t nil subexp))))
|
||||
|
@ -224,15 +223,15 @@ would return the string \"foo bar baz quux\" where the substring
|
|||
None of the ARGS are modified, but the return value may share
|
||||
structure with the plists in ARGS."
|
||||
(with-temp-buffer
|
||||
(loop with current-plist = nil
|
||||
for x in args do
|
||||
(etypecase x
|
||||
(string (let ((begin (point)))
|
||||
(insert x)
|
||||
(set-text-properties begin (point) current-plist)))
|
||||
(list (unless (zerop (mod (length x) 2))
|
||||
(error "Odd number of args in plist: %S" x))
|
||||
(setq current-plist x))))
|
||||
(cl-loop with current-plist = nil
|
||||
for x in args do
|
||||
(cl-etypecase x
|
||||
(string (let ((begin (point)))
|
||||
(insert x)
|
||||
(set-text-properties begin (point) current-plist)))
|
||||
(list (unless (zerop (mod (length x) 2))
|
||||
(error "Odd number of args in plist: %S" x))
|
||||
(setq current-plist x))))
|
||||
(buffer-string)))
|
||||
|
||||
|
||||
|
@ -245,8 +244,8 @@ buffer, and renames the original buffer back to BUFFER-NAME.
|
|||
|
||||
This is useful if THUNK has undesirable side-effects on an Emacs
|
||||
buffer with a fixed name such as *Messages*."
|
||||
(lexical-let ((new-buffer-name (generate-new-buffer-name
|
||||
(format "%s orig buffer" buffer-name))))
|
||||
(let ((new-buffer-name (generate-new-buffer-name
|
||||
(format "%s orig buffer" buffer-name))))
|
||||
(with-current-buffer (get-buffer-create buffer-name)
|
||||
(rename-buffer new-buffer-name))
|
||||
(unwind-protect
|
||||
|
@ -258,7 +257,7 @@ buffer with a fixed name such as *Messages*."
|
|||
(with-current-buffer new-buffer-name
|
||||
(rename-buffer buffer-name)))))
|
||||
|
||||
(defmacro* ert-with-buffer-renamed ((buffer-name-form) &body body)
|
||||
(cl-defmacro ert-with-buffer-renamed ((buffer-name-form) &body body)
|
||||
"Protect the buffer named BUFFER-NAME from side-effects and run BODY.
|
||||
|
||||
See `ert-call-with-buffer-renamed' for details."
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -63,6 +63,7 @@
|
|||
(cnewer . (1))
|
||||
(ctime . (1))
|
||||
(empty . (0))
|
||||
(executable . (0))
|
||||
(false . (0))
|
||||
(fstype . (1))
|
||||
(gid . (1))
|
||||
|
@ -70,37 +71,43 @@
|
|||
(ilname . (1))
|
||||
(iname . (1))
|
||||
(inum . (1))
|
||||
(iwholename . (1))
|
||||
(ipath . (1))
|
||||
(iregex . (1))
|
||||
(iwholename . (1))
|
||||
(links . (1))
|
||||
(lname . (1))
|
||||
(mmin . (1))
|
||||
(mtime . (1))
|
||||
(name . (1))
|
||||
(newer . (1))
|
||||
(nouser . (0))
|
||||
(nogroup . (0))
|
||||
(nouser . (0))
|
||||
(path . (1))
|
||||
(perm . (0))
|
||||
(readable . (0))
|
||||
(regex . (1))
|
||||
(wholename . (1))
|
||||
(samefile . (1))
|
||||
(size . (1))
|
||||
(true . (0))
|
||||
(type . (1))
|
||||
(uid . (1))
|
||||
(used . (1))
|
||||
(user . (1))
|
||||
(wholename . (1))
|
||||
(writable . (0))
|
||||
(xtype . (nil))
|
||||
|
||||
;; normal options (always true)
|
||||
(daystart . (0))
|
||||
(depth . (0))
|
||||
(maxdepth . (1))
|
||||
(mindepth . (1))
|
||||
(mount . (0))
|
||||
(noleaf . (0))
|
||||
(xdev . (0))
|
||||
(ignore_readdir_race . (0))
|
||||
(noignore_readdir_race . (0))
|
||||
(regextype . (1))
|
||||
(xdev . (0))
|
||||
|
||||
;; actions
|
||||
(delete . (0))
|
||||
|
|
14
nt/ChangeLog
14
nt/ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2012-11-23 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* gmake.defs (SWITCHCHAR): Define to // under MSYS, / otherwise.
|
||||
(Bug#12955)
|
||||
|
||||
* nmake.defs (SWITCHCHAR): Define to /.
|
||||
|
||||
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
|
||||
* inc/dirent.h: Rename from ../src/ndir.h, with these changes:
|
||||
(struct dirent): Rename from struct direct. All uses changed.
|
||||
* inc/sys/dir.h: Remove.
|
||||
|
||||
2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
|
||||
|
|
|
@ -69,10 +69,18 @@ sh_output := $(shell echo)
|
|||
ifeq "$(findstring ECHO, $(sh_output))" "ECHO"
|
||||
THE_SHELL = $(COMSPEC)$(ComSpec)
|
||||
SHELLTYPE=CMD
|
||||
SWITCHCHAR=/
|
||||
else
|
||||
USING_SH = 1
|
||||
THE_SHELL = $(SHELL)
|
||||
SHELLTYPE=SH
|
||||
# MSYS needs to double the slash in cmd-style switches to avoid
|
||||
# interpreting /x as a Posix style file name reference
|
||||
ifneq ($(MSYSTEM),)
|
||||
SWITCHCHAR=//
|
||||
else
|
||||
SWITCHCHAR=/
|
||||
endif
|
||||
endif
|
||||
|
||||
MAKETYPE=gmake
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/*
|
||||
<dir.h> -- definitions for 4.2BSD-compatible directory access
|
||||
|
||||
last edit: 09-Jul-1983 D A Gwyn
|
||||
<dirent.h> -- definitions for POSIX-compatible directory access
|
||||
|
||||
* The code here is forced by the interface, and is not subject to
|
||||
* copyright, constituting the only possible expression of the
|
||||
|
@ -16,7 +14,7 @@
|
|||
#endif /* not WINDOWSNT */
|
||||
/* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
|
||||
|
||||
struct direct /* data from readdir() */
|
||||
struct dirent /* data from readdir() */
|
||||
{
|
||||
long d_ino; /* inode number of entry */
|
||||
unsigned short d_reclen; /* length of this record */
|
||||
|
@ -33,9 +31,8 @@ typedef struct
|
|||
} DIR; /* stream data from opendir() */
|
||||
|
||||
extern DIR *opendir (char *);
|
||||
extern struct direct *readdir (DIR *);
|
||||
extern struct dirent *readdir (DIR *);
|
||||
extern void seekdir (DIR *, long);
|
||||
extern void closedir (DIR *);
|
||||
|
||||
#define rewinddir( dirp ) seekdir( dirp, 0L )
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
/*
|
||||
* map sys\dir.h to ..\..\..\src\ndir.h
|
||||
*/
|
||||
|
||||
#include "..\..\..\src\ndir.h"
|
||||
|
|
@ -22,6 +22,7 @@ all:
|
|||
|
||||
THE_SHELL = $(COMSPEC)
|
||||
SHELLTYPE=CMD
|
||||
SWITCHCHAR=/
|
||||
|
||||
MAKETYPE=nmake
|
||||
|
||||
|
|
|
@ -1,3 +1,30 @@
|
|||
2012-11-23 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
|
||||
of a literal "/". (Bug#12955)
|
||||
(gl-stamp): Invoke fc.exe directly, not through cmd.
|
||||
|
||||
2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
|
||||
* dired.c: Assume HAVE_DIRENT_H.
|
||||
(NAMLEN): Remove, replacing with ...
|
||||
(dirent_namelen): New function. All uses changed. Use the GNU macro
|
||||
_D_EXACT_NAMELEN if available, as it's faster than strlen.
|
||||
(DIRENTRY): Remove, replacing all uses with 'struct dirent'.
|
||||
(DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
|
||||
* makefile.w32-in (DIR_H): Remove. All uses replaced with
|
||||
$(NT_INC)/dirent.h.
|
||||
($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
|
||||
* ndir.h: Rename to ../nt/inc/dirent.h.
|
||||
* sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
|
||||
Do not include <dirent.h>; no longer needed.
|
||||
* w32.c: Include <dirent.h> rather than "ndir.h".
|
||||
|
||||
2012-11-23 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* xftfont.c (xftfont_open): Remove duplicate assignment.
|
||||
|
||||
2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* alloc.c (Fgarbage_collect): Unblock input after clearing
|
||||
|
|
201
src/dired.c
201
src/dired.c
|
@ -31,44 +31,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* The d_nameln member of a struct dirent includes the '\0' character
|
||||
on some systems, but not on others. What's worse, you can't tell
|
||||
at compile-time which one it will be, since it really depends on
|
||||
the sort of system providing the filesystem you're reading from,
|
||||
not the system you are running on. Paul Eggert
|
||||
<eggert@bi.twinsun.com> says this occurs when Emacs is running on a
|
||||
SunOS 4.1.2 host, reading a directory that is remote-mounted from a
|
||||
Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
|
||||
|
||||
Since applying strlen to the name always works, we'll just do that. */
|
||||
#define NAMLEN(p) strlen (p->d_name)
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
|
||||
#include <dirent.h>
|
||||
#define DIRENTRY struct dirent
|
||||
|
||||
#else /* not HAVE_DIRENT_H */
|
||||
|
||||
#include <sys/dir.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define DIRENTRY struct direct
|
||||
|
||||
extern DIR *opendir (char *);
|
||||
extern struct direct *readdir (DIR *);
|
||||
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
|
||||
#include <filemode.h>
|
||||
#include <stat-time.h>
|
||||
|
||||
#ifdef MSDOS
|
||||
#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
|
||||
#else
|
||||
#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
|
||||
#endif
|
||||
|
||||
#include "lisp.h"
|
||||
#include "systime.h"
|
||||
#include "character.h"
|
||||
|
@ -88,6 +54,17 @@ static Lisp_Object Qfile_attributes_lessp;
|
|||
|
||||
static ptrdiff_t scmp (const char *, const char *, ptrdiff_t);
|
||||
|
||||
/* Return the number of bytes in DP's name. */
|
||||
static ptrdiff_t
|
||||
dirent_namelen (struct dirent *dp)
|
||||
{
|
||||
#ifdef _D_EXACT_NAMLEN
|
||||
return _D_EXACT_NAMLEN (dp);
|
||||
#else
|
||||
return strlen (dp->d_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WINDOWSNT
|
||||
Lisp_Object
|
||||
directory_files_internal_w32_unwind (Lisp_Object arg)
|
||||
|
@ -124,7 +101,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
|
|||
bool needsep = 0;
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
|
||||
DIRENTRY *dp;
|
||||
struct dirent *dp;
|
||||
#ifdef WINDOWSNT
|
||||
Lisp_Object w32_save = Qnil;
|
||||
#endif
|
||||
|
@ -209,6 +186,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
|
|||
/* Loop reading blocks until EOF or error. */
|
||||
for (;;)
|
||||
{
|
||||
ptrdiff_t len;
|
||||
bool wanted = 0;
|
||||
Lisp_Object name, finalname;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
|
||||
errno = 0;
|
||||
dp = readdir (d);
|
||||
|
||||
|
@ -225,89 +207,81 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
|
|||
if (dp == NULL)
|
||||
break;
|
||||
|
||||
if (DIRENTRY_NONEMPTY (dp))
|
||||
len = dirent_namelen (dp);
|
||||
name = finalname = make_unibyte_string (dp->d_name, len);
|
||||
GCPRO2 (finalname, name);
|
||||
|
||||
/* Note: DECODE_FILE can GC; it should protect its argument,
|
||||
though. */
|
||||
name = DECODE_FILE (name);
|
||||
len = SBYTES (name);
|
||||
|
||||
/* Now that we have unwind_protect in place, we might as well
|
||||
allow matching to be interrupted. */
|
||||
immediate_quit = 1;
|
||||
QUIT;
|
||||
|
||||
if (NILP (match)
|
||||
|| (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0)))
|
||||
wanted = 1;
|
||||
|
||||
immediate_quit = 0;
|
||||
|
||||
if (wanted)
|
||||
{
|
||||
ptrdiff_t len;
|
||||
bool wanted = 0;
|
||||
Lisp_Object name, finalname;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
|
||||
len = NAMLEN (dp);
|
||||
name = finalname = make_unibyte_string (dp->d_name, len);
|
||||
GCPRO2 (finalname, name);
|
||||
|
||||
/* Note: DECODE_FILE can GC; it should protect its argument,
|
||||
though. */
|
||||
name = DECODE_FILE (name);
|
||||
len = SBYTES (name);
|
||||
|
||||
/* Now that we have unwind_protect in place, we might as well
|
||||
allow matching to be interrupted. */
|
||||
immediate_quit = 1;
|
||||
QUIT;
|
||||
|
||||
if (NILP (match)
|
||||
|| (0 <= re_search (bufp, SSDATA (name), len, 0, len, 0)))
|
||||
wanted = 1;
|
||||
|
||||
immediate_quit = 0;
|
||||
|
||||
if (wanted)
|
||||
if (!NILP (full))
|
||||
{
|
||||
if (!NILP (full))
|
||||
{
|
||||
Lisp_Object fullname;
|
||||
ptrdiff_t nbytes = len + directory_nbytes + needsep;
|
||||
ptrdiff_t nchars;
|
||||
Lisp_Object fullname;
|
||||
ptrdiff_t nbytes = len + directory_nbytes + needsep;
|
||||
ptrdiff_t nchars;
|
||||
|
||||
fullname = make_uninit_multibyte_string (nbytes, nbytes);
|
||||
memcpy (SDATA (fullname), SDATA (directory),
|
||||
directory_nbytes);
|
||||
fullname = make_uninit_multibyte_string (nbytes, nbytes);
|
||||
memcpy (SDATA (fullname), SDATA (directory),
|
||||
directory_nbytes);
|
||||
|
||||
if (needsep)
|
||||
SSET (fullname, directory_nbytes, DIRECTORY_SEP);
|
||||
if (needsep)
|
||||
SSET (fullname, directory_nbytes, DIRECTORY_SEP);
|
||||
|
||||
memcpy (SDATA (fullname) + directory_nbytes + needsep,
|
||||
SDATA (name), len);
|
||||
memcpy (SDATA (fullname) + directory_nbytes + needsep,
|
||||
SDATA (name), len);
|
||||
|
||||
nchars = chars_in_text (SDATA (fullname), nbytes);
|
||||
nchars = chars_in_text (SDATA (fullname), nbytes);
|
||||
|
||||
/* Some bug somewhere. */
|
||||
if (nchars > nbytes)
|
||||
emacs_abort ();
|
||||
/* Some bug somewhere. */
|
||||
if (nchars > nbytes)
|
||||
emacs_abort ();
|
||||
|
||||
STRING_SET_CHARS (fullname, nchars);
|
||||
if (nchars == nbytes)
|
||||
STRING_SET_UNIBYTE (fullname);
|
||||
STRING_SET_CHARS (fullname, nchars);
|
||||
if (nchars == nbytes)
|
||||
STRING_SET_UNIBYTE (fullname);
|
||||
|
||||
finalname = fullname;
|
||||
}
|
||||
else
|
||||
finalname = name;
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
/* Construct an expanded filename for the directory entry.
|
||||
Use the decoded names for input to Ffile_attributes. */
|
||||
Lisp_Object decoded_fullname, fileattrs;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
|
||||
decoded_fullname = fileattrs = Qnil;
|
||||
GCPRO2 (decoded_fullname, fileattrs);
|
||||
|
||||
/* Both Fexpand_file_name and Ffile_attributes can GC. */
|
||||
decoded_fullname = Fexpand_file_name (name, directory);
|
||||
fileattrs = Ffile_attributes (decoded_fullname, id_format);
|
||||
|
||||
list = Fcons (Fcons (finalname, fileattrs), list);
|
||||
UNGCPRO;
|
||||
}
|
||||
else
|
||||
list = Fcons (finalname, list);
|
||||
finalname = fullname;
|
||||
}
|
||||
else
|
||||
finalname = name;
|
||||
|
||||
UNGCPRO;
|
||||
if (attrs)
|
||||
{
|
||||
/* Construct an expanded filename for the directory entry.
|
||||
Use the decoded names for input to Ffile_attributes. */
|
||||
Lisp_Object decoded_fullname, fileattrs;
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
|
||||
decoded_fullname = fileattrs = Qnil;
|
||||
GCPRO2 (decoded_fullname, fileattrs);
|
||||
|
||||
/* Both Fexpand_file_name and Ffile_attributes can GC. */
|
||||
decoded_fullname = Fexpand_file_name (name, directory);
|
||||
fileattrs = Ffile_attributes (decoded_fullname, id_format);
|
||||
|
||||
list = Fcons (Fcons (finalname, fileattrs), list);
|
||||
UNGCPRO;
|
||||
}
|
||||
else
|
||||
list = Fcons (finalname, list);
|
||||
}
|
||||
|
||||
UNGCPRO;
|
||||
}
|
||||
|
||||
block_input ();
|
||||
|
@ -442,7 +416,8 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
|
|||
return file_name_completion (file, directory, 1, Qnil);
|
||||
}
|
||||
|
||||
static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
|
||||
static int file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
|
||||
struct stat *st_addr);
|
||||
static Lisp_Object Qdefault_directory;
|
||||
|
||||
static Lisp_Object
|
||||
|
@ -499,7 +474,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
|
|||
/* (att3b compiler bug requires do a null comparison this way) */
|
||||
while (1)
|
||||
{
|
||||
DIRENTRY *dp;
|
||||
struct dirent *dp;
|
||||
ptrdiff_t len;
|
||||
bool canexclude = 0;
|
||||
|
||||
|
@ -517,11 +492,10 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
|
|||
|
||||
if (!dp) break;
|
||||
|
||||
len = NAMLEN (dp);
|
||||
len = dirent_namelen (dp);
|
||||
|
||||
QUIT;
|
||||
if (! DIRENTRY_NONEMPTY (dp)
|
||||
|| len < SCHARS (encoded_file)
|
||||
if (len < SCHARS (encoded_file)
|
||||
|| 0 <= scmp (dp->d_name, SSDATA (encoded_file),
|
||||
SCHARS (encoded_file)))
|
||||
continue;
|
||||
|
@ -806,9 +780,10 @@ scmp (const char *s1, const char *s2, ptrdiff_t len)
|
|||
}
|
||||
|
||||
static int
|
||||
file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr)
|
||||
file_name_completion_stat (Lisp_Object dirname, struct dirent *dp,
|
||||
struct stat *st_addr)
|
||||
{
|
||||
ptrdiff_t len = NAMLEN (dp);
|
||||
ptrdiff_t len = dirent_namelen (dp);
|
||||
ptrdiff_t pos = SCHARS (dirname);
|
||||
int value;
|
||||
USE_SAFE_ALLOCA;
|
||||
|
|
|
@ -229,12 +229,12 @@ SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
|
|||
obj = $(GLOBAL_SOURCES:.c=.o)
|
||||
|
||||
globals.h: gl-stamp
|
||||
@cmd /c rem true
|
||||
@cmd $(SWITCHCHAR)c rem true
|
||||
|
||||
gl-stamp: ../lib-src/$(BLD)/make-docfile.exe $(GLOBAL_SOURCES)
|
||||
- $(DEL) gl-tmp
|
||||
"$(THISDIR)/../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp
|
||||
cmd /c "fc /b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h"
|
||||
fc.exe $(SWITCHCHAR)b gl-tmp globals.h >nul 2>&1 || $(CP) gl-tmp globals.h
|
||||
- $(DEL) gl-tmp
|
||||
echo timestamp > $@
|
||||
|
||||
|
@ -413,8 +413,6 @@ CONF_POST_H = $(SRC)/conf_post.h \
|
|||
$(MS_W32_H)
|
||||
CONFIG_H = $(SRC)/config.h \
|
||||
$(CONF_POST_H)
|
||||
DIR_H = $(NT_INC)/sys/dir.h \
|
||||
$(SRC)/ndir.h
|
||||
W32GUI_H = $(SRC)/w32gui.h \
|
||||
$(SYSTIME_H)
|
||||
DISPEXTERN_H = $(SRC)/dispextern.h \
|
||||
|
@ -714,6 +712,7 @@ $(BLD)/dired.$(O) : \
|
|||
$(SRC)/blockinput.h \
|
||||
$(SRC)/commands.h \
|
||||
$(SRC)/regex.h \
|
||||
$(NT_INC)/dirent.h \
|
||||
$(NT_INC)/pwd.h \
|
||||
$(NT_INC)/sys/stat.h \
|
||||
$(NT_INC)/unistd.h \
|
||||
|
@ -722,7 +721,6 @@ $(BLD)/dired.$(O) : \
|
|||
$(CHARSET_H) \
|
||||
$(CODING_H) \
|
||||
$(CONFIG_H) \
|
||||
$(DIR_H) \
|
||||
$(FILEMODE_H) \
|
||||
$(GRP_H) \
|
||||
$(LISP_H) \
|
||||
|
@ -1175,11 +1173,11 @@ $(BLD)/minibuf.$(O) : \
|
|||
|
||||
$(BLD)/w32.$(O) : \
|
||||
$(SRC)/w32.c \
|
||||
$(SRC)/ndir.h \
|
||||
$(SRC)/w32.h \
|
||||
$(SRC)/w32common.h \
|
||||
$(SRC)/w32heap.h \
|
||||
$(SRC)/w32select.h \
|
||||
$(NT_INC)/dirent.h \
|
||||
$(NT_INC)/pwd.h \
|
||||
$(NT_INC)/sys/file.h \
|
||||
$(NT_INC)/sys/time.h \
|
||||
|
|
22
src/sysdep.c
22
src/sysdep.c
|
@ -2219,28 +2219,6 @@ emacs_readlink (char const *filename, char initial_buf[READLINK_BUFSIZE])
|
|||
return careadlinkat (AT_FDCWD, filename, initial_buf, READLINK_BUFSIZE,
|
||||
&emacs_norealloc_allocator, careadlinkatcwd);
|
||||
}
|
||||
|
||||
/* Directory routines for systems that don't have them. */
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#if !defined (HAVE_CLOSEDIR)
|
||||
|
||||
int
|
||||
closedir (DIR *dirp /* stream from opendir */)
|
||||
{
|
||||
int rtnval;
|
||||
|
||||
rtnval = emacs_close (dirp->dd_fd);
|
||||
xfree (dirp);
|
||||
|
||||
return rtnval;
|
||||
}
|
||||
#endif /* not HAVE_CLOSEDIR */
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
|
||||
|
||||
/* Return a struct timeval that is roughly equivalent to T.
|
||||
Use the least timeval not less than T.
|
||||
|
|
|
@ -179,7 +179,7 @@ typedef struct _REPARSE_DATA_BUFFER {
|
|||
#undef sendto
|
||||
|
||||
#include "w32.h"
|
||||
#include "ndir.h"
|
||||
#include <dirent.h>
|
||||
#include "w32common.h"
|
||||
#include "w32heap.h"
|
||||
#include "w32select.h"
|
||||
|
@ -2448,7 +2448,7 @@ is_exec (const char * name)
|
|||
and readdir. We can't use the procedures supplied in sysdep.c,
|
||||
so we provide them here. */
|
||||
|
||||
struct direct dir_static; /* simulated directory contents */
|
||||
struct dirent dir_static; /* simulated directory contents */
|
||||
static HANDLE dir_find_handle = INVALID_HANDLE_VALUE;
|
||||
static int dir_is_fat;
|
||||
static char dir_pathname[MAXPATHLEN+1];
|
||||
|
@ -2518,7 +2518,7 @@ closedir (DIR *dirp)
|
|||
xfree ((char *) dirp);
|
||||
}
|
||||
|
||||
struct direct *
|
||||
struct dirent *
|
||||
readdir (DIR *dirp)
|
||||
{
|
||||
int downcase = !NILP (Vw32_downcase_file_names);
|
||||
|
@ -2572,7 +2572,7 @@ readdir (DIR *dirp)
|
|||
downcase = 1; /* 8+3 aliases are returned in all caps */
|
||||
}
|
||||
dir_static.d_namlen = strlen (dir_static.d_name);
|
||||
dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 +
|
||||
dir_static.d_reclen = sizeof (struct dirent) - MAXNAMLEN + 3 +
|
||||
dir_static.d_namlen - dir_static.d_namlen % 4;
|
||||
|
||||
/* If the file name in cFileName[] includes `?' characters, it means
|
||||
|
|
|
@ -369,7 +369,7 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
|
|||
ASET (font_object, FONT_FORMAT_INDEX,
|
||||
ftfont_font_format (xftfont->pattern, filename));
|
||||
font = XFONT_OBJECT (font_object);
|
||||
font->pixel_size = pixel_size;
|
||||
font->pixel_size = size;
|
||||
font->driver = &xftfont_driver;
|
||||
font->encoding_charset = font->repertory_charset = -1;
|
||||
|
||||
|
@ -387,8 +387,6 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
|
|||
xftfont_info->matrix.xy = 0x10000L * matrix->xy;
|
||||
xftfont_info->matrix.yx = 0x10000L * matrix->yx;
|
||||
}
|
||||
font->pixel_size = size;
|
||||
font->driver = &xftfont_driver;
|
||||
if (INTEGERP (AREF (entity, FONT_SPACING_INDEX)))
|
||||
spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue