Mercurial > emacs
comparison src/filelock.c @ 14075:21a86b6274e6
(Flock_buffer, Ffile_locked_p): Harmonize arguments with documentation.
author | Erik Naggum <erik@naggum.no> |
---|---|
date | Tue, 09 Jan 1996 00:32:09 +0000 |
parents | 11f5ce737c57 |
children | ee40177f6c68 |
comparison
equal
deleted
inserted
replaced
14074:f15db8536fdd | 14075:21a86b6274e6 |
---|---|
395 DEFUN ("lock-buffer", Flock_buffer, Slock_buffer, | 395 DEFUN ("lock-buffer", Flock_buffer, Slock_buffer, |
396 0, 1, 0, | 396 0, 1, 0, |
397 "Lock FILE, if current buffer is modified.\n\ | 397 "Lock FILE, if current buffer is modified.\n\ |
398 FILE defaults to current buffer's visited file,\n\ | 398 FILE defaults to current buffer's visited file,\n\ |
399 or else nothing is done if current buffer isn't visiting a file.") | 399 or else nothing is done if current buffer isn't visiting a file.") |
400 (fn) | 400 (file) |
401 Lisp_Object fn; | 401 Lisp_Object file; |
402 { | 402 { |
403 if (NILP (fn)) | 403 if (NILP (file)) |
404 fn = current_buffer->file_truename; | 404 file = current_buffer->file_truename; |
405 else | 405 else |
406 CHECK_STRING (fn, 0); | 406 CHECK_STRING (file, 0); |
407 if (SAVE_MODIFF < MODIFF | 407 if (SAVE_MODIFF < MODIFF |
408 && !NILP (fn)) | 408 && !NILP (file)) |
409 lock_file (fn); | 409 lock_file (file); |
410 return Qnil; | 410 return Qnil; |
411 } | 411 } |
412 | 412 |
413 DEFUN ("unlock-buffer", Funlock_buffer, Sunlock_buffer, | 413 DEFUN ("unlock-buffer", Funlock_buffer, Sunlock_buffer, |
414 0, 0, 0, | 414 0, 0, 0, |
434 } | 434 } |
435 | 435 |
436 DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 0, 1, 0, | 436 DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 0, 1, 0, |
437 "Return nil if the FILENAME is not locked,\n\ | 437 "Return nil if the FILENAME is not locked,\n\ |
438 t if it is locked by you, else a string of the name of the locker.") | 438 t if it is locked by you, else a string of the name of the locker.") |
439 (fn) | 439 (filename) |
440 Lisp_Object fn; | 440 Lisp_Object filename; |
441 { | 441 { |
442 register char *lfname; | 442 register char *lfname; |
443 int owner; | 443 int owner; |
444 | 444 |
445 fn = Fexpand_file_name (fn, Qnil); | 445 filename = Fexpand_file_name (filename, Qnil); |
446 | 446 |
447 MAKE_LOCK_NAME (lfname, fn); | 447 MAKE_LOCK_NAME (lfname, filename); |
448 | 448 |
449 owner = current_lock_owner (lfname); | 449 owner = current_lock_owner (lfname); |
450 if (owner <= 0) | 450 if (owner <= 0) |
451 return (Qnil); | 451 return (Qnil); |
452 else if (owner == getpid ()) | 452 else if (owner == getpid ()) |