diff options
| author | Eli Zaretskii | 2013-02-25 19:36:03 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-02-25 19:36:03 +0200 |
| commit | 343a2aefb528ce3c978ba2145705b9e37bfbe02a (patch) | |
| tree | 4672030eea98dfc9bd077ac58400271d1c812918 /doc | |
| parent | aec32f66d0db82b562e904dfe7bb6d54796fe773 (diff) | |
| download | emacs-343a2aefb528ce3c978ba2145705b9e37bfbe02a.tar.gz emacs-343a2aefb528ce3c978ba2145705b9e37bfbe02a.zip | |
Implement CLASH_DETECTION for MS-Windows.
src/filelock.c [WINDOWSNT]: Include w32.h.
(MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
function of that name. Up-case the macro arguments.
(IS_LOCK_FILE): New macro.
(fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
(create_lock_file): New function, with body extracted from
lock_file_1.
[WINDOWSNT]: Implement lock files by writing a regular file with
the lock information as its contents.
(read_lock_data): New function, on Posix platforms just calls
emacs_readlinkat.
[WINDOWSNT]: Read the lock info from the file.
(current_lock_owner): Call read_lock_data instead of calling
emacs_readlinkat directly.
(lock_file) [WINDOWSNT]: Run the file name through
dostounix_filename.
src/w32proc.c (sys_kill): Support the case of SIG = 0, in which case
just check if the process by that PID exists.
src/w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
also present, as doing so will fail to error out if the file
already exists.
src/makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
nt/inc/ms-w32.h (BOOT_TIME_FILE): Define.
nt/config.nt (CLASH_DETECTION): Define to 1.
lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Reject files
that match "\`\.#", to avoid compiling lock files, even if they
are readable (as they are on MS-Windows).
doc/emacs/files.texi (Interlocking): Don't refer to symlinks as the
exclusive means of locking files.
etc/NEWS: Mention support for lock files on MS-Windows.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 24 |
2 files changed, 17 insertions, 12 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 33f530cbadc..44245441791 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-25 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * files.texi (Interlocking): Don't refer to symlinks as the | ||
| 4 | exclusive means of locking files. | ||
| 5 | |||
| 1 | 2013-02-22 Glenn Morris <rgm@gnu.org> | 6 | 2013-02-22 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * ack.texi (Acknowledgments): | 8 | * ack.texi (Acknowledgments): |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 7f7ae483cd5..1f78747eaa6 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -734,10 +734,10 @@ file. | |||
| 734 | @cindex locking files | 734 | @cindex locking files |
| 735 | When you make the first modification in an Emacs buffer that is | 735 | When you make the first modification in an Emacs buffer that is |
| 736 | visiting a file, Emacs records that the file is @dfn{locked} by you. | 736 | visiting a file, Emacs records that the file is @dfn{locked} by you. |
| 737 | (It does this by creating a specially-named symbolic link in the same | 737 | (It does this by creating a specially-named symbolic link or regular |
| 738 | directory.) Emacs removes the lock when you save the changes. The | 738 | file with special contents in the same directory.) Emacs removes the |
| 739 | idea is that the file is locked whenever an Emacs buffer visiting it | 739 | lock when you save the changes. The idea is that the file is locked |
| 740 | has unsaved changes. | 740 | whenever an Emacs buffer visiting it has unsaved changes. |
| 741 | 741 | ||
| 742 | @vindex create-lockfiles | 742 | @vindex create-lockfiles |
| 743 | You can prevent the creation of lock files by setting the variable | 743 | You can prevent the creation of lock files by setting the variable |
| @@ -774,14 +774,14 @@ multiple names, Emacs does not prevent two users from editing it | |||
| 774 | simultaneously under different names. | 774 | simultaneously under different names. |
| 775 | 775 | ||
| 776 | A lock file cannot be written in some circumstances, e.g., if Emacs | 776 | A lock file cannot be written in some circumstances, e.g., if Emacs |
| 777 | lacks the system permissions or the system does not support symbolic | 777 | lacks the system permissions or cannot create lock files for some |
| 778 | links. In these cases, Emacs can still detect the collision when you | 778 | other reason. In these cases, Emacs can still detect the collision |
| 779 | try to save a file, by checking the file's last-modification date. If | 779 | when you try to save a file, by checking the file's last-modification |
| 780 | the file has changed since the last time Emacs visited or saved it, | 780 | date. If the file has changed since the last time Emacs visited or |
| 781 | that implies that changes have been made in some other way, and will | 781 | saved it, that implies that changes have been made in some other way, |
| 782 | be lost if Emacs proceeds with saving. Emacs then displays a warning | 782 | and will be lost if Emacs proceeds with saving. Emacs then displays a |
| 783 | message and asks for confirmation before saving; answer @kbd{yes} to | 783 | warning message and asks for confirmation before saving; answer |
| 784 | save, and @kbd{no} or @kbd{C-g} cancel the save. | 784 | @kbd{yes} to save, and @kbd{no} or @kbd{C-g} cancel the save. |
| 785 | 785 | ||
| 786 | If you are notified that simultaneous editing has already taken | 786 | If you are notified that simultaneous editing has already taken |
| 787 | place, one way to compare the buffer to its file is the @kbd{M-x | 787 | place, one way to compare the buffer to its file is the @kbd{M-x |