Mercurial > emacs
comparison src/filelock.c @ 10331:2ae69efc3e8b
Use SAVE_MODIFF and BUF_SAVE_MODIFF
instead of direct access to the save_modiff field.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 04 Jan 1995 19:08:56 +0000 |
parents | 6e28a6ff9a41 |
children | e4fb5e01090a |
comparison
equal
deleted
inserted
replaced
10330:240a2c88d439 | 10331:2ae69efc3e8b |
---|---|
379 register struct buffer *b; | 379 register struct buffer *b; |
380 | 380 |
381 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCONS (tail)->cdr) | 381 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
382 { | 382 { |
383 b = XBUFFER (XCONS (XCONS (tail)->car)->cdr); | 383 b = XBUFFER (XCONS (XCONS (tail)->car)->cdr); |
384 if (STRINGP (b->filename) && b->save_modified < BUF_MODIFF (b)) | 384 if (STRINGP (b->filename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) |
385 unlock_file (b->filename); | 385 unlock_file (b->filename); |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 | 389 |
397 { | 397 { |
398 if (NILP (fn)) | 398 if (NILP (fn)) |
399 fn = current_buffer->filename; | 399 fn = current_buffer->filename; |
400 else | 400 else |
401 CHECK_STRING (fn, 0); | 401 CHECK_STRING (fn, 0); |
402 if (current_buffer->save_modified < MODIFF | 402 if (SAVE_MODIFF < MODIFF |
403 && !NILP (fn)) | 403 && !NILP (fn)) |
404 lock_file (fn); | 404 lock_file (fn); |
405 return Qnil; | 405 return Qnil; |
406 } | 406 } |
407 | 407 |
409 0, 0, 0, | 409 0, 0, 0, |
410 "Unlock the file visited in the current buffer,\n\ | 410 "Unlock the file visited in the current buffer,\n\ |
411 if it should normally be locked.") | 411 if it should normally be locked.") |
412 () | 412 () |
413 { | 413 { |
414 if (current_buffer->save_modified < MODIFF && | 414 if (SAVE_MODIFF < MODIFF |
415 STRINGP (current_buffer->filename)) | 415 && STRINGP (current_buffer->filename)) |
416 unlock_file (current_buffer->filename); | 416 unlock_file (current_buffer->filename); |
417 return Qnil; | 417 return Qnil; |
418 } | 418 } |
419 | 419 |
420 | 420 |
421 /* Unlock the file visited in buffer BUFFER. */ | 421 /* Unlock the file visited in buffer BUFFER. */ |
422 | 422 |
423 unlock_buffer (buffer) | 423 unlock_buffer (buffer) |
424 struct buffer *buffer; | 424 struct buffer *buffer; |
425 { | 425 { |
426 if (buffer->save_modified < BUF_MODIFF (buffer) && | 426 if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer) |
427 STRINGP (buffer->filename)) | 427 && STRINGP (buffer->filename)) |
428 unlock_file (buffer->filename); | 428 unlock_file (buffer->filename); |
429 } | 429 } |
430 | 430 |
431 DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 0, 1, 0, | 431 DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 0, 1, 0, |
432 "Return nil if the FILENAME is not locked,\n\ | 432 "Return nil if the FILENAME is not locked,\n\ |