diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-08-05 08:14:43 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-08-05 08:14:43 +0400 |
commit | 8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f (patch) | |
tree | 36980f65ace0a9492e3a28473a89428d6f45c44f /src/filelock.c | |
parent | 3e2cd454fdc04a1afefa23cdfe241c11862eaa8d (diff) | |
download | emacs-8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f.tar.gz |
New macro to iterate over live buffers similar to frames.
* buffer.h (FOR_EACH_LIVE_BUFFER): New macro.
(Vbuffer_alist, Qpriority, Qbefore_string, Qafter_string):
Declare buffer-related variables here to offload lisp.h.
* buffer.c (Vbuffer_alist): Adjust comment.
(Fget_file_buffer, get_truename_buffer, Fother_buffer)
(other_buffer_safely):
* data.c (store_symval_forwarding):
* dispnew.c (Fframe_or_buffer_changed_p):
* fileio.c (Fdo_auto_save):
* filelock.c (unlock_all_files):
* minibuf.c (read_minibuf): Use FOR_EACH_LIVE_BUFFER.
Diffstat (limited to 'src/filelock.c')
-rw-r--r-- | src/filelock.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/filelock.c b/src/filelock.c index 0f31b7d4deb..cb0bd5c7b96 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -745,16 +745,15 @@ unlock_file (Lisp_Object fn) void unlock_all_files (void) { - register Lisp_Object tail; + register Lisp_Object tail, buf; register struct buffer *b; - for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) + FOR_EACH_LIVE_BUFFER (tail, buf) { - b = XBUFFER (XCDR (XCAR (tail))); - if (STRINGP (BVAR (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) - { - unlock_file (BVAR (b, file_truename)); - } + b = XBUFFER (buf); + if (STRINGP (BVAR (b, file_truename)) + && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) + unlock_file (BVAR (b, file_truename)); } } |